pyleus.storm.component¶
Module containing the base class for all pyleus components and a wrapper class around Storm configurations.
- class pyleus.storm.component.Component(input_stream=None, output_stream=None)[source]¶
Base class for all pyleus components.
- OPTIONS = None¶
list of user-defined options for the component.
Note
Specify in subclass.
- OUTPUT_FIELDS = None¶
list or dict of output fields for the component.
Note
Specify in subclass.
See also
- conf = None¶
StormConfig containing the Storm configuration for the component.
- context = None¶
dict containing the Storm context for the component.
- initialize()[source]¶
Called after component has been launched, but before processing any tuples. You can use this method to setup your component.
Note
Implement in subclass.
- log(msg, level=2)[source]¶
Send a log message.
Parameters: - msg (str) – log message
- level – log levels defined as constants in pyleus.storm. Allowed: LOG_TRACE, LOG_DEBUG, LOG_INFO, LOG_WARN, LOG_ERROR. Default: LOG_INFO
- options = None¶
dict containing options passed to component in the yaml definition file.
- class pyleus.storm.component.StormConfig(conf)[source]¶
Add some convenience properites to a configuration dict from Storm. You can access Storm configuration dictionary within a component through self.conf.
- tick_tuple_freq[source]¶
Helper property to access the value of tick tuple frequency stored in Storm configuration.
Returns: tick tuple frequency for the component Return type: float or None Note
Bolts not specifying tick tuple frequency default to None, while spouts are not supposed to use tick tuples at all.