public class NodeRangeDocumentLabelScanStorageStrategy extends Object implements LabelScanStorageStrategy
LabelScanStore implemented using Lucene. There's only one big index for all
labels
because the Lucene document structure handles that quite efficiently.
With 32bit bitmaps it would look as follows:
{ // document for nodes 0-31 range: 0 4: [0000 0001][0000 0001][0000 0001][0000 0001] -- Node#0, Node#8, Node16, and Node#24 have Label#4 7: [1000 0000][1000 0000][1000 0000][1000 0000] -- Node#7, Node#15, Node#23, and Node#31 have Label#7 9: [0000 0001][0000 0000][0000 0000][1000 0000] -- Node#7, and Node#24 have Label#9 } { // document for nodes 32-63 range: 1 3: [0000 0000][0001 0000][0000 0000][0000 0000] -- Node#52 has Label#3 }
i.e. each document represents a range of nodes, and in each document there is a field for each label that is present on any of the nodes in the range. The value of that field is a bitmap with a bit set for each node in the range that has that particular label.
| Constructor and Description |
|---|
NodeRangeDocumentLabelScanStorageStrategy(BitmapDocumentFormat format) |
| Modifier and Type | Method and Description |
|---|---|
org.neo4j.collection.primitive.PrimitiveLongIterator |
labelsForNode(org.apache.lucene.search.IndexSearcher searcher,
long nodeId) |
org.neo4j.kernel.api.labelscan.AllEntriesLabelScanReader |
newNodeLabelReader(LuceneAllDocumentsReader allDocumentsReader) |
org.neo4j.collection.primitive.PrimitiveLongIterator |
nodesWithAllLabels(org.apache.lucene.search.IndexSearcher searcher,
int[] labelIds) |
org.neo4j.collection.primitive.PrimitiveLongIterator |
nodesWithAnyOfLabels(org.apache.lucene.search.IndexSearcher searcher,
int[] labelIds) |
org.neo4j.collection.primitive.PrimitiveLongIterator |
nodesWithLabel(org.apache.lucene.search.IndexSearcher searcher,
int labelId) |
String |
toString() |
public NodeRangeDocumentLabelScanStorageStrategy(BitmapDocumentFormat format)
public org.neo4j.collection.primitive.PrimitiveLongIterator nodesWithLabel(org.apache.lucene.search.IndexSearcher searcher,
int labelId)
nodesWithLabel in interface LabelScanStorageStrategypublic org.neo4j.collection.primitive.PrimitiveLongIterator nodesWithAnyOfLabels(org.apache.lucene.search.IndexSearcher searcher,
int[] labelIds)
nodesWithAnyOfLabels in interface LabelScanStorageStrategypublic org.neo4j.collection.primitive.PrimitiveLongIterator nodesWithAllLabels(org.apache.lucene.search.IndexSearcher searcher,
int[] labelIds)
nodesWithAllLabels in interface LabelScanStorageStrategypublic org.neo4j.kernel.api.labelscan.AllEntriesLabelScanReader newNodeLabelReader(LuceneAllDocumentsReader allDocumentsReader)
newNodeLabelReader in interface LabelScanStorageStrategypublic org.neo4j.collection.primitive.PrimitiveLongIterator labelsForNode(org.apache.lucene.search.IndexSearcher searcher,
long nodeId)
labelsForNode in interface LabelScanStorageStrategyCopyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.