Class MemorySailStore

java.lang.Object
org.eclipse.rdf4j.sail.memory.MemorySailStore
All Implemented Interfaces:
AutoCloseable, SailClosable, SailStore

class MemorySailStore extends Object implements SailStore
An implementation of SailStore that keeps committed statements in a MemStatementList.
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • RUNTIME

      private static final Runtime RUNTIME
    • MAX_MEMORY

      private static final long MAX_MEMORY
    • CLEANUP_MAX_MEMORY_THRESHOLD

      private static final int CLEANUP_MAX_MEMORY_THRESHOLD
      See Also:
    • CLEANUP_MINIMUM_FREE_MEMORY

      private static final int CLEANUP_MINIMUM_FREE_MEMORY
      See Also:
    • CLEANUP_MINIMUM_FREE_MEMORY_RATIO

      private static final double CLEANUP_MINIMUM_FREE_MEMORY_RATIO
      See Also:
    • EMPTY_ITERATION

      public static final EmptyIteration<MemStatement,SailException> EMPTY_ITERATION
    • EMPTY_TRIPLE_ITERATION

      public static final EmptyIteration<MemTriple,SailException> EMPTY_TRIPLE_ITERATION
    • EMPTY_CONTEXT

      public static final MemResource[] EMPTY_CONTEXT
    • NULL_CONTEXT

      public static final MemResource[] NULL_CONTEXT
    • iteratorCache

      private final MemStatementIteratorCache iteratorCache
    • valueFactory

      private final MemValueFactory valueFactory
      Factory/cache for MemValue objects.
    • statements

      private final MemStatementList statements
      List containing all available statements.
    • mayHaveInferred

      private volatile boolean mayHaveInferred
      This gets set to `true` when we add our first inferred statement. If the value is `false` we guarantee that there are no inferred statements in the MemorySailStore. If it is `true` then an inferred statement was added at some point, but we make no guarantees regarding if there still are inferred statements or if they are in the current snapshot.

      The purpose of this variable is to optimize read operations that only read inferred statements when there are no inferred statements.

    • currentSnapshot

      private volatile int currentSnapshot
      Identifies the current snapshot.
    • snapshotMonitor

      final MemorySailStore.SnapshotMonitor snapshotMonitor
    • namespaceStore

      private final MemNamespaceStore namespaceStore
      Store for namespace prefix info.
    • txnLockManager

      private final ReentrantLock txnLockManager
      Lock manager used to prevent concurrent writes.
    • snapshotCleanupThread

      private volatile Thread snapshotCleanupThread
      Cleanup thread that removes deprecated statements when no other threads are accessing this list. Seee scheduleSnapshotCleanup().
    • snapshotCleanupThreadLockObject

      private final Object snapshotCleanupThreadLockObject
      Lock object used to synchronize concurrent access to snapshotCleanupThread.
  • Constructor Details

    • MemorySailStore

      public MemorySailStore(boolean debug)
  • Method Details