public class ValueStore
extends org.eclipse.rdf4j.model.impl.AbstractValueFactory
| Modifier and Type | Field and Description |
|---|---|
static int |
NAMESPACE_CACHE_SIZE
The default namespace cache size.
|
static int |
NAMESPACE_ID_CACHE_SIZE
The default namespace id cache size.
|
static int |
VALUE_CACHE_SIZE
The default value cache size.
|
static int |
VALUE_ID_CACHE_SIZE
The default value id cache size.
|
| Constructor and Description |
|---|
ValueStore(File dataDir) |
ValueStore(File dataDir,
boolean forceSync) |
ValueStore(File dataDir,
boolean forceSync,
int valueCacheSize,
int valueIDCacheSize,
int namespaceCacheSize,
int namespaceIDCacheSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkConsistency()
Checks that every value has exactly one ID.
|
void |
clear()
Removes all values from the ValueStore.
|
void |
close()
Closes the ValueStore, releasing any file references, etc.
|
NativeBNode |
createBNode(String nodeID) |
NativeIRI |
createIRI(String uri) |
NativeIRI |
createIRI(String namespace,
String localName) |
NativeLiteral |
createLiteral(String value) |
NativeLiteral |
createLiteral(String value,
org.eclipse.rdf4j.model.IRI datatype) |
NativeLiteral |
createLiteral(String value,
String language) |
int |
getID(org.eclipse.rdf4j.model.Value value)
Gets the ID for the specified value.
|
NativeBNode |
getNativeBNode(org.eclipse.rdf4j.model.BNode bnode)
Creates a NativeBNode that is equal to the supplied bnode.
|
NativeLiteral |
getNativeLiteral(org.eclipse.rdf4j.model.Literal l)
Creates an NativeLiteral that is equal to the supplied literal.
|
NativeResource |
getNativeResource(org.eclipse.rdf4j.model.Resource resource) |
NativeIRI |
getNativeURI(org.eclipse.rdf4j.model.IRI uri)
Creates a NativeURI that is equal to the supplied URI.
|
NativeValue |
getNativeValue(org.eclipse.rdf4j.model.Value value) |
org.eclipse.rdf4j.common.concurrent.locks.Lock |
getReadLock()
Gets a read lock on this value store that can be used to prevent values from being removed while the
lock is active.
|
ValueStoreRevision |
getRevision() |
NativeValue |
getValue(int id)
Gets the value for the specified ID.
|
static void |
main(String[] args) |
int |
storeValue(org.eclipse.rdf4j.model.Value value)
Stores the supplied value and returns the ID that has been assigned to it.
|
void |
sync()
Synchronizes any changes that are cached in memory to disk.
|
createBNode, createFPLiteral, createIntegerLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createNumericLiteral, createStatement, createStatement, initBNodeParamspublic static final int VALUE_CACHE_SIZE
public static final int VALUE_ID_CACHE_SIZE
public static final int NAMESPACE_CACHE_SIZE
public static final int NAMESPACE_ID_CACHE_SIZE
public ValueStore(File dataDir) throws IOException
IOExceptionpublic ValueStore(File dataDir, boolean forceSync) throws IOException
IOExceptionpublic ValueStore(File dataDir, boolean forceSync, int valueCacheSize, int valueIDCacheSize, int namespaceCacheSize, int namespaceIDCacheSize) throws IOException
IOExceptionpublic ValueStoreRevision getRevision()
public org.eclipse.rdf4j.common.concurrent.locks.Lock getReadLock()
throws InterruptedException
InterruptedExceptionpublic NativeValue getValue(int id) throws IOException
id - A value ID.IOException - If an I/O error occurred.public int getID(org.eclipse.rdf4j.model.Value value)
throws IOException
value - A value.NativeValue.UNKNOWN_ID if no such ID could be found.IOException - If an I/O error occurred.public int storeValue(org.eclipse.rdf4j.model.Value value)
throws IOException
value - The Value to store.IOException - If an I/O error occurred.public void clear()
throws IOException
IOException - If an I/O error occurred.public void sync()
throws IOException
IOException - If an I/O error occurred.public void close()
throws IOException
IOException - If an I/O error occurred.public void checkConsistency()
throws org.eclipse.rdf4j.sail.SailException,
IOException
IOExceptionorg.eclipse.rdf4j.sail.SailExceptionpublic NativeIRI createIRI(String uri)
createIRI in interface org.eclipse.rdf4j.model.ValueFactorycreateIRI in class org.eclipse.rdf4j.model.impl.AbstractValueFactorypublic NativeIRI createIRI(String namespace, String localName)
createIRI in interface org.eclipse.rdf4j.model.ValueFactorycreateIRI in class org.eclipse.rdf4j.model.impl.AbstractValueFactorypublic NativeBNode createBNode(String nodeID)
createBNode in interface org.eclipse.rdf4j.model.ValueFactorycreateBNode in class org.eclipse.rdf4j.model.impl.AbstractValueFactorypublic NativeLiteral createLiteral(String value)
createLiteral in interface org.eclipse.rdf4j.model.ValueFactorycreateLiteral in class org.eclipse.rdf4j.model.impl.AbstractValueFactorypublic NativeLiteral createLiteral(String value, String language)
createLiteral in interface org.eclipse.rdf4j.model.ValueFactorycreateLiteral in class org.eclipse.rdf4j.model.impl.AbstractValueFactorypublic NativeLiteral createLiteral(String value, org.eclipse.rdf4j.model.IRI datatype)
createLiteral in interface org.eclipse.rdf4j.model.ValueFactorycreateLiteral in class org.eclipse.rdf4j.model.impl.AbstractValueFactorypublic NativeValue getNativeValue(org.eclipse.rdf4j.model.Value value)
public NativeResource getNativeResource(org.eclipse.rdf4j.model.Resource resource)
public NativeIRI getNativeURI(org.eclipse.rdf4j.model.IRI uri)
public NativeBNode getNativeBNode(org.eclipse.rdf4j.model.BNode bnode)
public NativeLiteral getNativeLiteral(org.eclipse.rdf4j.model.Literal l)
Copyright © 2015-2018 Eclipse Foundation. All Rights Reserved.