public class MemoryStore extends NotifyingSailBase implements FederatedServiceResolverClient
Modifier and Type | Field and Description |
---|---|
protected static String |
DATA_FILE_NAME |
protected static String |
SYNC_FILE_NAME |
connectionTimeOut, DEFAULT_CONNECTION_TIMEOUT, initializationLock, logger
Constructor and Description |
---|
MemoryStore()
Creates a new MemoryStore.
|
MemoryStore(File dataDir)
Creates a new persistent MemoryStore.
|
Modifier and Type | Method and Description |
---|---|
protected Statement |
addStatement(Resource subj,
URI pred,
Value obj,
Resource context,
boolean explicit) |
protected void |
cancelSyncTask() |
protected void |
cancelSyncTimer() |
protected void |
cleanSnapshots()
Removes statements from old snapshots from the main statement list and
resets the snapshot to 1 for the rest of the statements.
|
protected void |
commit() |
protected <X extends Exception> |
createStatementIterator(Class<X> excClass,
Resource subj,
URI pred,
Value obj,
boolean explicitOnly,
int snapshot,
ReadMode readMode,
Resource... contexts)
Creates a StatementIterator that contains the statements matching the
specified pattern of subject, predicate, object, context.
|
protected NotifyingSailConnection |
getConnectionInternal()
Returns a store-specific SailConnection object.
|
protected int |
getCurrentSnapshot() |
FederatedServiceResolver |
getFederatedServiceResolver() |
protected org.openrdf.sail.memory.MemNamespaceStore |
getNamespaceStore() |
boolean |
getPersist() |
protected MemStatementList |
getStatements() |
protected Lock |
getStatementsReadLock() |
long |
getSyncDelay()
Gets the currently configured sync delay.
|
protected Lock |
getTransactionLock() |
MemValueFactory |
getValueFactory()
Gets a ValueFactory object that can be used to create URI-, blank node-,
literal- and statement objects.
|
protected boolean |
hasStatement(Resource subj,
URI pred,
Value obj,
boolean explicitOnly,
int snapshot,
ReadMode readMode,
Resource... contexts) |
protected void |
initializeInternal()
Initializes this repository.
|
boolean |
isWritable()
Checks whether this Sail object is writable.
|
protected boolean |
removeStatement(MemStatement st,
boolean explicit) |
protected void |
rollback() |
protected void |
scheduleSnapshotCleanup() |
protected void |
scheduleSyncTask() |
void |
setFederatedServiceResolver(FederatedServiceResolver reslover)
Overrides the
FederatedServiceResolver used by this instance, but
the given resolver is not shutDown when this instance is. |
void |
setPersist(boolean persist) |
void |
setSyncDelay(long syncDelay)
Sets the time (in milliseconds) to wait after a transaction was commited
before writing the changed data to file.
|
protected void |
shutDownInternal()
Do store-specific operations to ensure proper shutdown of the store.
|
protected int |
size() |
protected void |
startTransaction() |
void |
sync()
Synchronizes the contents of this repository with the data that is stored
on disk.
|
protected void |
syncWithLock()
Synchronizes the contents of this repository with the data that is stored
on disk.
|
protected Lock |
tryTransactionLock() |
addSailChangedListener, getConnection, notifySailChanged, removeSailChangedListener
addSupportedIsolationLevel, connectionClosed, debugEnabled, getDataDir, getDefaultIsolationLevel, getSupportedIsolationLevels, initialize, isInitialized, removeSupportedIsolationLevel, setDataDir, setDefaultIsolationLevel, setSupportedIsolationLevels, shutDown, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDataDir, getDefaultIsolationLevel, getSupportedIsolationLevels, initialize, setDataDir, shutDown
protected static final String DATA_FILE_NAME
protected static final String SYNC_FILE_NAME
public MemoryStore()
public MemoryStore(File dataDir)
dataDir
- the data directory to be used for persistence.public void setPersist(boolean persist)
public boolean getPersist()
public void setSyncDelay(long syncDelay)
The default value for this parameter is 0 (immediate synchronization).
syncDelay
- The sync delay in milliseconds.public long getSyncDelay()
setSyncDelay(long)
public FederatedServiceResolver getFederatedServiceResolver()
public void setFederatedServiceResolver(FederatedServiceResolver reslover)
FederatedServiceResolver
used by this instance, but
the given resolver is not shutDown when this instance is.setFederatedServiceResolver
in interface FederatedServiceResolverClient
reslover
- The SERVICE resolver to set.protected void initializeInternal() throws SailException
initializeInternal
in class SailBase
SailException
- when initialization of the store failed.protected void shutDownInternal() throws SailException
SailBase
shutDownInternal
in class SailBase
SailException
public boolean isWritable()
isWritable
in interface Sail
protected NotifyingSailConnection getConnectionInternal() throws SailException
SailBase
getConnectionInternal
in class NotifyingSailBase
SailException
public MemValueFactory getValueFactory()
Sail
getValueFactory
in interface Sail
protected org.openrdf.sail.memory.MemNamespaceStore getNamespaceStore()
protected MemStatementList getStatements()
protected int getCurrentSnapshot()
protected Lock getStatementsReadLock() throws SailException
SailException
protected Lock getTransactionLock() throws SailException
SailException
protected Lock tryTransactionLock()
protected int size()
protected boolean hasStatement(Resource subj, URI pred, Value obj, boolean explicitOnly, int snapshot, ReadMode readMode, Resource... contexts)
protected <X extends Exception> CloseableIteration<MemStatement,X> createStatementIterator(Class<X> excClass, Resource subj, URI pred, Value obj, boolean explicitOnly, int snapshot, ReadMode readMode, Resource... contexts)
protected Statement addStatement(Resource subj, URI pred, Value obj, Resource context, boolean explicit) throws SailException
SailException
protected boolean removeStatement(MemStatement st, boolean explicit) throws SailException
SailException
protected void startTransaction() throws SailException
SailException
protected void commit() throws SailException
SailException
protected void rollback() throws SailException
SailException
protected void scheduleSyncTask() throws SailException
SailException
protected void cancelSyncTask()
protected void cancelSyncTimer()
public void sync() throws SailException
SailException
protected void syncWithLock() throws SailException
statementListLockManager
before calling this
method to prevent modifications to the statements list while the
synchronization is in progress.SailException
protected void cleanSnapshots() throws InterruptedException
InterruptedException
protected void scheduleSnapshotCleanup()
Copyright © 2001-2016 Aduna. All Rights Reserved.