Class EagerStoreStrategy

java.lang.Object
org.apache.jena.mem.store.indexed.EagerStoreStrategy
All Implemented Interfaces:
StoreStrategy

public class EagerStoreStrategy extends Object implements StoreStrategy
StoreStrategy that maintains a complete subject/predicate/object index over the triple set at all times.

Three node-keyed index maps (NodesToIndices) hold, for every subject/predicate/object node, an IndexList of the triple indices that mention it. Three parallel reverse-index arrays (sReverseIndices, pReverseIndices, oReverseIndices) store, for every triple slot, its position inside the corresponding IndexList; this is what makes O(1) removal possible.

A triple's reverse-index slot is only meaningful for the (s,p,o) component the triple actually has; readers must always validate via the indicesLarger[posLarger] == tripleIndex cross-check.

The reverse-index arrays are kept the same length as the underlying keys array of the TripleSet; whenever the triple set grows its keys array, the growReverseIndices hook is invoked to grow the reverse arrays too.