event_retrieval#
This module contains classes that deals with the retrieval of single standalone events.
- class OmEventDataRetrieval(*, parameters, source)#
Retrieval of single standalone data events.
This class deals with the retrieval of single standalone data events from a data source.
- Parameters:
monitor_parameters – An object storing OM’s configuration parameters.
source (str) – A string describing the data event source.
parameters (MonitorParameters)
- retrieve_event_data(event_id)#
Retrieves all data attached to the requested data event.
This function retrieves all the information associated with the data event specified by the provided identifier. The data is returned in the form of a dictionary.
Each dictionary key identifies a Data Source in the event for which information has been retrieved.
The corresponding dictionary values store the data associated with each Data Source.
- Parameters:
event_id (str) – a string that uniquely identifies a data event.
- Returns:
A dictionary storing all data related the retrieved event.
- Return type:
dict[str, Any]
- class EventListDataEventHandler(*, source, parameters, data_event_handler_class, event_list_file)#
Data event handler for event list files.
This class deals with the retrieval of single standalone data events from a data source.
This class implements the interface described by its base Protocol class. Please see the documentation of that class for additional information about the interface.
- Parameters:
source (str) – A string describing the data event source.
event_list_file (Path) – A string describing the path to the event list file.
data_sources –
A dictionary containing a set of Data Source class instances.
Each dictionary key must define the name of a data source.
The corresponding dictionary value must store the instance of the [Data Source class][om.protocols.data_retrieval_layer.OmDataSourceProtocol] # noqa: E501 that describes the source.
monitor_parameters – An object storing OM’s configuration parameters.
parameters (DataRetrievalLayerParameters)
data_event_handler_class (type[OmDataEventHandlerProtocol])
- designated_collector_rank()#
- Return type:
Literal[‘first’, ‘last’]
- skip_rank_finalization()#
- Return type:
bool
- initialize_event_handling_on_collecting_node(*, node_rank, node_pool_size)#
Initializes the event handling on the collecting node.
Please see the documentation of the base Protocol class for additional information about this method.
- Parameters:
node_rank (int) – The OM rank of the current node int the OM node pool. The rank is an integer that unambiguously identifies the node in the pool.
node_pool_size (int) – The total number of nodes in the OM pool, including all the processing nodes and the collecting node.
- Return type:
None
- initialize_event_handling_on_processing_node(*, node_rank, node_pool_size)#
Initializes the event handling on a processing node.
Please see the documentation of the base Protocol class for additional information about this method.
- Parameters:
node_rank (int) – The OM rank of the current node int the OM node pool. The rank is an integer that unambiguously identifies the node in the pool.
node_pool_size (int) – The total number of nodes in the OM pool, including all the processing nodes and the collecting node.
- Return type:
None
- event_generator(*, node_rank, node_pool_size)#
- Parameters:
node_rank (int)
node_pool_size (int)
- Return type:
Generator[dict[str, Any], None, None]
- extract_data(*, event)#
Extracts data from an event.
Please see the documentation of the base Protocol class for additional information about this method.
- Parameters:
event (dict[str, Any]) – A dictionary storing the event data.
- Returns:
A dictionary storing the extracted data.
Each dictionary key identifies a Data Source in the event for which data has been retrieved.
The corresponding dictionary value stores the data extracted from the Data Source for the event being processed.
- Raises:
OmDataExtractionError – Raised when data cannot be extracted from the event.
- Return type:
dict[str, Any]
- initialize_event_data_retrieval()#
Initializes event data retrieval.
Please see the documentation of the base Protocol class for additional information about this method.
- Return type:
None
- retrieve_event_data(event_id)#
Retrieves all data related to the requested event.
Please see the documentation of the base Protocol class for additional information about this method.
- Parameters:
event_id (str) – A string that uniquely identifies a data event.
- Returns:
All data related to the requested event.
- Return type:
dict[str, Any]