public interface StorageStatement extends AutoCloseable
StoreReadLayer
. Most data about the entities of a graph
are accessed through this statement interface as opposed to through the StoreReadLayer
directly.
One of the main reasons is that the access methods returns objects, like cursors
which
are valuable to reuse over a reasonably large window to reduce garbage churn in general.
A StorageStatement
must be acquired
before use. After use the statement
should be closed
. After closed the statement can be acquired again.Modifier and Type | Method and Description |
---|---|
void |
acquire()
Acquires this statement so that it can be used, should later be
closed . |
org.neo4j.cursor.Cursor<NodeItem> |
acquireIteratorNodeCursor(org.neo4j.collection.primitive.PrimitiveLongIterator nodeIds)
|
org.neo4j.cursor.Cursor<RelationshipItem> |
acquireIteratorRelationshipCursor(org.neo4j.collection.primitive.PrimitiveLongIterator relationshipIds)
|
org.neo4j.cursor.Cursor<NodeItem> |
acquireSingleNodeCursor(long nodeId)
|
org.neo4j.cursor.Cursor<RelationshipItem> |
acquireSingleRelationshipCursor(long relationshipId)
|
void |
close()
Closes this statement and releases any allocated resources.
|
IndexReader |
getFreshIndexReader(org.neo4j.kernel.api.index.IndexDescriptor index)
Returns an
IndexReader for searching entity ids given property values. |
IndexReader |
getIndexReader(org.neo4j.kernel.api.index.IndexDescriptor index)
Returns an
IndexReader for searching entity ids given property values. |
LabelScanReader |
getLabelScanReader() |
org.neo4j.cursor.Cursor<NodeItem> |
nodesGetAllCursor()
|
org.neo4j.cursor.Cursor<RelationshipItem> |
relationshipsGetAllCursor()
|
void acquire()
closed
.
Since a StorageStatement
can be reused after closed
, this call should
do initialization/clearing of state whereas data structures can be kept between uses.void close()
acquired
and be used again.close
in interface AutoCloseable
org.neo4j.cursor.Cursor<NodeItem> acquireSingleNodeCursor(long nodeId)
Cursor
capable of serving
NodeItem
for selected nodes.
No node is selected when this method returns, a call to Cursor.next()
will have to be made
to place the cursor over the first item and then more calls to move the cursor through the selection.nodeId
- id of node to get cursor for.Cursor
over NodeItem
for the given nodeId
.org.neo4j.cursor.Cursor<NodeItem> acquireIteratorNodeCursor(org.neo4j.collection.primitive.PrimitiveLongIterator nodeIds)
Cursor
capable of serving
NodeItem
for selected nodes.
No node is selected when this method returns, a call to Cursor.next()
will have to be made
to place the cursor over the first item and then more calls to move the cursor through the selection.nodeIds
- ids of nodes to get cursor for.Cursor
over NodeItem
for the given node ids.org.neo4j.cursor.Cursor<RelationshipItem> acquireSingleRelationshipCursor(long relationshipId)
Cursor
capable of serving
RelationshipItem
for selected
relationships. No relationship is selected when this method returns, a call to Cursor.next()
will have to be made to place the cursor over the first item and then more calls to move the cursor
through the selection.relationshipId
- id of relationship to get cursor for.Cursor
over RelationshipItem
for the given relationshipId
.org.neo4j.cursor.Cursor<RelationshipItem> acquireIteratorRelationshipCursor(org.neo4j.collection.primitive.PrimitiveLongIterator relationshipIds)
Cursor
capable of serving
RelationshipItem
for selected
relationships. No relationship is selected when this method returns, a call to Cursor.next()
will have to be made to place the cursor over the first item and then more calls to move the cursor
through the selection.relationshipIds
- ids of relationships to get cursor for.Cursor
over RelationshipItem
for the given relationship ids.org.neo4j.cursor.Cursor<NodeItem> nodesGetAllCursor()
Cursor
capable of serving
NodeItem
for selected nodes.
No node is selected when this method returns, a call to Cursor.next()
will have to be made
to place the cursor over the first item and then more calls to move the cursor through the selection.Cursor
over all stored nodes.org.neo4j.cursor.Cursor<RelationshipItem> relationshipsGetAllCursor()
Cursor
capable of serving
RelationshipItem
for selected
relationships. No relationship is selected when this method returns, a call to Cursor.next()
will have to be made to place the cursor over the first item and then more calls to move the cursor
through the selection.Cursor
over all stored relationships.LabelScanReader getLabelScanReader()
LabelScanReader
capable of reading nodes for specific label ids.IndexReader getIndexReader(org.neo4j.kernel.api.index.IndexDescriptor index) throws org.neo4j.kernel.api.exceptions.index.IndexNotFoundKernelException
IndexReader
for searching entity ids given property values. One reader is allocated
and kept per index throughout the life of a statement, making the returned reader repeatable-read isolation.
NOTE:
Reader returned from this method should not be closed. All such readers will be closed during close()
of the current statement.
index
- IndexDescriptor
to get reader for.IndexReader
capable of searching entity ids given property values.org.neo4j.kernel.api.exceptions.index.IndexNotFoundKernelException
- if no such index exists.IndexReader getFreshIndexReader(org.neo4j.kernel.api.index.IndexDescriptor index) throws org.neo4j.kernel.api.exceptions.index.IndexNotFoundKernelException
IndexReader
for searching entity ids given property values. A new reader is allocated
every call to this method, which means that newly committed data since the last call to this method
will be visible in the returned reader.
NOTE: It is caller's responsibility to close the returned reader.
index
- IndexDescriptor
to get reader for.IndexReader
capable of searching entity ids given property values.org.neo4j.kernel.api.exceptions.index.IndexNotFoundKernelException
- if no such index exists.Copyright © 2002–2016 The Neo4j Graph Database Project. All rights reserved.