Exemplo n.º 1
0
 def _get_base_component(self):
     """Returns Component protobuf message"""
     comp = topology_pb2.Component()
     comp.name = self.name
     comp.spec = topology_pb2.ComponentObjectSpec.Value("PYTHON_CLASS_NAME")
     comp.class_name = self.python_class_path
     comp.config.CopyFrom(self._get_comp_config())
     return comp
Exemplo n.º 2
0
def get_mock_component(name="component_name",
                       config=get_mock_config(),
                       python_cls="heron.instance.src.python.example.word_spout.WordSpout"):
  """Returns a mock protobuf Component object from topology_pb2"""
  component = topology_pb2.Component()
  component.name = name
  component.spec = topology_pb2.ComponentObjectSpec.Value("PYTHON_CLASS_NAME")
  component.class_name = python_cls
  component.config.CopyFrom(config)
  return component