Interface DataCollector
- All Known Implementing Classes:
DataCollectorDelegate
,DataCollectorFactory.AbstractDataCollector
,DataCollectorFactory.ManualDataCollector
,DataCollectorFactory.StreamingDataCollector
,ErroredDataCollector
,HistoryActorFactory.ProviderDataCollectorDelegate
public interface DataCollector
Provides a contract for interacting with data nodes, managing their lifecycle,
and facilitating operations like data collection, metadata updates, and source changes.
The DataCollector implementation acts as a middleware for handling data-related functionalities
across various data nodes.
-
Method Summary
Modifier and TypeMethodDescriptioncreateNodeSession
(QualifiedPath source, DataType dataType, PropertySet configuration) Creates a new session for interacting with a data node.executeDataCollection
(CollectionContext context) Executes the data collection process using the provided context.Retrieves the unique identifier for this data collector.shutdown()
Initiates an orderly shutdown of thisDataCollector
.
-
Method Details
-
createNodeSession
DataNodeSession createNodeSession(QualifiedPath source, DataType dataType, PropertySet configuration) Creates a new session for interacting with a data node. This session allows processing various operations like data changes, metadata updates, and source changes for the specified node. It provides a dedicated context for managing the lifecycle and state of a data node.- Parameters:
source
- TheQualifiedPath
representing the source of the data node.dataType
- TheDataType
specifying the type of data handled by the session.configuration
- APropertySet
containing the configuration properties for the session.- Returns:
- A
DataNodeSession
instance for managing operations and observing state changes for the specified data node.
-
executeDataCollection
Executes the data collection process using the provided context. This operation initiates data retrieval or aggregation based on the configuration and parameters specified in theCollectionContext
instance. The process could include handling periodic or one-time data collections, as well as processing heartbeat operations if indicated in the context.- Parameters:
context
- TheCollectionContext
object encapsulating all necessary details for the data collection operation, such as identifiers, source, interval, timestamp, and value origin.- Returns:
- A
CompletionStage
that completes when the data collection process is finished. If any errors occur during the operation, theCompletionStage
will complete exceptionally.
-
shutdown
CompletionStage<Void> shutdown()Initiates an orderly shutdown of thisDataCollector
. This operation will:- Stop accepting new data points or node sessions
- Process and flush any remaining queued data
- Close all active
DataNodeSession
s - Release any system resources
DataCollector
instance should be considered unusable and any subsequent method calls will result in undefined behavior.- Returns:
- A
CompletionStage
that completes normally when shutdown is finished, or completes exceptionally if errors occurred during shutdown
-
identifier
CollectorId identifier()Retrieves the unique identifier for this data collector. The identifier is used to distinguish between different data collectors and is essential for managing and referencing the collector in various operations.- Returns:
- The
CollectorId
representing the unique identifier of this data collector.
-