예제 #1
0
 def __init__(self, spec):
     super(StatelessOperation, self).__init__(spec)
     self.open_func, self.close_func, self.process_element_func = \
         extract_stateless_function(
             user_defined_function_proto=self.spec.serialized_fn,
             runtime_context=StreamingRuntimeContext.of(
                 self.spec.serialized_fn.runtime_context,
                 self.base_metric_group))
예제 #2
0
 def __init__(self, spec, keyed_state_backend):
     super(StatefulOperation, self).__init__(spec)
     self.keyed_state_backend = keyed_state_backend
     self.open_func, self.close_func, self.process_element_func, self.process_timer_func, \
         self.internal_timer_service = \
         extract_stateful_function(
             user_defined_function_proto=self.spec.serialized_fn,
             runtime_context=StreamingRuntimeContext.of(
                 self.spec.serialized_fn.runtime_context,
                 self.base_metric_group,
                 self.keyed_state_backend),
             keyed_state_backend=self.keyed_state_backend)
예제 #3
0
 def __init__(self, serialized_fn, operator_state_backend):
     super(StatelessOperation, self).__init__(serialized_fn,
                                              operator_state_backend)
     (
         self.open_func,
         self.close_func,
         self.process_element_func,
     ) = extract_stateless_function(
         user_defined_function_proto=serialized_fn,
         runtime_context=StreamingRuntimeContext.of(
             serialized_fn.runtime_context, self.base_metric_group),
         operator_state_store=operator_state_backend,
     )