def test_set_get_restart_strategy(self):

        self.env.set_restart_strategy(RestartStrategies.no_restart())

        restart_strategy = self.env.get_restart_strategy()

        self.assertEqual(restart_strategy, RestartStrategies.no_restart())
    def test_get_set_restart_strategy(self):

        self.execution_config.set_restart_strategy(
            RestartStrategies.no_restart())

        self.assertEqual(self.execution_config.get_restart_strategy(),
                         RestartStrategies.no_restart())

        self.execution_config.set_restart_strategy(
            RestartStrategies.failure_rate_restart(5, 10000, 5000))

        self.assertIsInstance(
            self.execution_config.get_restart_strategy(),
            RestartStrategies.FailureRateRestartStrategyConfiguration)

        self.execution_config.set_restart_strategy(
            RestartStrategies.fixed_delay_restart(4, 10000))

        self.assertIsInstance(
            self.execution_config.get_restart_strategy(),
            RestartStrategies.FixedDelayRestartStrategyConfiguration)

        self.execution_config.set_restart_strategy(
            RestartStrategies.fall_back_restart())

        self.assertEqual(self.execution_config.get_restart_strategy(),
                         RestartStrategies.fall_back_restart())
Example #3
0
    def setUp(self):
        self.env = StreamExecutionEnvironment.get_execution_environment()
        self._load_dependency_jars()
        config = Configuration(
            j_configuration=get_j_env_configuration(self.env._j_stream_execution_environment))
        config.set_boolean("execution.checkpointing.checkpoints-after-tasks-finish.enabled", True)

        self.env.set_parallelism(4)
        self.env.enable_checkpointing(100)
        self.env.set_restart_strategy(RestartStrategies.no_restart())
        self.t_env = StreamTableEnvironment.create(self.env)
        self.temp_dir = tempfile.mkdtemp()