public class MemoryStore extends NotifyingSailBase
| 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() |
protected int |
getCurrentSnapshot() |
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() |
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 |
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() |
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.
|
addSailChangedListener, getConnection, notifySailChanged, removeSailChangedListenerconnectionClosed, debugEnabled, getDataDir, initialize, isInitialized, setDataDir, shutDown, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDataDir, initialize, setDataDir, shutDownprotected 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)protected void initializeInternal()
throws SailException
initializeInternal in class SailBaseSailException - when initialization of the store failed.protected void shutDownInternal()
throws SailException
shutDownInternal in class SailBaseSailExceptionpublic boolean isWritable()
protected NotifyingSailConnection getConnectionInternal() throws SailException
getConnectionInternal in class NotifyingSailBaseSailExceptionpublic MemValueFactory getValueFactory()
protected org.openrdf.sail.memory.MemNamespaceStore getNamespaceStore()
protected MemStatementList getStatements()
protected int getCurrentSnapshot()
protected Lock getStatementsReadLock() throws SailException
SailExceptionprotected Lock getTransactionLock() throws SailException
SailExceptionprotected 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
SailExceptionprotected boolean removeStatement(MemStatement st, boolean explicit) throws SailException
SailExceptionprotected void startTransaction()
throws SailException
SailExceptionprotected void commit()
throws SailException
SailExceptionprotected void rollback()
throws SailException
SailExceptionprotected void scheduleSyncTask()
throws SailException
SailExceptionprotected void cancelSyncTask()
protected void cancelSyncTimer()
public void sync()
throws SailException
SailExceptionprotected void syncWithLock()
throws SailException
statementListLockManager before calling this
method to prevent modifications to the statements list while the
synchronization is in progress.SailExceptionprotected void cleanSnapshots()
throws InterruptedException
InterruptedExceptionprotected void scheduleSnapshotCleanup()
Copyright © 2001-2014 Aduna. All Rights Reserved.