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 Details

    • getOrCreateDataCollector

      default DataCollector getOrCreateDataCollector(CollectorId collectorId)
      Returns the DataCollector for the given collector id, creating it if needed.
      Parameters:
      collectorId - identifies and configures the collector
      Returns:
      the collector
    • storeAtomic

      CompletionStage<StorageResult<AtomicPoint<?>>> storeAtomic(List<AtomicPoint<?>> atomicPoints)
      Stores atomic points asynchronously.
      Parameters:
      atomicPoints - the points to store
      Returns:
      a stage completing with the per-point outcome
    • storeComplex

      <C extends ComplexPoint<?>> CompletionStage<StorageResult<C>> storeComplex(List<C> complexPoints)
      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

      <C extends ChangePoint<?>> CompletionStage<StorageResult<C>> applyChanges(List<C> changePoints)
      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

      default Optional<BatchedStorageWriter> 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 over storeAtomic(List), storeComplex(List) and applyChanges(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