Class RetirementAwareNodeTree<N extends HistoricalNode>
java.lang.Object
com.inductiveautomation.ignition.common.PathTree<QualifiedPath, N>
com.inductiveautomation.historian.gateway.api.query.HistoricalNodeTree<N>
com.inductiveautomation.historian.gateway.api.query.RetirementAwareNodeTree<N>
- Type Parameters:
N- the node type.
- All Implemented Interfaces:
Serializable
public abstract class RetirementAwareNodeTree<N extends HistoricalNode>
extends HistoricalNodeTree<N>
A
HistoricalNodeTree that propagates retirement up the path hierarchy. When a leaf is
registered or its retirement state changes, it retires every implicit-folder ancestor whose
children are all retired, and un-retires every retired implicit-folder ancestor that has an
active child.
Backends supply isImplicit(HistoricalNode) (default false), retireMutation(HistoricalNode) and unretireMutation(HistoricalNode).
Thread-safe: mutations serialize through the tree's write lock and reads through its read
lock. Methods ending in Unlocked require the caller to hold the write lock.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class PathTree
PathTree.TreeNode -
Field Summary
Fields inherited from class HistoricalNodeTree
rwLockExecutor -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRetirementAwareNodeTree(Function<QualifiedPath, N> nodeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanisImplicit(N node) Returns whether a node is a synthetic implicit-folder placeholder.voidRetires each ancestor ofpathwhose children are all retired, up to the root.voidrecursiveRetireWithParent(N node) Retires a node and propagates retirement up the parent chain.final voidAsrecursiveRetireWithParent(QualifiedPath); the caller must hold the write lock.final voidAsrecursiveRetireWithParent(HistoricalNode); the caller must hold the write lock.voidUn-retires each retired implicit-folder ancestor ofpaththat has an active child, up to the root.final voidAsrecursiveUnretireWithParent(QualifiedPath); the caller must hold the write lock.voidregisterNode(N node) Registers a leaf node at its source path and refreshes retirement state on its ancestors, as one atomic operation.final voidregisterNodeUnlocked(N node) AsregisterNode(HistoricalNode); the caller must hold the write lock.protected abstract NretireMutation(N node) Returns a retired copy of the node, without mutating it.protected abstract NunretireMutation(N node) Returns an un-retired copy of the node, without mutating it.voidupdateParentRetirementState(N node) Re-evaluates retirement state up the node's parent chain: retiring ancestors if the node is retired, un-retiring them otherwise.final voidAsupdateParentRetirementState(HistoricalNode); the caller must hold the write lock.Methods inherited from class HistoricalNodeTree
browse, clear, clearUnlocked, computeIfAbsent, computeIfAbsentUnlocked, findNode, findNode, findNodeUnlocked, findNodeUnlocked, get, getAllNestedChildren, getBranches, getBranches, getByCanonicalKey, getChildren, getRoot, getUnlocked, getValuesOfPath, instantiateNode, isReadLockedByCurrentThread, isWriteLockedByCurrentThread, put, putUnlocked, recursiveRemoveWithParent, recursiveRemoveWithParentUnlocked, remove, removeIfEmpty, removeIfEmptyUnlocked, removeUnlocked, size, withReadLock, withReadLock, withWriteLock, withWriteLockMethods inherited from class PathTree
initializeRoot, isCaseSensitive, setCaseSensitive
-
Constructor Details
-
RetirementAwareNodeTree
-
-
Method Details
-
registerNode
Registers a leaf node at its source path and refreshes retirement state on its ancestors, as one atomic operation.- Parameters:
node- the node to register.
-
registerNodeUnlocked
AsregisterNode(HistoricalNode); the caller must hold the write lock. -
recursiveRetireWithParent
Retires a node and propagates retirement up the parent chain. The node must already carry a retirement timestamp and is not mutated. No propagation occurs if its parent is the root.- Parameters:
node- the retired node whose ancestors should be re-evaluated.
-
recursiveRetireWithParentUnlocked
AsrecursiveRetireWithParent(HistoricalNode); the caller must hold the write lock. -
recursiveRetireWithParent
Retires each ancestor ofpathwhose children are all retired, up to the root.- Parameters:
path- the path whose ancestors should be re-evaluated.
-
recursiveRetireWithParentUnlocked
AsrecursiveRetireWithParent(QualifiedPath); the caller must hold the write lock. -
updateParentRetirementState
Re-evaluates retirement state up the node's parent chain: retiring ancestors if the node is retired, un-retiring them otherwise.- Parameters:
node- the leaf node whose retirement state may have changed.
-
updateParentRetirementStateUnlocked
AsupdateParentRetirementState(HistoricalNode); the caller must hold the write lock. -
recursiveUnretireWithParent
Un-retires each retired implicit-folder ancestor ofpaththat has an active child, up to the root.- Parameters:
path- the path whose ancestors should be re-evaluated.
-
recursiveUnretireWithParentUnlocked
AsrecursiveUnretireWithParent(QualifiedPath); the caller must hold the write lock. -
isImplicit
Returns whether a node is a synthetic implicit-folder placeholder.falseby default; backends that synthesize folder nodes override.- Parameters:
node- the candidate node; never null.- Returns:
truefor an implicit-folder node.
-
retireMutation
-
unretireMutation
-