From 3a12757a71eda4c73ad571e92577f68b8f869c95 Mon Sep 17 00:00:00 2001 From: Tobias Lindaaker Date: Fri, 6 Oct 2017 10:36:42 +0200 Subject: [PATCH] Support for explicit indexes. More tests needed. In particular for relationship indexes. --- .../internal/kernel/api/CursorFactory.java | 4 +- ...exCursor.java => ExplicitIndexCursor.java} | 2 +- ...rsor.java => NodeExplicitIndexCursor.java} | 2 +- .../org/neo4j/internal/kernel/api/Read.java | 17 ++ ...a => RelationshipExplicitIndexCursor.java} | 2 +- .../kernel/api/RelationshipIndexCursor.java | 3 +- .../api/ExplicitIndexCursorTestBase.java | 146 ++++++++++++++++++ .../api/NodeLabelIndexCursorTestBase.java | 2 +- .../api/NodeValueIndexCursorTestBase.java | 11 +- .../kernel/impl/api/KernelTransactions.java | 5 + .../org/neo4j/kernel/impl/newapi/Cursors.java | 8 +- .../impl/newapi/ExplicitIndexProgressor.java | 53 +++++++ .../neo4j/kernel/impl/newapi/IndexCursor.java | 54 +++++++ .../impl/newapi/IndexCursorProgressor.java | 24 ++- .../org/neo4j/kernel/impl/newapi/Lazy.java | 65 ++++++++ ...rsor.java => NodeExplicitIndexCursor.java} | 42 +++-- .../impl/newapi/NodeLabelIndexCursor.java | 27 +--- .../impl/newapi/NodeValueIndexCursor.java | 27 +--- .../org/neo4j/kernel/impl/newapi/Read.java | 80 +++++++++- ...a => RelationshipExplicitIndexCursor.java} | 46 ++++-- .../org/neo4j/kernel/impl/newapi/Store.java | 41 ++++- .../neo4j/kernel/impl/newapi/TempKernel.java | 12 +- .../neo4j/kernel/impl/newapi/MockStore.java | 13 ++ community/lucene-index/pom.xml | 7 + .../impl/newapi/ExplicitIndexCursorTest.java | 31 ++++ .../store/prototype/neole/CursorFactory.java | 8 +- .../store/prototype/neole/GraphSetup.java | 8 +- 27 files changed, 623 insertions(+), 117 deletions(-) rename community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/{ManualIndexCursor.java => ExplicitIndexCursor.java} (96%) rename community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/{NodeManualIndexCursor.java => NodeExplicitIndexCursor.java} (91%) rename community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/{RelationshipManualIndexCursor.java => RelationshipExplicitIndexCursor.java} (89%) create mode 100644 community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/ExplicitIndexCursorTestBase.java create mode 100644 community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/ExplicitIndexProgressor.java create mode 100644 community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/IndexCursor.java create mode 100644 community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Lazy.java rename community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/{NodeManualIndexCursor.java => NodeExplicitIndexCursor.java} (60%) rename community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/{RelationshipManualIndexCursor.java => RelationshipExplicitIndexCursor.java} (66%) create mode 100644 community/lucene-index/src/test/java/org/neo4j/kernel/impl/newapi/ExplicitIndexCursorTest.java diff --git a/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/CursorFactory.java b/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/CursorFactory.java index c66e7cf4828bc..b579623f105a9 100644 --- a/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/CursorFactory.java +++ b/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/CursorFactory.java @@ -45,7 +45,7 @@ public interface CursorFactory // manual indexes - NodeManualIndexCursor allocateNodeManualIndexCursor(); + NodeExplicitIndexCursor allocateNodeManualIndexCursor(); - RelationshipManualIndexCursor allocateRelationshipManualIndexCursor(); + RelationshipExplicitIndexCursor allocateRelationshipManualIndexCursor(); } diff --git a/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/ManualIndexCursor.java b/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/ExplicitIndexCursor.java similarity index 96% rename from community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/ManualIndexCursor.java rename to community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/ExplicitIndexCursor.java index 27c1dacaeeb5b..ba622e827d19f 100644 --- a/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/ManualIndexCursor.java +++ b/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/ExplicitIndexCursor.java @@ -19,7 +19,7 @@ */ package org.neo4j.internal.kernel.api; -interface ManualIndexCursor +interface ExplicitIndexCursor { int totalExpectedCursorSize(); diff --git a/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/NodeManualIndexCursor.java b/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/NodeExplicitIndexCursor.java similarity index 91% rename from community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/NodeManualIndexCursor.java rename to community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/NodeExplicitIndexCursor.java index fa1f4d209c736..4fe68ef930ee0 100644 --- a/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/NodeManualIndexCursor.java +++ b/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/NodeExplicitIndexCursor.java @@ -22,6 +22,6 @@ /** * Cursor for accessing manual index nodes. */ -public interface NodeManualIndexCursor extends NodeIndexCursor, ManualIndexCursor +public interface NodeExplicitIndexCursor extends NodeIndexCursor, ExplicitIndexCursor { } diff --git a/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/Read.java b/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/Read.java index 6f5a95e82ff80..732adcfdffb59 100644 --- a/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/Read.java +++ b/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/Read.java @@ -19,6 +19,8 @@ */ package org.neo4j.internal.kernel.api; +import org.neo4j.values.storable.Value; + /** * Defines the read operations of the Kernel API. */ @@ -122,4 +124,19 @@ public interface Read int nodeLabel( String name ); int propertyKey( String name ); + + void nodeExplicitIndexLookup( NodeExplicitIndexCursor cursor, String index, String key, Value value ); + + void nodeExplicitIndexQuery( NodeExplicitIndexCursor cursor, String index, Object query ); + + void nodeExplicitIndexQuery( NodeExplicitIndexCursor cursor, String index, String key, Object query ); + + void relationshipExplicitIndexGet( + RelationshipExplicitIndexCursor cursor, String index, String key, Value value, long source, long target ); + + void relationshipExplicitIndexQuery( + RelationshipExplicitIndexCursor cursor, String index, Object query, long source, long target ); + + void relationshipExplicitIndexQuery( + RelationshipExplicitIndexCursor cursor, String index, String key, Object query, long source, long target ); } diff --git a/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/RelationshipManualIndexCursor.java b/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/RelationshipExplicitIndexCursor.java similarity index 89% rename from community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/RelationshipManualIndexCursor.java rename to community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/RelationshipExplicitIndexCursor.java index ad415fdaa0e6f..1b35b263e7cd7 100644 --- a/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/RelationshipManualIndexCursor.java +++ b/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/RelationshipExplicitIndexCursor.java @@ -22,6 +22,6 @@ /** * Cursor for accessing manual index relationships. */ -public interface RelationshipManualIndexCursor extends RelationshipIndexCursor, ManualIndexCursor +public interface RelationshipExplicitIndexCursor extends RelationshipIndexCursor, ExplicitIndexCursor { } diff --git a/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/RelationshipIndexCursor.java b/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/RelationshipIndexCursor.java index b83d127541bda..295afdacf239b 100644 --- a/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/RelationshipIndexCursor.java +++ b/community/kernel-api/src/main/java/org/neo4j/internal/kernel/api/RelationshipIndexCursor.java @@ -36,6 +36,5 @@ public interface RelationshipIndexCursor extends Cursor long targetNodeReference(); -// long relationshipReference(); // not sure relationships will have independent references, so exposing this might -// be leakage. + long relationshipReference(); // will relationships have independent references? exposing it is leakage! } diff --git a/community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/ExplicitIndexCursorTestBase.java b/community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/ExplicitIndexCursorTestBase.java new file mode 100644 index 0000000000000..7596e7cb071df --- /dev/null +++ b/community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/ExplicitIndexCursorTestBase.java @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2002-2017 "Neo Technology," + * Network Engine for Objects in Lund AB [http://neotechnology.com] + * + * This file is part of Neo4j. + * + * Neo4j is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.neo4j.internal.kernel.api; + +import org.junit.Test; + +import org.neo4j.collection.primitive.Primitive; +import org.neo4j.collection.primitive.PrimitiveLongSet; +import org.neo4j.graphdb.GraphDatabaseService; +import org.neo4j.graphdb.Relationship; +import org.neo4j.graphdb.Transaction; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.neo4j.graphdb.RelationshipType.withName; +import static org.neo4j.values.storable.Values.stringValue; + +public abstract class ExplicitIndexCursorTestBase + extends KernelAPIReadTestBase +{ + @Override + void createTestGraph( GraphDatabaseService graphDb ) + { + try ( Transaction tx = graphDb.beginTx() ) + { + graphDb.index().forNodes( "foo" ).add( graphDb.createNode(), "bar", "this is it" ); + Relationship edge = graphDb.createNode().createRelationshipTo( graphDb.createNode(), withName( "LALA" ) ); + graphDb.index().forRelationships( "rels" ).add( edge, "alpha", "betting on the wrong string" ); + + tx.success(); + } + } + + @Test + public void shouldFindNodeByLookup() throws Exception + { + // given + try ( NodeExplicitIndexCursor cursor = cursors.allocateNodeManualIndexCursor(); + PrimitiveLongSet nodes = Primitive.longSet() ) + { + // when + read.nodeExplicitIndexLookup( cursor, "foo", "bar", stringValue( "this is it" ) ); + + // then + assertFoundNodes( cursor, 1, nodes ); + + // when + read.nodeExplicitIndexLookup( cursor, "foo", "bar", stringValue( "not that" ) ); + + // then + assertFoundNodes( cursor, 0, nodes ); + } + } + + @Test + public void shouldFindNodeByQuery() throws Exception + { + // given + try ( NodeExplicitIndexCursor cursor = cursors.allocateNodeManualIndexCursor(); + PrimitiveLongSet nodes = Primitive.longSet() ) + { + // when + read.nodeExplicitIndexQuery( cursor, "foo", "bar:this*" ); + + // then + assertFoundNodes( cursor, 1, nodes ); + + // when + nodes.clear(); + read.nodeExplicitIndexQuery( cursor, "foo", "bar", "this*" ); + + // then + assertFoundNodes( cursor, 1, nodes ); + + // when + read.nodeExplicitIndexQuery( cursor, "foo", "bar:that*" ); + + // then + assertFoundNodes( cursor, 0, nodes ); + + // when + read.nodeExplicitIndexQuery( cursor, "foo", "bar", "that*" ); + + // then + assertFoundNodes( cursor, 0, nodes ); + } + } + + @Test + public void shouldFindRelationshipByLookup() throws Exception + { + // given + try ( RelationshipExplicitIndexCursor cursor = cursors.allocateRelationshipManualIndexCursor(); + PrimitiveLongSet edges = Primitive.longSet() ) + { + // when + read.relationshipExplicitIndexGet( + cursor, + "rels", + "alpha", + stringValue( "betting on the wrong string" ), + -1, + -1 ); + + // then + assertFoundRelationships( cursor, 1, edges ); + } + } + + static void assertFoundNodes( NodeIndexCursor node, int nodes, PrimitiveLongSet uniqueIds ) + { + for ( int i = 0; i < nodes; i++ ) + { + assertTrue( "at least " + nodes + " nodes", node.next() ); + assertTrue( uniqueIds.add( node.nodeReference() ) ); + } + assertFalse( "no more than " + nodes + " nodes", node.next() ); + } + + static void assertFoundRelationships( RelationshipIndexCursor edge, int edges, PrimitiveLongSet uniqueIds ) + { + for ( int i = 0; i < edges; i++ ) + { + assertTrue( "at least " + edges + " relationships", edge.next() ); + assertTrue( uniqueIds.add( edge.relationshipReference() ) ); + } + assertFalse( "no more than " + edges + " relationships", edge.next() ); + } +} diff --git a/community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/NodeLabelIndexCursorTestBase.java b/community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/NodeLabelIndexCursorTestBase.java index 21359ed162489..5cb46f115d736 100644 --- a/community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/NodeLabelIndexCursorTestBase.java +++ b/community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/NodeLabelIndexCursorTestBase.java @@ -27,7 +27,7 @@ import org.neo4j.graphdb.Transaction; import static org.neo4j.graphdb.Label.label; -import static org.neo4j.internal.kernel.api.NodeValueIndexCursorTestBase.assertFoundNodes; +import static org.neo4j.internal.kernel.api.ExplicitIndexCursorTestBase.assertFoundNodes; public abstract class NodeLabelIndexCursorTestBase extends KernelAPIReadTestBase diff --git a/community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/NodeValueIndexCursorTestBase.java b/community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/NodeValueIndexCursorTestBase.java index 10fa54dd471e7..d22916a43257e 100644 --- a/community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/NodeValueIndexCursorTestBase.java +++ b/community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/NodeValueIndexCursorTestBase.java @@ -31,6 +31,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.neo4j.graphdb.Label.label; +import static org.neo4j.internal.kernel.api.ExplicitIndexCursorTestBase.assertFoundNodes; public abstract class NodeValueIndexCursorTestBase extends KernelAPIReadTestBase @@ -271,14 +272,4 @@ public void shouldPerformIndexScan() throws Exception assertFoundNodes( node, 15, uniqueIds ); } } - - static void assertFoundNodes( NodeIndexCursor node, int nodes, PrimitiveLongSet uniqueIds ) - { - for ( int i = 0; i < nodes; i++ ) - { - assertTrue( "at least " + nodes + " nodes", node.next() ); - assertTrue( uniqueIds.add( node.nodeReference() ) ); - } - assertFalse( "no more than " + nodes + " nodes", node.next() ); - } } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/KernelTransactions.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/KernelTransactions.java index 3ac221ed929c8..866ae1844410e 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/KernelTransactions.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/KernelTransactions.java @@ -148,6 +148,11 @@ public KernelTransactions( StatementLocksFactory statementLocksFactory, blockNewTransactions(); } + public Supplier explicitIndexTxStateSupplier() + { + return explicitIndexTxStateSupplier; + } + public KernelTransaction newInstance( KernelTransaction.Type type, SecurityContext securityContext, long timeout ) { assertCurrentThreadIsNotBlockingNewTransactions(); diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Cursors.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Cursors.java index f6869a11cd124..5cf5b370a75b4 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Cursors.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Cursors.java @@ -71,14 +71,14 @@ public NodeLabelIndexCursor allocateNodeLabelIndexCursor() } @Override - public NodeManualIndexCursor allocateNodeManualIndexCursor() + public NodeExplicitIndexCursor allocateNodeManualIndexCursor() { - return new NodeManualIndexCursor( read ); + return new NodeExplicitIndexCursor( read ); } @Override - public RelationshipManualIndexCursor allocateRelationshipManualIndexCursor() + public RelationshipExplicitIndexCursor allocateRelationshipManualIndexCursor() { - return new RelationshipManualIndexCursor( read ); + return new RelationshipExplicitIndexCursor( read ); } } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/ExplicitIndexProgressor.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/ExplicitIndexProgressor.java new file mode 100644 index 0000000000000..c2f400fa2b41c --- /dev/null +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/ExplicitIndexProgressor.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2002-2017 "Neo Technology," + * Network Engine for Objects in Lund AB [http://neotechnology.com] + * + * This file is part of Neo4j. + * + * Neo4j is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.neo4j.kernel.impl.newapi; + +import org.neo4j.kernel.api.ExplicitIndexHits; + +class ExplicitIndexProgressor implements IndexCursorProgressor +{ + private final ExplicitCursor cursor; + private final ExplicitIndexHits hits; + + ExplicitIndexProgressor( ExplicitCursor cursor, ExplicitIndexHits hits ) + { + this.cursor = cursor; + this.hits = hits; + } + + @Override + public boolean next() + { + while ( hits.hasNext() ) + { + if ( cursor.entity( hits.next(), hits.currentScore() ) ) + { + return true; + } + } + return false; + } + + @Override + public void close() + { + hits.close(); + } +} diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/IndexCursor.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/IndexCursor.java new file mode 100644 index 0000000000000..db623fa931a25 --- /dev/null +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/IndexCursor.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2002-2017 "Neo Technology," + * Network Engine for Objects in Lund AB [http://neotechnology.com] + * + * This file is part of Neo4j. + * + * Neo4j is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.neo4j.kernel.impl.newapi; + +abstract class IndexCursor +{ + private IndexCursorProgressor progressor; + + final void initialize( IndexCursorProgressor progressor ) + { + this.progressor = progressor; + } + + public final void done() + { + close(); + } + + public final boolean next() + { + return progressor != null && progressor.next(); + } + + public final boolean shouldRetry() + { + return false; + } + + void close() + { + if ( progressor != null ) + { + progressor.close(); + } + progressor = null; + } +} diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/IndexCursorProgressor.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/IndexCursorProgressor.java index 0008cc8a009c4..91ab00098a964 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/IndexCursorProgressor.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/IndexCursorProgressor.java @@ -32,17 +32,35 @@ interface NodeValueCursor { void initialize( IndexCursorProgressor progressor, int[] keys ); - void done(); - boolean node( long reference, Value[] values ); + + void done(); } interface NodeLabelCursor { void initialize( IndexCursorProgressor progressor, boolean providesLabels ); + boolean node( long reference, LabelSet labels ); + void done(); + } - boolean node( long reference, LabelSet labels ); + interface ExplicitCursor + { + void initialize( IndexCursorProgressor progressor, int expectedSize ); + + boolean entity( long reference, float score ); + + void done(); } +// +// interface RelationshipManualCursor +// { +// void initialize( IndexCursorProgressor progressor, int expectedSize ); +// +// boolean node( long reference, float score, long source, int type, long target ); +// +// void done(); +// } } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Lazy.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Lazy.java new file mode 100644 index 0000000000000..0ccaa7375d9f7 --- /dev/null +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Lazy.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2002-2017 "Neo Technology," + * Network Engine for Objects in Lund AB [http://neotechnology.com] + * + * This file is part of Neo4j. + * + * Neo4j is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.neo4j.kernel.impl.newapi; + +import java.util.function.Supplier; + +import static java.util.Objects.requireNonNull; + +/** + * Encapsulates a double checked locking pattern for lazy initialization. + * TODO: move this to some util place or something. + */ +public final class Lazy +{ + private T cache; + private volatile Object state; + + public Lazy( Supplier supplier ) + { + this.state = requireNonNull( supplier, "supplier" ); + } + + public T get() + { + T value = cache; + if ( value == null ) + { + Object s = state; + if ( s instanceof Supplier ) + { + synchronized ( this ) + { + s = state; + if ( s instanceof Supplier ) + { + @SuppressWarnings( "unchecked" ) + Supplier supplier = (Supplier) s; + s = supplier.get(); + } + } + } + @SuppressWarnings( "unchecked" ) + T val = (T) s; + cache = value = val; + } + return value; + } +} diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/NodeManualIndexCursor.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/NodeExplicitIndexCursor.java similarity index 60% rename from community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/NodeManualIndexCursor.java rename to community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/NodeExplicitIndexCursor.java index 03cc211bd3a53..b59869501a671 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/NodeManualIndexCursor.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/NodeExplicitIndexCursor.java @@ -21,54 +21,66 @@ import org.neo4j.internal.kernel.api.NodeCursor; -class NodeManualIndexCursor implements org.neo4j.internal.kernel.api.NodeManualIndexCursor +import static org.neo4j.kernel.impl.store.record.AbstractBaseRecord.NO_ID; + +class NodeExplicitIndexCursor extends IndexCursor + implements org.neo4j.internal.kernel.api.NodeExplicitIndexCursor, IndexCursorProgressor.ExplicitCursor { private final Read read; + private int expectedSize; + private long node; + private float score; - NodeManualIndexCursor( Read read ) + NodeExplicitIndexCursor( Read read ) { this.read = read; } @Override - public int totalExpectedCursorSize() + public void initialize( IndexCursorProgressor progressor, int expectedSize ) { - throw new UnsupportedOperationException( "not implemented" ); + super.initialize( progressor ); + this.expectedSize = expectedSize; } @Override - public float score() + public boolean entity( long reference, float score ) { - throw new UnsupportedOperationException( "not implemented" ); + this.node = reference; + this.score = score; + return true; } @Override - public void node( NodeCursor cursor ) + public int totalExpectedCursorSize() { - throw new UnsupportedOperationException( "not implemented" ); + return expectedSize; } @Override - public long nodeReference() + public float score() { - throw new UnsupportedOperationException( "not implemented" ); + return score; } @Override - public boolean next() + public void node( NodeCursor cursor ) { - throw new UnsupportedOperationException( "not implemented" ); + read.singleNode( node, cursor ); } @Override - public boolean shouldRetry() + public long nodeReference() { - return false; + return node; } @Override public void close() { - throw new UnsupportedOperationException( "not implemented" ); + super.close(); + node = NO_ID; + score = 0; + expectedSize = 0; } } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/NodeLabelIndexCursor.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/NodeLabelIndexCursor.java index 72d0d4b485703..f73ebe4981c83 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/NodeLabelIndexCursor.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/NodeLabelIndexCursor.java @@ -24,13 +24,12 @@ import static org.neo4j.kernel.impl.store.record.AbstractBaseRecord.NO_ID; -class NodeLabelIndexCursor implements org.neo4j.internal.kernel.api.NodeLabelIndexCursor, - IndexCursorProgressor.NodeLabelCursor +class NodeLabelIndexCursor extends IndexCursor + implements org.neo4j.internal.kernel.api.NodeLabelIndexCursor, IndexCursorProgressor.NodeLabelCursor { private final Read read; private long node; private LabelSet labels; - private IndexCursorProgressor progressor; NodeLabelIndexCursor( Read read ) { @@ -40,7 +39,7 @@ class NodeLabelIndexCursor implements org.neo4j.internal.kernel.api.NodeLabelInd @Override public void initialize( IndexCursorProgressor progressor, boolean providesLabels ) { - this.progressor = progressor; + super.initialize( progressor ); } @Override @@ -51,12 +50,6 @@ public boolean node( long reference, LabelSet labels ) return true; } - @Override - public void done() - { - close(); - } - @Override public void node( NodeCursor cursor ) { @@ -75,22 +68,10 @@ public LabelSet labels() return labels; } - @Override - public boolean next() - { - return progressor != null && progressor.next(); - } - - @Override - public boolean shouldRetry() - { - return false; - } - @Override public void close() { - progressor.close(); + super.close(); node = NO_ID; labels = null; } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursor.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursor.java index 2507c72915f16..a8fb8c098edd9 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursor.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursor.java @@ -24,14 +24,13 @@ import static org.neo4j.kernel.impl.store.record.AbstractBaseRecord.NO_ID; -class NodeValueIndexCursor implements org.neo4j.internal.kernel.api.NodeValueIndexCursor, - IndexCursorProgressor.NodeValueCursor +class NodeValueIndexCursor extends IndexCursor + implements org.neo4j.internal.kernel.api.NodeValueIndexCursor, IndexCursorProgressor.NodeValueCursor { private final Read read; private long node; private int[] keys; private Value[] values; - private IndexCursorProgressor progressor; NodeValueIndexCursor( Read read ) { @@ -41,7 +40,7 @@ class NodeValueIndexCursor implements org.neo4j.internal.kernel.api.NodeValueInd @Override public void initialize( IndexCursorProgressor progressor, int[] keys ) { - this.progressor = progressor; + super.initialize( progressor ); this.keys = keys; } @@ -53,12 +52,6 @@ public boolean node( long reference, Value[] values ) return true; } - @Override - public void done() - { - close(); - } - @Override public void node( NodeCursor cursor ) { @@ -89,22 +82,10 @@ public Value propertyValue( int offset ) return values[offset]; } - @Override - public boolean next() - { - return progressor != null && progressor.next(); - } - - @Override - public boolean shouldRetry() - { - return false; - } - @Override public void close() { - this.progressor = null; + super.close(); this.node = NO_ID; this.keys = null; this.values = null; diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Read.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Read.java index 1ad13cd343827..c57bb96e8fd63 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Read.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Read.java @@ -21,10 +21,13 @@ import java.util.Arrays; -import org.neo4j.collection.primitive.PrimitiveLongIterator; import org.neo4j.internal.kernel.api.IndexQuery; +import org.neo4j.internal.kernel.api.NodeExplicitIndexCursor; +import org.neo4j.internal.kernel.api.RelationshipExplicitIndexCursor; import org.neo4j.internal.kernel.api.Scan; import org.neo4j.io.pagecache.PageCursor; +import org.neo4j.kernel.api.ExplicitIndex; +import org.neo4j.kernel.api.ExplicitIndexHits; import org.neo4j.kernel.impl.store.RecordCursor; import org.neo4j.kernel.impl.store.record.AbstractBaseRecord; import org.neo4j.kernel.impl.store.record.DynamicRecord; @@ -238,6 +241,77 @@ public final void relationshipProperties( long reference, org.neo4j.internal.ker ((PropertyCursor) cursor).init( reference ); } + @Override + public final void nodeExplicitIndexLookup( + NodeExplicitIndexCursor cursor, String index, String key, Value value ) + { + explicitIndex( (org.neo4j.kernel.impl.newapi.NodeExplicitIndexCursor) cursor, explicitNodeIndex( index ).get( key, value.asObject() ) ); + } + + @Override + public final void nodeExplicitIndexQuery( + NodeExplicitIndexCursor cursor, String index, Object query ) + { + explicitIndex( (org.neo4j.kernel.impl.newapi.NodeExplicitIndexCursor) cursor, explicitNodeIndex( index ).query( + query instanceof Value ? ((Value) query).asObject() : query ) ); + } + + @Override + public final void nodeExplicitIndexQuery( + NodeExplicitIndexCursor cursor, String index, String key, Object query ) + { + explicitIndex( (org.neo4j.kernel.impl.newapi.NodeExplicitIndexCursor) cursor, explicitNodeIndex( index ).query( + key, query instanceof Value ? ((Value) query).asObject() : query ) ); + } + + @Override + public void relationshipExplicitIndexGet( + RelationshipExplicitIndexCursor cursor, + String index, + String key, + Value value, + long source, + long target ) + { + explicitIndex( + (org.neo4j.kernel.impl.newapi.RelationshipExplicitIndexCursor) cursor, + explicitRelationshipIndex( index ).get( key, value.asObject(), source, target ) ); + } + + @Override + public void relationshipExplicitIndexQuery( + RelationshipExplicitIndexCursor cursor, + String index, + Object query, + long source, + long target ) + { + explicitIndex( + (org.neo4j.kernel.impl.newapi.RelationshipExplicitIndexCursor) cursor, + explicitRelationshipIndex( index ) + .query( query instanceof Value ? ((Value) query).asObject() : query, source, target ) ); + } + + @Override + public void relationshipExplicitIndexQuery( + RelationshipExplicitIndexCursor cursor, + String index, + String key, + Object query, + long source, + long target ) + { + explicitIndex( + (org.neo4j.kernel.impl.newapi.RelationshipExplicitIndexCursor) cursor, + explicitRelationshipIndex( index ).query( + key, query instanceof Value ? ((Value) query).asObject() : query, source, target ) ); + } + + private static void explicitIndex( IndexCursorProgressor.ExplicitCursor cursor, ExplicitIndexHits hits ) + { + cursor.initialize( new ExplicitIndexProgressor( cursor, hits ), hits.size() ); + } + @Override public final void futureNodeReferenceRead( long reference ) { @@ -262,6 +336,10 @@ public final void futureRelationshipPropertyReferenceRead( long reference ) abstract LabelScanReader labelScanReader(); + abstract ExplicitIndex explicitNodeIndex( String indexName ); + + abstract ExplicitIndex explicitRelationshipIndex( String indexName ); + @Override public abstract IndexReference index( int label, int... properties ); diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/RelationshipManualIndexCursor.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/RelationshipExplicitIndexCursor.java similarity index 66% rename from community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/RelationshipManualIndexCursor.java rename to community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/RelationshipExplicitIndexCursor.java index e70d28fb047c5..7e61bf79a3bc1 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/RelationshipManualIndexCursor.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/RelationshipExplicitIndexCursor.java @@ -22,31 +22,52 @@ import org.neo4j.internal.kernel.api.NodeCursor; import org.neo4j.internal.kernel.api.RelationshipScanCursor; -class RelationshipManualIndexCursor implements org.neo4j.internal.kernel.api.RelationshipManualIndexCursor +import static org.neo4j.kernel.impl.store.record.AbstractBaseRecord.NO_ID; + +class RelationshipExplicitIndexCursor extends IndexCursor + implements org.neo4j.internal.kernel.api.RelationshipExplicitIndexCursor, IndexCursorProgressor.ExplicitCursor { private final Read read; + private int expectedSize; + private long relationship; + private float score; - RelationshipManualIndexCursor( Read read ) + RelationshipExplicitIndexCursor( Read read ) { this.read = read; } + @Override + public void initialize( IndexCursorProgressor progressor, int expectedSize ) + { + super.initialize( progressor ); + this.expectedSize = expectedSize; + } + + @Override + public boolean entity( long reference, float score ) + { + this.relationship = reference; + this.score = score; + return true; + } + @Override public int totalExpectedCursorSize() { - throw new UnsupportedOperationException( "not implemented" ); + return expectedSize; } @Override public float score() { - throw new UnsupportedOperationException( "not implemented" ); + return score; } @Override public void relationship( RelationshipScanCursor cursor ) { - throw new UnsupportedOperationException( "not implemented" ); + read.singleRelationship( relationship, cursor ); } @Override @@ -80,20 +101,17 @@ public long targetNodeReference() } @Override - public boolean next() + public long relationshipReference() { - throw new UnsupportedOperationException( "not implemented" ); - } - - @Override - public boolean shouldRetry() - { - return false; + return relationship; } @Override public void close() { - throw new UnsupportedOperationException( "not implemented" ); + super.close(); + relationship = NO_ID; + score = 0; + expectedSize = 0; } } diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Store.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Store.java index 52fff34c59a2b..8cb6fd4c6bdef 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Store.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/Store.java @@ -21,13 +21,16 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; +import java.util.function.Supplier; -import org.neo4j.collection.primitive.PrimitiveLongIterator; import org.neo4j.io.pagecache.PageCursor; +import org.neo4j.kernel.api.ExplicitIndex; +import org.neo4j.kernel.api.exceptions.explicitindex.ExplicitIndexNotFoundKernelException; import org.neo4j.kernel.api.exceptions.index.IndexNotFoundKernelException; import org.neo4j.kernel.api.schema.LabelSchemaDescriptor; import org.neo4j.kernel.api.schema.index.IndexDescriptor; import org.neo4j.kernel.api.schema.index.IndexDescriptorFactory; +import org.neo4j.kernel.api.txstate.ExplicitIndexTransactionState; import org.neo4j.kernel.impl.api.store.PropertyUtil; import org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine; import org.neo4j.kernel.impl.store.AbstractDynamicStore; @@ -61,12 +64,13 @@ class Store extends Read { private final RelationshipGroupStore groupStore; private final PropertyStore propertyStore; - private NodeStore nodeStore; - private RelationshipStore relationshipStore; + private final NodeStore nodeStore; + private final RelationshipStore relationshipStore; private final StorageStatement statement; private final StoreReadLayer read; + private final Lazy explicitIndexes; - public Store( RecordStorageEngine engine ) + public Store( RecordStorageEngine engine, Supplier explicitIndexes ) { read = engine.storeReadLayer(); statement = read.newStatement(); @@ -75,6 +79,7 @@ public Store( RecordStorageEngine engine ) this.relationshipStore = stores.getRelationshipStore(); this.groupStore = stores.getRelationshipGroupStore(); this.propertyStore = stores.getPropertyStore(); + this.explicitIndexes = new Lazy<>( explicitIndexes ); } @Override @@ -98,6 +103,34 @@ LabelScanReader labelScanReader() return statement.getLabelScanReader(); } + @Override + ExplicitIndex explicitNodeIndex( String indexName ) + { + try + { + return explicitIndexes.get().nodeChanges( indexName ); + } + catch ( ExplicitIndexNotFoundKernelException e ) + { + // TODO: exception handling + throw new RuntimeException( "SOMEONE HAS NOT IMPLEMENTED PROPER EXCEPTION HANDLING!", e ); + } + } + + @Override + ExplicitIndex explicitRelationshipIndex( String indexName ) + { + try + { + return explicitIndexes.get().relationshipChanges( indexName ); + } + catch ( ExplicitIndexNotFoundKernelException e ) + { + // TODO: exception handling + throw new RuntimeException( "SOMEONE HAS NOT IMPLEMENTED PROPER EXCEPTION HANDLING!", e ); + } + } + @Override public IndexReference index( int label, int... properties ) { diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/TempKernel.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/TempKernel.java index 125ed57260878..6b7d93a25d470 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/TempKernel.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/newapi/TempKernel.java @@ -19,9 +19,11 @@ */ package org.neo4j.kernel.impl.newapi; +import org.neo4j.graphdb.DependencyResolver; import org.neo4j.internal.kernel.api.CursorFactory; import org.neo4j.internal.kernel.api.KernelAPI; import org.neo4j.internal.kernel.api.Token; +import org.neo4j.kernel.impl.api.KernelTransactions; import org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine; import org.neo4j.kernel.impl.store.NeoStores; import org.neo4j.kernel.internal.GraphDatabaseAPI; @@ -34,8 +36,10 @@ class TempKernel implements KernelAPI TempKernel( GraphDatabaseAPI db ) { - RecordStorageEngine engine = db.getDependencyResolver().resolveDependency( RecordStorageEngine.class ); - this.tx = new Transaction( engine ); + DependencyResolver resolver = db.getDependencyResolver(); + RecordStorageEngine engine = resolver.resolveDependency( RecordStorageEngine.class ); + KernelTransactions ktx = resolver.resolveDependency( KernelTransactions.class ); + this.tx = new Transaction( engine, ktx ); this.cursors = new Cursors( tx ); } @@ -59,9 +63,9 @@ public Token token() private static class Transaction extends Store implements org.neo4j.internal.kernel.api.Transaction { - Transaction( RecordStorageEngine engine ) + Transaction( RecordStorageEngine engine, KernelTransactions ktx ) { - super( engine ); + super( engine, ktx.explicitIndexTxStateSupplier() ); } @Override diff --git a/community/kernel/src/test/java/org/neo4j/kernel/impl/newapi/MockStore.java b/community/kernel/src/test/java/org/neo4j/kernel/impl/newapi/MockStore.java index c9f9cb76185f8..91ac614920646 100644 --- a/community/kernel/src/test/java/org/neo4j/kernel/impl/newapi/MockStore.java +++ b/community/kernel/src/test/java/org/neo4j/kernel/impl/newapi/MockStore.java @@ -26,6 +26,7 @@ import org.neo4j.collection.primitive.Primitive; import org.neo4j.collection.primitive.PrimitiveLongObjectMap; import org.neo4j.io.pagecache.PageCursor; +import org.neo4j.kernel.api.ExplicitIndex; import org.neo4j.kernel.impl.store.DynamicRecordAllocator; import org.neo4j.kernel.impl.store.PropertyStore; import org.neo4j.kernel.impl.store.RecordCursor; @@ -72,6 +73,18 @@ LabelScanReader labelScanReader() throw new UnsupportedOperationException( "not implemented" ); } + @Override + ExplicitIndex explicitNodeIndex( String indexName ) + { + throw new UnsupportedOperationException( "not implemented" ); + } + + @Override + ExplicitIndex explicitRelationshipIndex( String indexName ) + { + throw new UnsupportedOperationException( "not implemented" ); + } + @Override PageCursor nodePage( long reference ) { diff --git a/community/lucene-index/pom.xml b/community/lucene-index/pom.xml index f41fa73b70cd3..08c729b862ed7 100644 --- a/community/lucene-index/pom.xml +++ b/community/lucene-index/pom.xml @@ -70,6 +70,13 @@ the relevant Commercial Agreement. test-jar test + + org.neo4j + neo4j-kernel-api + ${project.version} + test-jar + test + org.neo4j neo4j-logging diff --git a/community/lucene-index/src/test/java/org/neo4j/kernel/impl/newapi/ExplicitIndexCursorTest.java b/community/lucene-index/src/test/java/org/neo4j/kernel/impl/newapi/ExplicitIndexCursorTest.java new file mode 100644 index 0000000000000..a78cc8d5c3459 --- /dev/null +++ b/community/lucene-index/src/test/java/org/neo4j/kernel/impl/newapi/ExplicitIndexCursorTest.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2002-2017 "Neo Technology," + * Network Engine for Objects in Lund AB [http://neotechnology.com] + * + * This file is part of Neo4j. + * + * Neo4j is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.neo4j.kernel.impl.newapi; + +import org.neo4j.internal.kernel.api.ExplicitIndexCursorTestBase; + +public class ExplicitIndexCursorTest extends ExplicitIndexCursorTestBase +{ + @Override + public ReadTestSupport newTestSupport() + { + return new ReadTestSupport(); + } +} diff --git a/enterprise/runtime/neole/src/main/java/org/neo4j/internal/store/prototype/neole/CursorFactory.java b/enterprise/runtime/neole/src/main/java/org/neo4j/internal/store/prototype/neole/CursorFactory.java index 70f0d57058682..578c1f98633c8 100644 --- a/enterprise/runtime/neole/src/main/java/org/neo4j/internal/store/prototype/neole/CursorFactory.java +++ b/enterprise/runtime/neole/src/main/java/org/neo4j/internal/store/prototype/neole/CursorFactory.java @@ -20,9 +20,9 @@ package org.neo4j.internal.store.prototype.neole; import org.neo4j.internal.kernel.api.NodeLabelIndexCursor; -import org.neo4j.internal.kernel.api.NodeManualIndexCursor; +import org.neo4j.internal.kernel.api.NodeExplicitIndexCursor; import org.neo4j.internal.kernel.api.NodeValueIndexCursor; -import org.neo4j.internal.kernel.api.RelationshipManualIndexCursor; +import org.neo4j.internal.kernel.api.RelationshipExplicitIndexCursor; class CursorFactory implements org.neo4j.internal.kernel.api.CursorFactory { @@ -76,13 +76,13 @@ public NodeLabelIndexCursor allocateNodeLabelIndexCursor() } @Override - public NodeManualIndexCursor allocateNodeManualIndexCursor() + public NodeExplicitIndexCursor allocateNodeManualIndexCursor() { throw new UnsupportedOperationException( "not implemented" ); } @Override - public RelationshipManualIndexCursor allocateRelationshipManualIndexCursor() + public RelationshipExplicitIndexCursor allocateRelationshipManualIndexCursor() { throw new UnsupportedOperationException( "not implemented" ); } diff --git a/enterprise/runtime/neole/src/test/java/org/neo4j/internal/store/prototype/neole/GraphSetup.java b/enterprise/runtime/neole/src/test/java/org/neo4j/internal/store/prototype/neole/GraphSetup.java index ef2dc59ea8699..e6b5dc0d65db4 100644 --- a/enterprise/runtime/neole/src/test/java/org/neo4j/internal/store/prototype/neole/GraphSetup.java +++ b/enterprise/runtime/neole/src/test/java/org/neo4j/internal/store/prototype/neole/GraphSetup.java @@ -34,12 +34,12 @@ import org.neo4j.internal.kernel.api.IndexReference; import org.neo4j.internal.kernel.api.NodeCursor; import org.neo4j.internal.kernel.api.NodeLabelIndexCursor; -import org.neo4j.internal.kernel.api.NodeManualIndexCursor; +import org.neo4j.internal.kernel.api.NodeExplicitIndexCursor; import org.neo4j.internal.kernel.api.NodeValueIndexCursor; import org.neo4j.internal.kernel.api.PropertyCursor; import org.neo4j.internal.kernel.api.Read; import org.neo4j.internal.kernel.api.RelationshipGroupCursor; -import org.neo4j.internal.kernel.api.RelationshipManualIndexCursor; +import org.neo4j.internal.kernel.api.RelationshipExplicitIndexCursor; import org.neo4j.internal.kernel.api.RelationshipScanCursor; import org.neo4j.internal.kernel.api.RelationshipTraversalCursor; import org.neo4j.internal.kernel.api.Scan; @@ -296,13 +296,13 @@ public NodeLabelIndexCursor allocateNodeLabelIndexCursor() } @Override - public NodeManualIndexCursor allocateNodeManualIndexCursor() + public NodeExplicitIndexCursor allocateNodeManualIndexCursor() { return cursors.allocateNodeManualIndexCursor(); } @Override - public RelationshipManualIndexCursor allocateRelationshipManualIndexCursor() + public RelationshipExplicitIndexCursor allocateRelationshipManualIndexCursor() { return cursors.allocateRelationshipManualIndexCursor(); }