Class FailureHandlingStorageStrategy
java.lang.Object
com.inductiveautomation.historian.gateway.api.storage.strategy.PointStorageStrategy
com.inductiveautomation.historian.gateway.api.storage.strategy.FailureHandlingStorageStrategy
A
PointStorageStrategy decorator that routes points its delegate failed to store to a
FailureHandlingStorageStrategy.StorageFailureHandler. What happens to them (quarantine, durable retry, drop, alarm) is
the handler's decision.
All processXxx calls, metrics(), flushNow(), pauseProcessing(), resumeProcessing() and stopProcessing() pass through to
the delegate.
Failures are detected on the downstream PointStorageStrategy.Listener, not on the per-call result stage: a
debouncing delegate completes every coalesced caller with the same merged result, so per-call
observation would hand the same points to the handler once per caller. Each flushed batch's
TemporalPointBatch.result() is inspected once, and any non-empty failedData() is
routed to the handler. Only the delegate's flush path invokes the listener, so points the handler
re-submits elsewhere cannot loop back.
- Since:
- 2027.02
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacePolicy for points a delegate strategy failed to store, invoked once per failed flush with thefailedData()of aFAILURE,PARTIAL_FAILUREorEXCEPTIONresult and the failure reason.Nested classes/interfaces inherited from class PointStorageStrategy
PointStorageStrategy.Listener -
Field Summary
Fields inherited from class PointStorageStrategy
SHUTDOWN_FAILURE_CODE, UNHANDLED_FAILURE_CODE -
Method Summary
Modifier and TypeMethodDescriptioncreate(PointStorageStrategy delegate, FailureHandlingStorageStrategy.StorageFailureHandler failureHandler) Creates a decorator arounddelegate.voidflushNow()Starts draining any buffered data without waiting for timers; best-effort, and the drain may not have completed on return.Returns batch size, dwell and downstream duration over a window of recent flushes.metrics()Returns how much data is queued and how long the oldest has waited.voidonPointsReady(PointStorageStrategy.Listener pointsConsumer) Registers the listener for ready batches.voidSuspends forwarding for a transient pause, such as an engine restart, while buffering strategies keep accepting and retaining points untilPointStorageStrategy.resumeProcessing().processAtomic(List<AtomicPoint<?>> atomicPoints) Processes atomic points asynchronously.<C extends ChangePoint<?>>
CompletionStage<StorageResult<C>> processChanges(List<C> changePoints) Processes change points asynchronously.<C extends ComplexPoint<?>>
CompletionStage<StorageResult<C>> processComplex(List<C> complexPoints) Processes complex points asynchronously.voidResumes processing afterPointStorageStrategy.pauseProcessing()orPointStorageStrategy.stopProcessing().voidStops processing, rejects further points and releases resources.Methods inherited from class PointStorageStrategy
completeAsFailure, failureWithError, forwardPoints, joinSubBatchResults
-
Method Details
-
create
public static FailureHandlingStorageStrategy create(PointStorageStrategy delegate, FailureHandlingStorageStrategy.StorageFailureHandler failureHandler) Creates a decorator arounddelegate.- Parameters:
delegate- the strategy whose failures are routed to the handlerfailureHandler- the policy applied to points the delegate failed to store- Returns:
- the decorator
-
processAtomic
public CompletionStage<StorageResult<AtomicPoint<?>>> processAtomic(List<AtomicPoint<?>> atomicPoints) Description copied from class:PointStorageStrategyProcesses atomic points asynchronously.- Specified by:
processAtomicin classPointStorageStrategy- Parameters:
atomicPoints- the points to process.- Returns:
- a stage completing with the storage result.
-
processComplex
public <C extends ComplexPoint<?>> CompletionStage<StorageResult<C>> processComplex(List<C> complexPoints) Description copied from class:PointStorageStrategyProcesses complex points asynchronously.- Specified by:
processComplexin classPointStorageStrategy- Type Parameters:
C- the complex point type.- Parameters:
complexPoints- the points to process.- Returns:
- a stage completing with the storage result.
-
processChanges
public <C extends ChangePoint<?>> CompletionStage<StorageResult<C>> processChanges(List<C> changePoints) Description copied from class:PointStorageStrategyProcesses change points asynchronously.- Specified by:
processChangesin classPointStorageStrategy- Type Parameters:
C- the change point type.- Parameters:
changePoints- the points to process.- Returns:
- a stage completing with the storage result.
-
pauseProcessing
public void pauseProcessing()Description copied from class:PointStorageStrategySuspends forwarding for a transient pause, such as an engine restart, while buffering strategies keep accepting and retaining points untilPointStorageStrategy.resumeProcessing(). UnlikePointStorageStrategy.stopProcessing(), nothing is rejected. The default delegates toPointStorageStrategy.stopProcessing(), for strategies that cannot buffer (e.g.ImmediateStorageStrategy).- Overrides:
pauseProcessingin classPointStorageStrategy
-
stopProcessing
public void stopProcessing()Description copied from class:PointStorageStrategyStops processing, rejects further points and releases resources. Call when the engine is shutting down.- Specified by:
stopProcessingin classPointStorageStrategy
-
resumeProcessing
public void resumeProcessing()Description copied from class:PointStorageStrategyResumes processing afterPointStorageStrategy.pauseProcessing()orPointStorageStrategy.stopProcessing().- Specified by:
resumeProcessingin classPointStorageStrategy
-
onPointsReady
Description copied from class:PointStorageStrategyRegisters the listener for ready batches. Composite strategies override this to pass the listener on to their delegates.- Overrides:
onPointsReadyin classPointStorageStrategy- Parameters:
pointsConsumer- the listener to register.
-
metrics
Description copied from class:PointStorageStrategyReturns how much data is queued and how long the oldest has waited. Buffering strategies override this; the default is empty, for strategies that hold no backlog.- Overrides:
metricsin classPointStorageStrategy- Returns:
- the current metrics, or empty if the strategy accumulates no data.
-
flushTelemetry
Description copied from class:PointStorageStrategyReturns batch size, dwell and downstream duration over a window of recent flushes. Buffering strategies override this; the default is empty.- Overrides:
flushTelemetryin classPointStorageStrategy- Returns:
- the current telemetry, or empty if the strategy does not flush in batches.
-
flushNow
public void flushNow()Description copied from class:PointStorageStrategyStarts draining any buffered data without waiting for timers; best-effort, and the drain may not have completed on return. The default does nothing, for strategies that hold no backlog.- Overrides:
flushNowin classPointStorageStrategy
-