|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.common.rdb.layout.CompositeNodeLayout
public class CompositeNodeLayout
Provides cached access to RDF Nodes persisted in a relational database according to the 'node centric layout' schema. RDF Nodes are allocated IDs when they are stored allowing any database table to store a reference to a node using a BIGINT column and this class for converting Nodes to and from the IDs stored in the database.
| Constructor Summary | |
|---|---|
CompositeNodeLayout(SQLCache sqlCache,
Sequence sequences,
LiteralIndexer literalIndexer,
java.lang.String containerName,
int cacheSize,
int maxLength,
java.lang.String optimizationString,
boolean supportsTempTables,
java.lang.String sessionPrefix)
Construct a layout to store nodes in a database |
|
CompositeNodeLayout(SQLCache sqlCache,
Sequence sequences,
LiteralIndexer literalIndexer,
java.lang.String containerName,
int maxLength,
java.lang.String optimizationString,
boolean supportsTempTables,
java.lang.String sessionPrefix,
CacheProvider cacheProvider)
Construct a layout to store nodes in a database |
|
| Method Summary | |
|---|---|
org.openrdf.model.Value |
cache(java.lang.Long id,
java.lang.String value,
java.lang.Long modifierId)
Create Value object from provided ID and value and cache result |
void |
clearCache()
Clear all of the in memory node caches as well as the datatype and language caches |
void |
clearUncommittedCache()
Clear the in-memory uncommitted cache data |
void |
commitUncommittedCache()
Commit the in-memory uncommitted cache data |
java.lang.Long |
fetchId(org.openrdf.model.Value value)
Fetch the ID of the Value from the appropriate table |
org.openrdf.model.Value |
fetchValue(java.lang.Long id)
Fetch the stored Value for the provided ID |
ClosableIterator<NodeSQL.GetAllLiteralsResult> |
getAllLiterals()
Get an Iterator over all the Literal values stored in the database |
java.lang.String |
getBlankNodeTableName()
Get the Blank Node table name |
ValueLayoutCacheProxy |
getDatatypeLayout()
Get the DataType layout |
java.lang.Object |
getIfCached(java.lang.Long id)
Get the Object for this ID, if already cached |
java.lang.Long |
getIfCached(org.openrdf.model.Value value)
Get the ID for this Value, if already cached |
ValueLayoutCacheProxy |
getLanguageLayout()
Get the Language layout |
LiteralIndexer |
getLiteralIndexer()
Get the literalIndexer |
java.lang.String |
getLiteralTableName()
Get the Literal table name |
java.lang.String |
getLongLiteralTableName()
Get the Long Literal table name |
java.lang.String |
getLongURITableName()
Get the Long URI table name |
java.lang.String |
getLongXMLTableName()
Get the Long XML table name |
NodeConverter |
getNodeConverter()
Get the nodeConverter |
NodeLayoutCacheProxy<org.openrdf.model.Literal> |
getNodeLiteralLayout()
Get the nodeLiteralLayout |
NodeType |
getNodeType(org.openrdf.model.Value n)
Determine the NodeType for a given node |
NodeLayoutCacheProxy<org.openrdf.model.URI> |
getNodeURILayout()
Get the nodeURILayout |
java.lang.String |
getURITableName()
Get the URI table name |
java.lang.String |
getXMLTableName()
Get the XML table name |
boolean |
isCached(java.lang.Long id)
Return true if a Value with this ID is already cached |
boolean |
isCached(org.openrdf.model.Value value)
Return true if a ID for this Value is already cached |
boolean |
isLong(org.openrdf.model.Value n)
Determine whether or not a node's string representation is longer than the maximum length. |
java.lang.String[] |
listTables()
Get the array of table names where the nodes are stored |
java.util.Map<java.lang.Long,org.openrdf.model.Value> |
resolveStoredIds(java.util.Set<java.lang.Long> ids)
Resolve the Values of the set of provided IDs |
java.util.Map<org.openrdf.model.Value,java.lang.Long> |
resolveStoredNodes(java.util.Set<org.openrdf.model.Value> nodesToResolve,
boolean storeUnresolvedNodes)
Resolve the IDs of the set of provided Values,optionally storing Values if they are not already stored based. |
java.lang.Long |
store(org.openrdf.model.Value value)
Store value in appropriate table and return ID |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompositeNodeLayout(SQLCache sqlCache,
Sequence sequences,
LiteralIndexer literalIndexer,
java.lang.String containerName,
int maxLength,
java.lang.String optimizationString,
boolean supportsTempTables,
java.lang.String sessionPrefix,
CacheProvider cacheProvider)
sqlCache - The interface to the SQL prepared statement cachesequences - A sequence object that is used to get IDsliteralIndexer - Literal indexer for the underlying connectioncontainerName - The name of the logical container for the nodes. This container name is used to generate the table names for
each node type (i.e. Node_URI or Node_Literal, etc.)maxLength - The maximum length of a node's string representation before it is considered longoptimizationString - String prepended to queries to enable database specific optimizationssupportsTempTables - true if the database supports temporary tables, false otherwise.sessionPrefix - prefix for references to temporary tables within queriescacheProvider - set of id to value caches
public CompositeNodeLayout(SQLCache sqlCache,
Sequence sequences,
LiteralIndexer literalIndexer,
java.lang.String containerName,
int cacheSize,
int maxLength,
java.lang.String optimizationString,
boolean supportsTempTables,
java.lang.String sessionPrefix)
sqlCache - The interface to the SQL prepared statement cachesequences - A sequence object that is used to get IDsliteralIndexer - Literal indexer for the underlying connectioncontainerName - The name of the logical container for the nodes. This container name is used to generate the table names for
each node type (i.e. Node_URI or Node_Literal, etc.)cacheSize - Size of the id/value cachesmaxLength - The maximum length of a node's string representation before it is considered longoptimizationString - String prepended to queries to enable database specific optimizationssupportsTempTables - true if the database supports temporary tables, false otherwise.sessionPrefix - prefix for references to temporary tables within queries| Method Detail |
|---|
public NodeType getNodeType(org.openrdf.model.Value n)
n - The node to retrieve its specific type
public boolean isLong(org.openrdf.model.Value n)
n - The node to test
public java.lang.String[] listTables()
public ValueLayoutCacheProxy getDatatypeLayout()
public ValueLayoutCacheProxy getLanguageLayout()
public void clearCache()
public void clearUncommittedCache()
public void commitUncommittedCache()
public java.lang.Long store(org.openrdf.model.Value value)
value - value to store
public java.lang.Long fetchId(org.openrdf.model.Value value)
value - value to store
public org.openrdf.model.Value fetchValue(java.lang.Long id)
id - ID of value to retrieve
public java.util.Map<org.openrdf.model.Value,java.lang.Long> resolveStoredNodes(java.util.Set<org.openrdf.model.Value> nodesToResolve,
boolean storeUnresolvedNodes)
nodesToResolve - Set of Values to resolvestoreUnresolvedNodes - Store Values that are not already stored
public java.util.Map<java.lang.Long,org.openrdf.model.Value> resolveStoredIds(java.util.Set<java.lang.Long> ids)
ids - Set of IDs to resolve
public org.openrdf.model.Value cache(java.lang.Long id,
java.lang.String value,
java.lang.Long modifierId)
id - ID of nodevalue - String value of nodemodifierId - modifierId for literals
public java.lang.Object getIfCached(java.lang.Long id)
id - of Object to retrieve
public java.lang.Long getIfCached(org.openrdf.model.Value value)
value - node value to find cached ID
public boolean isCached(java.lang.Long id)
id - to check
public boolean isCached(org.openrdf.model.Value value)
value - node value to check
public NodeLayoutCacheProxy<org.openrdf.model.URI> getNodeURILayout()
public NodeConverter getNodeConverter()
public NodeLayoutCacheProxy<org.openrdf.model.Literal> getNodeLiteralLayout()
public ClosableIterator<NodeSQL.GetAllLiteralsResult> getAllLiterals()
public LiteralIndexer getLiteralIndexer()
public java.lang.String getURITableName()
public java.lang.String getLongURITableName()
public java.lang.String getLiteralTableName()
public java.lang.String getLongLiteralTableName()
public java.lang.String getXMLTableName()
public java.lang.String getLongXMLTableName()
public java.lang.String getBlankNodeTableName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||