Class MemStatementList
java.lang.Object
org.eclipse.rdf4j.sail.memory.model.MemStatementList
A dedicated data structure for storing MemStatement objects, offering operations optimized for their use in the
memory Sail.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final MemStatement[]private static final VarHandleprivate intprivate static final VarHandleprivate intprivate static final VarHandleprivate booleanprivate final AtomicReference<Thread> private intprivate static final VarHandleprivate MemStatement[]private static final VarHandle(package private) static final VarHandle -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(MemStatement st) voidcleanSnapshots(int currentSnapshot) voidclear()getExact(MemResource subject, MemIRI predicate, MemValue object, MemResource context, int snapshot) Iterates through this list and returns the statement that exactly matches the provided arguments.int(package private) intAn internal method to retrieve the inner array that stores the statements.private MemStatement[]booleanisEmpty()private booleanoptimisticInnerRemove(MemStatement toRemove, MemStatement[] statements, int i) booleanbooleanoptimisticRemove(MemStatement st, int index) voidsetPrioritiseCleanup(boolean prioritiseCleanup) intsize()private voidupdateGuaranteedLastIndexInUse(int newValue) (package private) boolean
-
Field Details
-
EMPTY_ARRAY
-
statements
-
STATEMENTS
-
STATEMENTS_ARRAY
-
size
private volatile int size -
SIZE
-
previouslyInsertedIndex
private volatile int previouslyInsertedIndex -
PREVIOUSLY_INSERTED_INDEX
-
guaranteedLastIndexInUse
private volatile int guaranteedLastIndexInUse -
GUARANTEED_LAST_INDEX_IN_USE
-
prioritiseCleanup
private volatile boolean prioritiseCleanup -
PRIORITISE_CLEANUP
-
prioritisedThread
-
-
Constructor Details
-
MemStatementList
public MemStatementList() -
MemStatementList
public MemStatementList(int capacity)
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
add
- Throws:
InterruptedException
-
updateGuaranteedLastIndexInUse
private void updateGuaranteedLastIndexInUse(int newValue) -
optimisticRemove
- Throws:
InterruptedException
-
optimisticRemove
- Throws:
InterruptedException
-
optimisticInnerRemove
-
clear
public void clear() -
cleanSnapshots
- Throws:
InterruptedException
-
getExact
public MemStatement getExact(MemResource subject, MemIRI predicate, MemValue object, MemResource context, int snapshot) throws InterruptedException Iterates through this list and returns the statement that exactly matches the provided arguments. The subject, predicate and object should not be null. If the context is null it will match statements with null as their context.- Parameters:
subject-predicate-object-context-snapshot-- Returns:
- Throws:
InterruptedException
-
getStatements
An internal method to retrieve the inner array that stores the statements. Useful to reduce the number of volatile reads.- Returns:
- the underlying array og MemStatements
- Throws:
InterruptedException
-
getStatementsWithoutInterrupt
-
getGuaranteedLastIndexInUse
public int getGuaranteedLastIndexInUse() -
setPrioritiseCleanup
public void setPrioritiseCleanup(boolean prioritiseCleanup) -
verifySizeForTesting
boolean verifySizeForTesting() -
getRealSizeForTesting
int getRealSizeForTesting()
-