Interface StorageEngine
- All Known Implementing Classes:
AbstractStorageEngine, TagHistoryStorageEngineBridge
public interface StorageEngine
Backing storage for atomic, complex and change points, written by
DataCollector sessions
and by pre-batched writers.
storeAtomic, storeComplex and applyChanges are asynchronous: each
returns a CompletionStage that completes once the engine has processed the points, with
per-point success, failure or exception reported in the StorageResult rather than through
the stage's exceptional path. Implementations must be safe for concurrent use: several DataCollector sessions and pre-batched writers can write at once.
getOrCreateDataCollector(CollectorId) is the entry point for per-node collection; each CollectorId maps to one DataCollector that buffers and debounces writes to this engine.
batchWriter() is the path for callers that have already coalesced their points.
-
Method Summary
Modifier and TypeMethodDescription<C extends ChangePoint<?>>
CompletionStage<StorageResult<C>> applyChanges(List<C> changePoints) Applies change points asynchronously.default Optional<BatchedStorageWriter> Returns this engine's batched write path, which bypasses the debounce queue.default DataCollectorgetOrCreateDataCollector(CollectorId collectorId) Returns theDataCollectorfor the given collector id, creating it if needed.storeAtomic(List<AtomicPoint<?>> atomicPoints) Stores atomic points asynchronously.<C extends ComplexPoint<?>>
CompletionStage<StorageResult<C>> storeComplex(List<C> complexPoints) Stores complex points asynchronously.
-
Method Details
-
getOrCreateDataCollector
Returns theDataCollectorfor the given collector id, creating it if needed.- Parameters:
collectorId- identifies and configures the collector- Returns:
- the collector
-
storeAtomic
Stores atomic points asynchronously.- Parameters:
atomicPoints- the points to store- Returns:
- a stage completing with the per-point outcome
-
storeComplex
Stores complex points asynchronously.- Type Parameters:
C- the complex point type- Parameters:
complexPoints- the points to store, not null- Returns:
- a stage completing with the per-point outcome
-
applyChanges
Applies change points asynchronously.- Type Parameters:
C- the change point type- Parameters:
changePoints- the changes to apply, not null- Returns:
- a stage completing with the per-point outcome
-
batchWriter
Returns this engine's batched write path, which bypasses the debounce queue. Callers that have already coalesced their points (bulk ingest, replays) should prefer it overstoreAtomic(List),storeComplex(List)andapplyChanges(List), which may re-enter the debounce queue. Callers fall back to those methods when it is empty.- Returns:
- the batched writer, or empty if this engine has none
-