diff --git a/community/graphdb-api/src/main/java/org/neo4j/graphdb/GraphDatabaseService.java b/community/graphdb-api/src/main/java/org/neo4j/graphdb/GraphDatabaseService.java index 44a970edc13fc..3b19f62fa087b 100644 --- a/community/graphdb-api/src/main/java/org/neo4j/graphdb/GraphDatabaseService.java +++ b/community/graphdb-api/src/main/java/org/neo4j/graphdb/GraphDatabaseService.java @@ -176,12 +176,9 @@ public interface GraphDatabaseService /** * Returns all relationship types currently in the underlying store. * Relationship types are added to the underlying store the first time they - * are used in a successfully commited {@link Node#createRelationshipTo - * node.createRelationshipTo(...)}. Note that this method is guaranteed to - * return all known relationship types, but it does not guarantee that it - * won't return more than that (e.g. it can return "historic" - * relationship types that no longer have any relationships in the node - * space). + * are used in a successfully committed {@link Node#createRelationshipTo + * node.createRelationshipTo(...)}. This method guarantees that it will + * return all relationship types currently in use. * * @return all relationship types in the underlying store */ @@ -189,8 +186,7 @@ public interface GraphDatabaseService /** * Returns all labels currently in the underlying store. Labels are added to the store the first time - * they are used. This method guarantees that it will return all labels currently in use. However, - * it may also return more than that (e.g. it can return "historic" labels that are no longer used). + * they are used. This method guarantees that it will return all labels currently in use. * * Please take care that the returned {@link ResourceIterable} is closed correctly and as soon as possible * inside your transaction to avoid potential blocking of write operations. diff --git a/community/import-tool/src/test/java/org/neo4j/tooling/ImportToolTest.java b/community/import-tool/src/test/java/org/neo4j/tooling/ImportToolTest.java index e4b752cb6ddfe..0b4f1fa2c3ded 100644 --- a/community/import-tool/src/test/java/org/neo4j/tooling/ImportToolTest.java +++ b/community/import-tool/src/test/java/org/neo4j/tooling/ImportToolTest.java @@ -86,7 +86,6 @@ import static org.neo4j.helpers.collection.Iterators.count; import static org.neo4j.helpers.collection.MapUtil.store; import static org.neo4j.helpers.collection.MapUtil.stringMap; -import static org.neo4j.tooling.GlobalGraphOperations.at; import static org.neo4j.tooling.ImportTool.MULTI_FILE_DELIMITER; public class ImportToolTest @@ -193,7 +192,7 @@ public void import4097Labels() throws Exception // THEN try ( Transaction tx = dbRule.beginTx() ) { - long nodeCount = Iterables.count( at( dbRule ).getAllNodes() ); + long nodeCount = Iterables.count( dbRule.getAllNodes() ); assertEquals( 4097, nodeCount ); tx.success(); @@ -371,7 +370,7 @@ public void shouldIgnoreWhitespaceAroundBooleans() throws Exception } } - long nodeCount = Iterables.count( at( dbRule ).getAllNodes() ); + long nodeCount = Iterables.count( dbRule.getAllNodes() ); assertEquals( 10, nodeCount ); tx.success(); } @@ -1271,7 +1270,7 @@ public void shouldAcceptRawAsciiCharacterCodeAsQuoteConfiguration() throws Excep GraphDatabaseService db = dbRule.getGraphDatabaseAPI(); try ( Transaction tx = db.beginTx() ) { - for ( Node node : at( db ).getAllNodes() ) + for ( Node node : db.getAllNodes() ) { String name = (String) node.getProperty( "name" ); assertTrue( "Didn't expect node with name '" + name + "'", names.remove( name ) ); @@ -1370,7 +1369,7 @@ public void shouldAcceptRawEscapedAsciiCodeAsQuoteConfiguration() throws Excepti GraphDatabaseService db = dbRule.getGraphDatabaseAPI(); try ( Transaction tx = db.beginTx() ) { - for ( Node node : at( db ).getAllNodes() ) + for ( Node node : db.getAllNodes() ) { String name = (String) node.getProperty( "name" ); assertTrue( "Didn't expect node with name '" + name + "'", names.remove( name ) ); @@ -1428,7 +1427,7 @@ public void shouldBeEquivalentToUseRawAsciiOrCharacterAsQuoteConfiguration1() th GraphDatabaseService db = dbRule.getGraphDatabaseAPI(); try ( Transaction tx = db.beginTx() ) { - for ( Node node : at( db ).getAllNodes() ) + for ( Node node : db.getAllNodes() ) { String name = (String) node.getProperty( "name" ); assertTrue( "Didn't expect node with name '" + name + "'", names.remove( name ) ); @@ -1514,7 +1513,7 @@ public void shouldBeEquivalentToUseRawAsciiOrCharacterAsQuoteConfiguration2() th GraphDatabaseService db = dbRule.getGraphDatabaseAPI(); try ( Transaction tx = db.beginTx() ) { - for ( Node node : at( db ).getAllNodes() ) + for ( Node node : db.getAllNodes() ) { String name = (String) node.getProperty( "name" ); assertTrue( "Didn't expect node with name '" + name + "'", names.remove( name ) ); diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/factory/GraphDatabaseFacade.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/factory/GraphDatabaseFacade.java index 679aa5e53427f..ab475a9e32b34 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/factory/GraphDatabaseFacade.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/factory/GraphDatabaseFacade.java @@ -394,17 +394,41 @@ protected Relationship fetchNextOrNull() @Override public ResourceIterable getAllRelationshipTypes() { - return all( TokenAccess.RELATIONSHIP_TYPES ); + return allInUse( TokenAccess.RELATIONSHIP_TYPES ); } @Override public ResourceIterable