diff --git a/compatibility/4.4/storage-engine-adapter/src/main/java/org/neo4j/gds/compat/_44/StorageEngineProxyImpl.java b/compatibility/4.4/storage-engine-adapter/src/main/java/org/neo4j/gds/compat/_44/StorageEngineProxyImpl.java index a82ceac106..ae1ec4aa00 100644 --- a/compatibility/4.4/storage-engine-adapter/src/main/java/org/neo4j/gds/compat/_44/StorageEngineProxyImpl.java +++ b/compatibility/4.4/storage-engine-adapter/src/main/java/org/neo4j/gds/compat/_44/StorageEngineProxyImpl.java @@ -41,7 +41,10 @@ import org.neo4j.storageengine.api.StorageEntityCursor; import org.neo4j.storageengine.api.StoragePropertyCursor; import org.neo4j.storageengine.api.StorageRelationshipTraversalCursor; +import org.neo4j.token.DelegatingTokenHolder; +import org.neo4j.token.ReadOnlyTokenCreator; import org.neo4j.token.TokenHolders; +import org.neo4j.token.api.TokenHolder; import static org.neo4j.configuration.GraphDatabaseInternalSettings.storage_engine; @@ -137,4 +140,13 @@ public void properties( public Edition dbmsEdition(GraphDatabaseService databaseService) { return GraphDatabaseApiProxy.dbmsInfo(databaseService).edition; } + + @Override + public TokenHolders newTokenHolders() { + return new TokenHolders( + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_PROPERTY_KEY), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_LABEL), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_RELATIONSHIP_TYPE) + ); + } } diff --git a/compatibility/5.10/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_510/StorageEngineProxyImpl.java b/compatibility/5.10/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_510/StorageEngineProxyImpl.java index 0e4e3e89cf..202310245b 100644 --- a/compatibility/5.10/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_510/StorageEngineProxyImpl.java +++ b/compatibility/5.10/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_510/StorageEngineProxyImpl.java @@ -41,7 +41,10 @@ import org.neo4j.storageengine.api.StorageEntityCursor; import org.neo4j.storageengine.api.StoragePropertyCursor; import org.neo4j.storageengine.api.StorageRelationshipTraversalCursor; +import org.neo4j.token.DelegatingTokenHolder; +import org.neo4j.token.ReadOnlyTokenCreator; import org.neo4j.token.TokenHolders; +import org.neo4j.token.api.TokenHolder; import static org.neo4j.configuration.GraphDatabaseSettings.db_format; @@ -137,4 +140,13 @@ public void properties( public Edition dbmsEdition(GraphDatabaseService databaseService) { return GraphDatabaseApiProxy.dbmsInfo(databaseService).edition; } + + @Override + public TokenHolders newTokenHolders() { + return new TokenHolders( + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_PROPERTY_KEY), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_LABEL), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_RELATIONSHIP_TYPE) + ); + } } diff --git a/compatibility/5.11/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_511/StorageEngineProxyImpl.java b/compatibility/5.11/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_511/StorageEngineProxyImpl.java index d2688f8a37..58650f55a9 100644 --- a/compatibility/5.11/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_511/StorageEngineProxyImpl.java +++ b/compatibility/5.11/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_511/StorageEngineProxyImpl.java @@ -41,7 +41,10 @@ import org.neo4j.storageengine.api.StorageEntityCursor; import org.neo4j.storageengine.api.StoragePropertyCursor; import org.neo4j.storageengine.api.StorageRelationshipTraversalCursor; +import org.neo4j.token.DelegatingTokenHolder; +import org.neo4j.token.ReadOnlyTokenCreator; import org.neo4j.token.TokenHolders; +import org.neo4j.token.api.TokenHolder; import static org.neo4j.configuration.GraphDatabaseSettings.db_format; @@ -137,4 +140,13 @@ public void properties( public Edition dbmsEdition(GraphDatabaseService databaseService) { return GraphDatabaseApiProxy.dbmsInfo(databaseService).edition; } + + @Override + public TokenHolders newTokenHolders() { + return new TokenHolders( + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_PROPERTY_KEY), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_LABEL), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_RELATIONSHIP_TYPE) + ); + } } diff --git a/compatibility/5.12/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_512/StorageEngineProxyImpl.java b/compatibility/5.12/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_512/StorageEngineProxyImpl.java index 9869947a40..94f318d12d 100644 --- a/compatibility/5.12/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_512/StorageEngineProxyImpl.java +++ b/compatibility/5.12/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_512/StorageEngineProxyImpl.java @@ -41,7 +41,10 @@ import org.neo4j.storageengine.api.StorageEntityCursor; import org.neo4j.storageengine.api.StoragePropertyCursor; import org.neo4j.storageengine.api.StorageRelationshipTraversalCursor; +import org.neo4j.token.DelegatingTokenHolder; +import org.neo4j.token.ReadOnlyTokenCreator; import org.neo4j.token.TokenHolders; +import org.neo4j.token.api.TokenHolder; import static org.neo4j.configuration.GraphDatabaseSettings.db_format; @@ -137,4 +140,13 @@ public void properties( public Edition dbmsEdition(GraphDatabaseService databaseService) { return GraphDatabaseApiProxy.dbmsInfo(databaseService).edition; } + + @Override + public TokenHolders newTokenHolders() { + return new TokenHolders( + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_PROPERTY_KEY), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_LABEL), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_RELATIONSHIP_TYPE) + ); + } } diff --git a/compatibility/5.13/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_513/StorageEngineProxyImpl.java b/compatibility/5.13/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_513/StorageEngineProxyImpl.java index 6b342c1263..f703fb4bb6 100644 --- a/compatibility/5.13/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_513/StorageEngineProxyImpl.java +++ b/compatibility/5.13/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_513/StorageEngineProxyImpl.java @@ -41,7 +41,10 @@ import org.neo4j.storageengine.api.StorageEntityCursor; import org.neo4j.storageengine.api.StoragePropertyCursor; import org.neo4j.storageengine.api.StorageRelationshipTraversalCursor; +import org.neo4j.token.DelegatingTokenHolder; +import org.neo4j.token.ReadOnlyTokenCreator; import org.neo4j.token.TokenHolders; +import org.neo4j.token.api.TokenHolder; import static org.neo4j.configuration.GraphDatabaseSettings.db_format; @@ -137,4 +140,13 @@ public void properties( public Edition dbmsEdition(GraphDatabaseService databaseService) { return GraphDatabaseApiProxy.dbmsInfo(databaseService).edition; } + + @Override + public TokenHolders newTokenHolders() { + return new TokenHolders( + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_PROPERTY_KEY), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_LABEL), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_RELATIONSHIP_TYPE) + ); + } } diff --git a/compatibility/5.14/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_514/StorageEngineProxyImpl.java b/compatibility/5.14/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_514/StorageEngineProxyImpl.java index 6562c6aefb..ab73bfc9a4 100644 --- a/compatibility/5.14/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_514/StorageEngineProxyImpl.java +++ b/compatibility/5.14/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_514/StorageEngineProxyImpl.java @@ -41,7 +41,10 @@ import org.neo4j.storageengine.api.StorageEntityCursor; import org.neo4j.storageengine.api.StoragePropertyCursor; import org.neo4j.storageengine.api.StorageRelationshipTraversalCursor; +import org.neo4j.token.DelegatingTokenHolder; +import org.neo4j.token.ReadOnlyTokenCreator; import org.neo4j.token.TokenHolders; +import org.neo4j.token.api.TokenHolder; import static org.neo4j.configuration.GraphDatabaseSettings.db_format; @@ -137,4 +140,13 @@ public void properties( public Edition dbmsEdition(GraphDatabaseService databaseService) { return GraphDatabaseApiProxy.dbmsInfo(databaseService).edition; } + + @Override + public TokenHolders newTokenHolders() { + return new TokenHolders( + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_PROPERTY_KEY), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_LABEL), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_RELATIONSHIP_TYPE) + ); + } } diff --git a/compatibility/5.15/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_515/StorageEngineProxyImpl.java b/compatibility/5.15/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_515/StorageEngineProxyImpl.java index f210c54fb6..56887e5f7e 100644 --- a/compatibility/5.15/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_515/StorageEngineProxyImpl.java +++ b/compatibility/5.15/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_515/StorageEngineProxyImpl.java @@ -41,7 +41,10 @@ import org.neo4j.storageengine.api.StorageEntityCursor; import org.neo4j.storageengine.api.StoragePropertyCursor; import org.neo4j.storageengine.api.StorageRelationshipTraversalCursor; +import org.neo4j.token.DelegatingTokenHolder; +import org.neo4j.token.ReadOnlyTokenCreator; import org.neo4j.token.TokenHolders; +import org.neo4j.token.api.TokenHolder; import static org.neo4j.configuration.GraphDatabaseSettings.db_format; @@ -137,4 +140,13 @@ public void properties( public Edition dbmsEdition(GraphDatabaseService databaseService) { return GraphDatabaseApiProxy.dbmsInfo(databaseService).edition; } + + @Override + public TokenHolders newTokenHolders() { + return new TokenHolders( + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_PROPERTY_KEY), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_LABEL), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_RELATIONSHIP_TYPE) + ); + } } diff --git a/compatibility/5.6/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_56/StorageEngineProxyImpl.java b/compatibility/5.6/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_56/StorageEngineProxyImpl.java index f0c961de55..6b0117fb66 100644 --- a/compatibility/5.6/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_56/StorageEngineProxyImpl.java +++ b/compatibility/5.6/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_56/StorageEngineProxyImpl.java @@ -41,7 +41,10 @@ import org.neo4j.storageengine.api.StorageEntityCursor; import org.neo4j.storageengine.api.StoragePropertyCursor; import org.neo4j.storageengine.api.StorageRelationshipTraversalCursor; +import org.neo4j.token.DelegatingTokenHolder; +import org.neo4j.token.ReadOnlyTokenCreator; import org.neo4j.token.TokenHolders; +import org.neo4j.token.api.TokenHolder; import static org.neo4j.configuration.GraphDatabaseSettings.db_format; @@ -137,4 +140,13 @@ public void properties( public Edition dbmsEdition(GraphDatabaseService databaseService) { return GraphDatabaseApiProxy.dbmsInfo(databaseService).edition; } + + @Override + public TokenHolders newTokenHolders() { + return new TokenHolders( + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_PROPERTY_KEY), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_LABEL), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_RELATIONSHIP_TYPE) + ); + } } diff --git a/compatibility/5.7/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_57/StorageEngineProxyImpl.java b/compatibility/5.7/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_57/StorageEngineProxyImpl.java index c845bc1451..48e0abdbb6 100644 --- a/compatibility/5.7/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_57/StorageEngineProxyImpl.java +++ b/compatibility/5.7/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_57/StorageEngineProxyImpl.java @@ -41,7 +41,10 @@ import org.neo4j.storageengine.api.StorageEntityCursor; import org.neo4j.storageengine.api.StoragePropertyCursor; import org.neo4j.storageengine.api.StorageRelationshipTraversalCursor; +import org.neo4j.token.DelegatingTokenHolder; +import org.neo4j.token.ReadOnlyTokenCreator; import org.neo4j.token.TokenHolders; +import org.neo4j.token.api.TokenHolder; import static org.neo4j.configuration.GraphDatabaseSettings.db_format; @@ -137,4 +140,13 @@ public void properties( public Edition dbmsEdition(GraphDatabaseService databaseService) { return GraphDatabaseApiProxy.dbmsInfo(databaseService).edition; } + + @Override + public TokenHolders newTokenHolders() { + return new TokenHolders( + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_PROPERTY_KEY), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_LABEL), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_RELATIONSHIP_TYPE) + ); + } } diff --git a/compatibility/5.8/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_58/StorageEngineProxyImpl.java b/compatibility/5.8/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_58/StorageEngineProxyImpl.java index fd8e08e5a3..f60816b102 100644 --- a/compatibility/5.8/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_58/StorageEngineProxyImpl.java +++ b/compatibility/5.8/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_58/StorageEngineProxyImpl.java @@ -41,7 +41,10 @@ import org.neo4j.storageengine.api.StorageEntityCursor; import org.neo4j.storageengine.api.StoragePropertyCursor; import org.neo4j.storageengine.api.StorageRelationshipTraversalCursor; +import org.neo4j.token.DelegatingTokenHolder; +import org.neo4j.token.ReadOnlyTokenCreator; import org.neo4j.token.TokenHolders; +import org.neo4j.token.api.TokenHolder; import static org.neo4j.configuration.GraphDatabaseSettings.db_format; @@ -137,4 +140,13 @@ public void properties( public Edition dbmsEdition(GraphDatabaseService databaseService) { return GraphDatabaseApiProxy.dbmsInfo(databaseService).edition; } + + @Override + public TokenHolders newTokenHolders() { + return new TokenHolders( + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_PROPERTY_KEY), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_LABEL), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_RELATIONSHIP_TYPE) + ); + } } diff --git a/compatibility/5.9/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_59/StorageEngineProxyImpl.java b/compatibility/5.9/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_59/StorageEngineProxyImpl.java index 81318ea397..49c30f4b2d 100644 --- a/compatibility/5.9/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_59/StorageEngineProxyImpl.java +++ b/compatibility/5.9/storage-engine-adapter/src/main/java17/org/neo4j/gds/compat/_59/StorageEngineProxyImpl.java @@ -41,7 +41,10 @@ import org.neo4j.storageengine.api.StorageEntityCursor; import org.neo4j.storageengine.api.StoragePropertyCursor; import org.neo4j.storageengine.api.StorageRelationshipTraversalCursor; +import org.neo4j.token.DelegatingTokenHolder; +import org.neo4j.token.ReadOnlyTokenCreator; import org.neo4j.token.TokenHolders; +import org.neo4j.token.api.TokenHolder; import static org.neo4j.configuration.GraphDatabaseSettings.db_format; @@ -137,4 +140,13 @@ public void properties( public Edition dbmsEdition(GraphDatabaseService databaseService) { return GraphDatabaseApiProxy.dbmsInfo(databaseService).edition; } + + @Override + public TokenHolders newTokenHolders() { + return new TokenHolders( + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_PROPERTY_KEY), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_LABEL), + new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_RELATIONSHIP_TYPE) + ); + } } diff --git a/compatibility/api/storage-engine-adapter/src/main/java/org/neo4j/gds/compat/StorageEngineProxyApi.java b/compatibility/api/storage-engine-adapter/src/main/java/org/neo4j/gds/compat/StorageEngineProxyApi.java index c1ddd16bf8..e2c337ed4a 100644 --- a/compatibility/api/storage-engine-adapter/src/main/java/org/neo4j/gds/compat/StorageEngineProxyApi.java +++ b/compatibility/api/storage-engine-adapter/src/main/java/org/neo4j/gds/compat/StorageEngineProxyApi.java @@ -85,4 +85,6 @@ AbstractInMemoryRelationshipPropertyCursor inMemoryRelationshipPropertyCursor( void properties(StorageEntityCursor storageCursor, StoragePropertyCursor propertyCursor, int[] propertySelection); Edition dbmsEdition(GraphDatabaseService databaseService); + + TokenHolders newTokenHolders(); } diff --git a/compatibility/common/storage-engine-adapter/src/main/java/org/neo4j/gds/compat/StorageEngineProxy.java b/compatibility/common/storage-engine-adapter/src/main/java/org/neo4j/gds/compat/StorageEngineProxy.java index 12964be986..cc2c0d6635 100644 --- a/compatibility/common/storage-engine-adapter/src/main/java/org/neo4j/gds/compat/StorageEngineProxy.java +++ b/compatibility/common/storage-engine-adapter/src/main/java/org/neo4j/gds/compat/StorageEngineProxy.java @@ -114,4 +114,8 @@ public static void properties(StorageEntityCursor storageCursor, StorageProperty public static Edition dbmsEdition(GraphDatabaseService databaseService) { return IMPL.dbmsEdition(databaseService); } + + public static TokenHolders newTokenHolders() { + return IMPL.newTokenHolders(); + } } diff --git a/cypher/cypher-test/src/test/java/org/neo4j/gds/storageengine/CypherTest.java b/cypher/cypher-test/src/test/java/org/neo4j/gds/storageengine/CypherTest.java index 52c526d623..32a83af724 100644 --- a/cypher/cypher-test/src/test/java/org/neo4j/gds/storageengine/CypherTest.java +++ b/cypher/cypher-test/src/test/java/org/neo4j/gds/storageengine/CypherTest.java @@ -24,15 +24,13 @@ import org.neo4j.gds.BaseTest; import org.neo4j.gds.api.GraphStore; import org.neo4j.gds.compat.GraphDatabaseApiProxy; +import org.neo4j.gds.compat.StorageEngineProxy; import org.neo4j.gds.config.GraphProjectConfig; import org.neo4j.gds.core.cypher.CypherGraphStore; import org.neo4j.gds.core.loading.GraphStoreCatalog; import org.neo4j.internal.recordstorage.InMemoryStorageEngineCompanion; import org.neo4j.storageengine.api.StorageEngine; -import org.neo4j.token.DelegatingTokenHolder; -import org.neo4j.token.ReadOnlyTokenCreator; import org.neo4j.token.TokenHolders; -import org.neo4j.token.api.TokenHolder; public abstract class CypherTest extends BaseTest { @@ -46,11 +44,7 @@ void setup() throws Exception { GraphStoreCatalog.set(GraphProjectConfig.emptyWithName("", GraphDatabaseApiProxy.databaseLayout(db).getDatabaseName()), graphStore); - this.tokenHolders = new TokenHolders( - new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_PROPERTY_KEY), - new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_LABEL), - new DelegatingTokenHolder(new ReadOnlyTokenCreator(), TokenHolder.TYPE_RELATIONSHIP_TYPE) - ); + this.tokenHolders = StorageEngineProxy.newTokenHolders(); this.storageEngine = InMemoryStorageEngineCompanion.create(GraphDatabaseApiProxy.databaseLayout(db), tokenHolders); this.storageEngine.schemaAndTokensLifecycle().init();