Class AbstractStorageEngine
java.lang.Object
com.inductiveautomation.historian.gateway.api.storage.AbstractStorageEngine
- All Implemented Interfaces:
StorageEngine
- Direct Known Subclasses:
TagHistoryStorageEngineBridge
An abstract storage engine providing functionalities to store different types of data points
such as atomic, complex, and change points.
It serves as a base implementation for storage mechanisms,
handling core logic and delegating specific processing to the implemented methods.
The class enforces type validation for supported complex and change point types and provides structured storage operations, ensuring extensibility for custom implementations.
Fields, constructors, and methods provide support for logging, metric collection, type validation, and thread-safe processing of data points.
Responsibilities include: 1. Validation of storage engine availability before proceeding with operations. 2. Processing and storing atomic points using the configured storage processor. 3. Handling of complex points with type checks and delegation to specific storage operations. 4. Managing change points with type checks and delegation, allowing extensibility for custom changes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final GatewayContextprotected final Stringprotected final LoggerExprotected final AbstractStorageEngine.StorageMetricsprotected final QualifiedPathAdapterprotected final Set<? extends ChangePointType>protected final Set<? extends ComplexPointType> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractStorageEngine(GatewayContext gatewayContext, String historianName, LoggerEx logger) protectedAbstractStorageEngine(GatewayContext gatewayContext, String historianName, LoggerEx logger, QualifiedPathAdapter pathAdapter) protectedAbstractStorageEngine(GatewayContext gatewayContext, String historianName, LoggerEx logger, QualifiedPathAdapter pathAdapter, PointStorageStrategy storageStrategy) protectedAbstractStorageEngine(GatewayContext gatewayContext, String historianName, LoggerEx logger, QualifiedPathAdapter pathAdapter, Set<? extends ComplexPointType> supportedComplexTypes, Set<? extends ChangePointType> supportedChangeTypes, PointStorageStrategy storageStrategy) -
Method Summary
Modifier and TypeMethodDescriptionprotected StorageResult<AnnotationChangePoint>applyAnnotationChanges(List<AnnotationChangePoint> annotationChangePoints) final <C extends ChangePoint<?>>
CompletionStage<StorageResult<C>>applyChanges(List<C> changePoints) Applies a list of change points to the storage engine and returns the result of the operation.protected abstract StorageResult<SourceChangePoint>applySourceChanges(List<SourceChangePoint> sourceChangePoints) protected final <C extends ChangePoint<?>>
StorageResult<C>doApplyChanges(List<C> changePoints) protected StorageResult<AnnotationPoint>doStoreAnnotations(List<AnnotationPoint> annotationPoints) protected abstract StorageResult<AtomicPoint<?>>doStoreAtomic(List<AtomicPoint<?>> atomicPoints) protected final <C extends ComplexPoint<?>>
StorageResult<C>doStoreComplex(List<C> complexPoints) protected StorageResult<MetadataPoint>doStoreMetadata(List<MetadataPoint> metadataPoints) protected abstract booleanprotected voidfinal CompletionStage<StorageResult<AtomicPoint<?>>>storeAtomic(List<AtomicPoint<?>> atomicPoints) Stores a list of atomic points in the underlying storage system.final <C extends ComplexPoint<?>>
CompletionStage<StorageResult<C>>storeComplex(List<C> complexPoints) Stores a list of complex points in the underlying storage system.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.inductiveautomation.historian.gateway.api.storage.StorageEngine
getOrCreateDataCollector
-
Field Details
-
logger
-
gatewayContext
-
historianName
-
pathAdapter
-
supportedComplexTypes
-
supportedChangeTypes
-
metrics
-
-
Constructor Details
-
AbstractStorageEngine
protected AbstractStorageEngine(GatewayContext gatewayContext, String historianName, LoggerEx logger) -
AbstractStorageEngine
protected AbstractStorageEngine(GatewayContext gatewayContext, String historianName, LoggerEx logger, QualifiedPathAdapter pathAdapter) -
AbstractStorageEngine
protected AbstractStorageEngine(GatewayContext gatewayContext, String historianName, LoggerEx logger, QualifiedPathAdapter pathAdapter, PointStorageStrategy storageStrategy) -
AbstractStorageEngine
protected AbstractStorageEngine(GatewayContext gatewayContext, String historianName, LoggerEx logger, QualifiedPathAdapter pathAdapter, Set<? extends ComplexPointType> supportedComplexTypes, Set<? extends ChangePointType> supportedChangeTypes, PointStorageStrategy storageStrategy)
-
-
Method Details
-
storeAtomic
public final CompletionStage<StorageResult<AtomicPoint<?>>> storeAtomic(List<AtomicPoint<?>> atomicPoints) Description copied from interface:StorageEngineStores a list of atomic points in the underlying storage system. This method processes the provided list ofAtomicPointinstances and stores them asynchronously. The result of the storage operation is returned as aCompletionStagethat resolves to aStorageResult.- Specified by:
storeAtomicin interfaceStorageEngine- Parameters:
atomicPoints- the list of atomic points to be stored- Returns:
- a
CompletionStagethat resolves to aStorageResultcontaining the outcome of storing the atomic points
-
applyChanges
public final <C extends ChangePoint<?>> CompletionStage<StorageResult<C>> applyChanges(List<C> changePoints) Description copied from interface:StorageEngineApplies a list of change points to the storage engine and returns the result of the operation. The change points represent modifications that should be applied to the storage system.- Specified by:
applyChangesin interfaceStorageEngine- Type Parameters:
C- the type of change points, extendingChangePoint- Parameters:
changePoints- the list of change points to be applied, not null- Returns:
- a
CompletionStagethat resolves to aStorageResultcontaining the result of applying the change points
-
storeComplex
public final <C extends ComplexPoint<?>> CompletionStage<StorageResult<C>> storeComplex(List<C> complexPoints) Description copied from interface:StorageEngineStores a list of complex points in the underlying storage system. This method processes the given list of complex points and stores them asynchronously. The result of the storage operation is returned as aCompletionStagethat resolves to aStorageResult.- Specified by:
storeComplexin interfaceStorageEngine- Type Parameters:
C- the type of complex points, extendingComplexPoint- Parameters:
complexPoints- the list of complex points to be stored, not null- Returns:
- a
CompletionStagethat resolves to aStorageResultcontaining the result of the storage operation
-
doStoreComplex
-
doApplyChanges
-
shutdownProcessor
protected void shutdownProcessor() -
doStoreAnnotations
-
doStoreMetadata
-
applyAnnotationChanges
protected StorageResult<AnnotationChangePoint> applyAnnotationChanges(List<AnnotationChangePoint> annotationChangePoints) -
applySourceChanges
protected abstract StorageResult<SourceChangePoint> applySourceChanges(List<SourceChangePoint> sourceChangePoints) -
doStoreAtomic
-