Example #1
0
    def test_execution_3(self):
        test_operator_1 = DummyUtil.dummy_batch_operator(operator_name='test_operator_1')
        test_operator_2 = DummyUtil.dummy_batch_operator(operator_name='test_operator_2')
        test_operator_3 = DummyUtil.dummy_batch_operator(operator_name='test_operator_3')
        test_operator_1.add_child(child_node=test_operator_2)
        test_operator_2.add_child(child_node=test_operator_3)
        test_operator_1.set_status(status=Status.FAILED)
        test_operator_2.execute()
        test_operator_3.execute()

        self.assertEqual(test_operator_2.get_operator_snapshot().status, Status.FAILED)
        self.assertEqual(test_operator_3.get_operator_snapshot().status, Status.FAILED)
Example #2
0
 def start(self):
     ttl_cleaner_op = TTLCleanerOp()
     dummy_op = DummyUtil.dummy_batch_operator(
         operator_name=self.get_class_name() + '_dummy')
     self.add_operator_edge(from_operator=ttl_cleaner_op,
                            to_operator=dummy_op)
     self.initialize()
     self.execute()
Example #3
0
    container1 = HelloWorldContainer()
    container1.bind_backend(
        server_url="localhost:11443"
    )
    container1.add_operator_edge(from_operator=op1, to_operator=op3)
    container1.add_operator_edge(from_operator=op1, to_operator=op4)
    container1.add_operator_edge(from_operator=op2, to_operator=op3)
    container1.add_operator_edge(from_operator=op2, to_operator=op4)
    container1.initialize()
    container1.execute()

    container2 = HelloWorldContainer(container_name='hello_world_container_2')
    container2.bind_backend(
        server_url="localhost:11443"
    )
    dummy_op = DummyUtil.dummy_batch_operator(operator_name='dummy')
    op1.set_config(
        config={
            'save_snapshot': True,
        }
    )

    op1.unset_dependency()
    op1.unset_status()
    op2.unset_dependency()
    op2.unset_status()
    op3.unset_dependency()
    op3.unset_status()
    op4.unset_dependency()
    op4.unset_status()