org.openrdf.sail.nativerdf
Class NativeStore

java.lang.Object
  extended by org.openrdf.sail.helpers.SailBase
      extended by org.openrdf.sail.nativerdf.NativeStore
All Implemented Interfaces:
Sail

public class NativeStore
extends SailBase

A SAIL implementation using B-Tree indexing on disk for storing and querying its data.

Author:
Arjohn Kampman, jeen

Field Summary
 
Fields inherited from class org.openrdf.sail.helpers.SailBase
connectionTimeOut, DEFAULT_CONNECTION_TIMEOUT, logger
 
Constructor Summary
NativeStore()
          Creates a new NativeStore.
NativeStore(File dataDir)
           
NativeStore(File dataDir, String tripleIndexes)
           
 
Method Summary
protected  CloseableIteration<? extends Statement,IOException> createStatementIterator(Resource subj, URI pred, Value obj, boolean includeInferred, boolean readTransaction, Resource... contexts)
          Creates a statement iterator based on the supplied pattern.
protected  SailConnection getConnectionInternal()
          returns a store-specific SailConnection object.
protected  List<Integer> getContextIDs(Resource... contexts)
           
 boolean getForceSync()
           
protected  org.openrdf.sail.nativerdf.NamespaceStore getNamespaceStore()
           
protected  Lock getReadLock()
           
protected  Lock getTransactionLock()
           
 String getTripleIndexes()
           
protected  org.openrdf.sail.nativerdf.TripleStore getTripleStore()
           
 ValueFactory getValueFactory()
          Gets a ValueFactory object that can be used to create URI-, blank node-, literal- and statement objects.
protected  ValueStore getValueStore()
           
protected  Lock getWriteLock()
           
 void initialize()
          Initializes this NativeStore.
protected  boolean isInitialized()
          Checks whether the Sail has been initialized.
 boolean isWritable()
          Checks whether this Sail object is writable, i.e.
 void setForceSync(boolean forceSync)
          Specifiec whether updates should be synced to disk forcefully, must be called before initialization.
 void setTripleIndexes(String tripleIndexes)
          Sets the triple indexes for the native store, must be called before initialization.
protected  void shutDownInternal()
          Do store-specific operations to ensure proper shutdown of the store.
 
Methods inherited from class org.openrdf.sail.helpers.SailBase
addSailChangedListener, connectionClosed, getConnection, getDataDir, notifySailChanged, removeSailChangedListener, setDataDir, shutDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NativeStore

public NativeStore()
Creates a new NativeStore.


NativeStore

public NativeStore(File dataDir)

NativeStore

public NativeStore(File dataDir,
                   String tripleIndexes)
Method Detail

setTripleIndexes

public void setTripleIndexes(String tripleIndexes)
Sets the triple indexes for the native store, must be called before initialization.

Parameters:
tripleIndexes - An index strings, e.g. spoc,posc.

getTripleIndexes

public String getTripleIndexes()

setForceSync

public void setForceSync(boolean forceSync)
Specifiec whether updates should be synced to disk forcefully, must be called before initialization. Enabling this feature may prevent corruption in case of events like power loss, but can have a severe impact on write performance. By default, this feature is disabled.


getForceSync

public boolean getForceSync()

initialize

public void initialize()
                throws SailException
Initializes this NativeStore.

Throws:
SailException - If this RdfRepository could not be initialized using the parameters that have been set.

isInitialized

protected final boolean isInitialized()
Checks whether the Sail has been initialized.

Returns:
true if the Sail has been initialized, false otherwise.

shutDownInternal

protected void shutDownInternal()
                         throws SailException
Description copied from class: SailBase
Do store-specific operations to ensure proper shutdown of the store.

Specified by:
shutDownInternal in class SailBase
Throws:
SailException

isWritable

public boolean isWritable()
Description copied from interface: Sail
Checks whether this Sail object is writable, i.e. if the data contained in this Sail object can be changed.


getConnectionInternal

protected SailConnection getConnectionInternal()
                                        throws SailException
Description copied from class: SailBase
returns a store-specific SailConnection object.

Specified by:
getConnectionInternal in class SailBase
Returns:
a SailConnection
Throws:
SailException

getValueFactory

public ValueFactory getValueFactory()
Description copied from interface: Sail
Gets a ValueFactory object that can be used to create URI-, blank node-, literal- and statement objects.

Returns:
a ValueFactory object for this Sail object.

getTripleStore

protected org.openrdf.sail.nativerdf.TripleStore getTripleStore()

getValueStore

protected ValueStore getValueStore()

getNamespaceStore

protected org.openrdf.sail.nativerdf.NamespaceStore getNamespaceStore()

getReadLock

protected Lock getReadLock()
                    throws SailException
Throws:
SailException

getWriteLock

protected Lock getWriteLock()
                     throws SailException
Throws:
SailException

getTransactionLock

protected Lock getTransactionLock()
                           throws SailException
Throws:
SailException

getContextIDs

protected List<Integer> getContextIDs(Resource... contexts)
                               throws IOException
Throws:
IOException

createStatementIterator

protected CloseableIteration<? extends Statement,IOException> createStatementIterator(Resource subj,
                                                                                      URI pred,
                                                                                      Value obj,
                                                                                      boolean includeInferred,
                                                                                      boolean readTransaction,
                                                                                      Resource... contexts)
                                                                               throws IOException
Creates a statement iterator based on the supplied pattern.

Parameters:
subj - The subject of the pattern, or null to indicate a wildcard.
pred - The predicate of the pattern, or null to indicate a wildcard.
obj - The object of the pattern, or null to indicate a wildcard.
context - The context of the pattern, or null to indicate a wildcard
Returns:
A StatementIterator that can be used to iterate over the statements that match the specified pattern.
Throws:
IOException


Copyright © 2001-2007 Aduna. All Rights Reserved.