From 9b9a5bdd579c77445ef05ba50aa9207b78f6a073 Mon Sep 17 00:00:00 2001 From: Paul Horn Date: Mon, 29 Jul 2024 16:32:23 +0200 Subject: [PATCH] Drop 5.16 support --- README.adoc | 5 +- build.gradle | 1 - .../5.16/neo4j-kernel-adapter/build.gradle | 21 - .../gds/compat/_516/BatchImporterCompat.java | 517 ------------------ .../compat/_516/Neo4jProxyFactoryImpl.java | 44 -- .../neo4j/gds/compat/_516/Neo4jProxyImpl.java | 283 ---------- gradle/dependencies.gradle | 4 - .../neo4j/gds/compat/Neo4jVersionLookup.java | 2 +- .../gds/compat/Neo4jVersionLookupTest.java | 2 - settings.gradle | 2 - .../gds/junit/annotation/Neo4jVersion.java | 1 - 11 files changed, 3 insertions(+), 879 deletions(-) delete mode 100644 compatibility/5.16/neo4j-kernel-adapter/build.gradle delete mode 100644 compatibility/5.16/neo4j-kernel-adapter/src/main/java/org/neo4j/gds/compat/_516/BatchImporterCompat.java delete mode 100644 compatibility/5.16/neo4j-kernel-adapter/src/main/java/org/neo4j/gds/compat/_516/Neo4jProxyFactoryImpl.java delete mode 100644 compatibility/5.16/neo4j-kernel-adapter/src/main/java/org/neo4j/gds/compat/_516/Neo4jProxyImpl.java diff --git a/README.adoc b/README.adoc index 63b79aeceb..af521d7ffe 100644 --- a/README.adoc +++ b/README.adoc @@ -26,15 +26,14 @@ When installing GDS manually, please refer to the below compatibility matrix: .Compatibility matrix (italicized version is in development) |=== |GDS version | Neo4j version | Java Version -.7+<.^|_GDS 2.9.x (preview)_ +.6+<.^|_GDS 2.9.x (preview)_ |Neo4j 5.22.0 -.7+.^|Java 21 & Java 17 +.6+.^|Java 21 & Java 17 |Neo4j 5.21.0, 5.21.1, 5.21.2 |Neo4j 5.20.0 |Neo4j 5.19.0 |Neo4j 5.18.0, 5.18.1 |Neo4j 5.17.0 -|Neo4j 5.16.0 .7+<.^|GDS 2.8.x |Neo4j 5.22.0 .7+.^|Java 21 & Java 17 diff --git a/build.gradle b/build.gradle index 6bd5960d2c..67f09f45de 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,6 @@ ext { compatibilityModules = [ 'kernel-adapter': [ - project(':neo4j-kernel-adapter-5.16'), project(':neo4j-kernel-adapter-5.17'), project(':neo4j-kernel-adapter-5.18'), project(':neo4j-kernel-adapter-5.19'), diff --git a/compatibility/5.16/neo4j-kernel-adapter/build.gradle b/compatibility/5.16/neo4j-kernel-adapter/build.gradle deleted file mode 100644 index 9251450da9..0000000000 --- a/compatibility/5.16/neo4j-kernel-adapter/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -apply plugin: 'java-library' - -description = 'Neo4j Graph Data Science :: Neo4j Kernel Adapter 5.16' - -group = 'org.neo4j.gds' - -dependencies { - annotationProcessor project(':annotations') - annotationProcessor group: 'org.neo4j', name: 'annotations', version: neos.'5.16' - annotationProcessor openGds.immutables.value - - compileOnly project(':annotations') - compileOnly openGds.immutables.value.annotations - neodeps().each { - compileOnly(group: 'org.neo4j', name: it, version: neos.'5.16') { - transitive = false - } - } - - implementation project(':neo4j-kernel-adapter-api') -} diff --git a/compatibility/5.16/neo4j-kernel-adapter/src/main/java/org/neo4j/gds/compat/_516/BatchImporterCompat.java b/compatibility/5.16/neo4j-kernel-adapter/src/main/java/org/neo4j/gds/compat/_516/BatchImporterCompat.java deleted file mode 100644 index a8abbe61a9..0000000000 --- a/compatibility/5.16/neo4j-kernel-adapter/src/main/java/org/neo4j/gds/compat/_516/BatchImporterCompat.java +++ /dev/null @@ -1,517 +0,0 @@ -/* - * Copyright (c) "Neo4j" - * Neo4j Sweden AB [http://neo4j.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.gds.compat._516; - -import org.neo4j.common.DependencyResolver; -import org.neo4j.configuration.Config; -import org.neo4j.gds.compat.batchimport.BatchImporter; -import org.neo4j.gds.compat.batchimport.ExecutionMonitor; -import org.neo4j.gds.compat.batchimport.ImportConfig; -import org.neo4j.gds.compat.batchimport.InputIterable; -import org.neo4j.gds.compat.batchimport.InputIterator; -import org.neo4j.gds.compat.batchimport.Monitor; -import org.neo4j.gds.compat.batchimport.input.Collector; -import org.neo4j.gds.compat.batchimport.input.Estimates; -import org.neo4j.gds.compat.batchimport.input.Group; -import org.neo4j.gds.compat.batchimport.input.IdType; -import org.neo4j.gds.compat.batchimport.input.Input; -import org.neo4j.gds.compat.batchimport.input.InputChunk; -import org.neo4j.gds.compat.batchimport.input.InputEntityVisitor; -import org.neo4j.gds.compat.batchimport.input.ReadableGroups; -import org.neo4j.internal.batchimport.AdditionalInitialIds; -import org.neo4j.internal.batchimport.BatchImporterFactory; -import org.neo4j.internal.batchimport.IndexConfig; -import org.neo4j.internal.batchimport.input.Collectors; -import org.neo4j.internal.batchimport.input.Groups; -import org.neo4j.internal.batchimport.staging.CoarseBoundedProgressExecutionMonitor; -import org.neo4j.internal.batchimport.staging.StageExecution; -import org.neo4j.io.fs.FileSystemAbstraction; -import org.neo4j.io.layout.DatabaseLayout; -import org.neo4j.io.pagecache.context.CursorContextFactory; -import org.neo4j.io.pagecache.tracing.PageCacheTracer; -import org.neo4j.kernel.impl.index.schema.IndexImporterFactoryImpl; -import org.neo4j.kernel.impl.transaction.log.EmptyLogTailMetadata; -import org.neo4j.kernel.impl.transaction.log.files.TransactionLogInitializer; -import org.neo4j.logging.internal.LogService; -import org.neo4j.memory.EmptyMemoryTracker; -import org.neo4j.scheduler.JobScheduler; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.function.LongConsumer; - -public final class BatchImporterCompat { - - private BatchImporterCompat() {} - - static BatchImporter instantiateRecordBatchImporter( - DatabaseLayout directoryStructure, - FileSystemAbstraction fileSystem, - ImportConfig config, - ExecutionMonitor executionMonitor, - LogService logService, - Config dbConfig, - JobScheduler jobScheduler, - Collector badCollector - ) { - var importer = BatchImporterFactory.withHighestPriority() - .instantiate( - directoryStructure, - fileSystem, - PageCacheTracer.NULL, - new ConfigurationAdapter(config), - logService, - new ExecutionMonitorAdapter(executionMonitor), - AdditionalInitialIds.EMPTY, - new EmptyLogTailMetadata(dbConfig), - dbConfig, - org.neo4j.internal.batchimport.Monitor.NO_MONITOR, - jobScheduler, - badCollector != null ? ((CollectorAdapter) badCollector).delegate : null, - TransactionLogInitializer.getLogFilesInitializer(), - new IndexImporterFactoryImpl(), - EmptyMemoryTracker.INSTANCE, - CursorContextFactory.NULL_CONTEXT_FACTORY - ); - return new BatchImporterReverseAdapter(importer); - } - - static final class ConfigurationAdapter implements org.neo4j.internal.batchimport.Configuration { - private final ImportConfig inner; - - ConfigurationAdapter(ImportConfig inner) { - this.inner = inner; - } - - @Override - public int batchSize() { - return this.inner.batchSize(); - } - - @Override - public int maxNumberOfWorkerThreads() { - return this.inner.writeConcurrency(); - } - - @Override - public boolean highIO() { - return this.inner.highIO(); - } - - @Override - public IndexConfig indexConfig() { - var config = IndexConfig.DEFAULT; - if (this.inner.createLabelIndex()) { - config = config.withLabelIndex(); - } - if (this.inner.createRelationshipTypeIndex()) { - config = config.withRelationshipTypeIndex(); - } - return config; - } - } - - static ExecutionMonitor newCoarseBoundedProgressExecutionMonitor( - long highNodeId, - long highRelationshipId, - int batchSize, - LongConsumer progress, - LongConsumer outNumberOfBatches - ) { - var delegate = new CoarseBoundedProgressExecutionMonitor( - highNodeId, - highRelationshipId, - org.neo4j.internal.batchimport.Configuration.withBatchSize( - org.neo4j.internal.batchimport.Configuration.DEFAULT, - batchSize - ) - ) { - @Override - protected void progress(long l) { - progress.accept(l); - } - - long numberOfBatches() { - return this.total(); - } - }; - // Note: this only works because we declare the delegate with `var` - outNumberOfBatches.accept(delegate.numberOfBatches()); - - return new ExecutionMonitor() { - - @Override - public Monitor toMonitor() { - throw new UnsupportedOperationException("Cannot call `toMonitor` on this one"); - } - - @Override - public void start(StageExecution execution) { - delegate.start(execution); - } - - @Override - public void end(StageExecution execution, long totalTimeMillis) { - delegate.end(execution, totalTimeMillis); - } - - @Override - public void done(boolean successful, long totalTimeMillis, String additionalInformation) { - delegate.done(successful, totalTimeMillis, additionalInformation); - } - - @Override - public long checkIntervalMillis() { - return delegate.checkIntervalMillis(); - } - - @Override - public void check(StageExecution execution) { - delegate.check(execution); - } - }; - } - - static final class ExecutionMonitorAdapter implements org.neo4j.internal.batchimport.staging.ExecutionMonitor { - private final ExecutionMonitor delegate; - - ExecutionMonitorAdapter(ExecutionMonitor delegate) {this.delegate = delegate;} - - @Override - public void initialize(DependencyResolver dependencyResolver) { - org.neo4j.internal.batchimport.staging.ExecutionMonitor.super.initialize(dependencyResolver); - this.delegate.initialize(dependencyResolver); - } - - @Override - public void start(StageExecution stageExecution) { - this.delegate.start(stageExecution); - } - - @Override - public void end(StageExecution stageExecution, long l) { - this.delegate.end(stageExecution, l); - } - - @Override - public void done(boolean b, long l, String s) { - this.delegate.done(b, l, s); - } - - @Override - public long checkIntervalMillis() { - return this.delegate.checkIntervalMillis(); - } - - @Override - public void check(StageExecution stageExecution) { - this.delegate.check(stageExecution); - } - } - - static final class BatchImporterReverseAdapter implements BatchImporter { - private final org.neo4j.internal.batchimport.BatchImporter delegate; - - BatchImporterReverseAdapter(org.neo4j.internal.batchimport.BatchImporter delegate) {this.delegate = delegate;} - - @Override - public void doImport(Input input) throws IOException { - delegate.doImport(new InputAdapter(input)); - } - } - - static final class InputAdapter implements org.neo4j.internal.batchimport.input.Input { - private final Input delegate; - - InputAdapter(Input delegate) {this.delegate = delegate;} - - @Override - public org.neo4j.internal.batchimport.InputIterable nodes(org.neo4j.internal.batchimport.input.Collector collector) { - return new InputIterableAdapter(delegate.nodes()); - } - - @Override - public org.neo4j.internal.batchimport.InputIterable relationships(org.neo4j.internal.batchimport.input.Collector collector) { - return new InputIterableAdapter(delegate.relationships()); - } - - @Override - public org.neo4j.internal.batchimport.input.IdType idType() { - return adaptIdType(delegate.idType()); - } - - @Override - public org.neo4j.internal.batchimport.input.ReadableGroups groups() { - return adaptReadableGroups(delegate.groups()); - } - - @Override - public Estimates calculateEstimates(org.neo4j.internal.batchimport.input.PropertySizeCalculator propertySizeCalculator) - throws IOException { - return adaptEstimates(delegate.calculateEstimates()); - } - - @Override - public void close() { - delegate.close(); - } - } - - static final class InputIterableAdapter implements org.neo4j.internal.batchimport.InputIterable { - private final InputIterable delegate; - - InputIterableAdapter(InputIterable delegate) {this.delegate = delegate;} - - @Override - public org.neo4j.internal.batchimport.InputIterator iterator() { - return new InputIteratorAdapter(delegate.iterator()); - } - } - - static final class InputIteratorAdapter implements org.neo4j.internal.batchimport.InputIterator { - private final InputIterator delegate; - - InputIteratorAdapter(InputIterator delegate) {this.delegate = delegate;} - - @Override - public org.neo4j.internal.batchimport.input.InputChunk newChunk() { - return new InputChunkAdapter(delegate.newChunk()); - } - - @Override - public boolean next(org.neo4j.internal.batchimport.input.InputChunk inputChunk) throws IOException { - return delegate.next(((InputChunkAdapter) inputChunk).delegate); - } - - @Override - public void close() throws IOException { - delegate.close(); - } - } - - private static final class InputChunkAdapter implements org.neo4j.internal.batchimport.input.InputChunk { - private final InputChunk delegate; - - private InputChunkAdapter(InputChunk delegate) {this.delegate = delegate;} - - @Override - public boolean next(org.neo4j.internal.batchimport.input.InputEntityVisitor inputEntityVisitor) - throws IOException { - return delegate.next(new InputEntityVisitorReverseAdapter(inputEntityVisitor)); - } - - @Override - public void close() throws IOException { - delegate.close(); - } - } - - private static final class InputEntityVisitorReverseAdapter implements InputEntityVisitor { - private final org.neo4j.internal.batchimport.input.InputEntityVisitor delegate; - - InputEntityVisitorReverseAdapter(org.neo4j.internal.batchimport.input.InputEntityVisitor delegate) {this.delegate = delegate;} - - @Override - public boolean property(String s, Object o) { - return delegate.property(s, o); - } - - @Override - public boolean id(long l) { - return delegate.id(l); - } - - @Override - public boolean id(long id, Group group) { - return delegate.id(id, ((GroupReverseAdapter) group).delegate); - } - - @Override - public boolean id(String id, Group group) { - return delegate.id(id, ((GroupReverseAdapter) group).delegate); - } - - @Override - public boolean labels(String[] strings) { - return delegate.labels(strings); - } - - @Override - public boolean startId(long l) { - return delegate.startId(l); - } - - @Override - public boolean startId(long id, Group group) { - return delegate.startId(id, ((GroupReverseAdapter) group).delegate); - } - - @Override - public boolean startId(String id, Group group) { - return delegate.startId(id, ((GroupReverseAdapter) group).delegate); - } - - @Override - public boolean endId(long l) { - return delegate.endId(l); - } - - @Override - public boolean endId(long id, Group group) { - return delegate.endId(id, ((GroupReverseAdapter) group).delegate); - } - - @Override - public boolean endId(String id, Group group) { - return delegate.endId(id, ((GroupReverseAdapter) group).delegate); - } - - @Override - public boolean type(String s) { - return delegate.type(s); - } - - @Override - public void endOfEntity() throws IOException { - delegate.endOfEntity(); - } - - @Override - public void reset() { - delegate.reset(); - } - - @Override - public void close() throws IOException { - delegate.close(); - } - } - - private static Group adaptGroup(org.neo4j.internal.batchimport.input.Group group) { - return new GroupReverseAdapter(group); - } - - private static final class GroupReverseAdapter implements Group { - private final org.neo4j.internal.batchimport.input.Group delegate; - - private GroupReverseAdapter(org.neo4j.internal.batchimport.input.Group delegate) {this.delegate = delegate;} - } - - private static org.neo4j.internal.batchimport.input.IdType adaptIdType(IdType idType) { - return switch (idType) { - case ACTUAL -> org.neo4j.internal.batchimport.input.IdType.ACTUAL; - case INTEGER -> org.neo4j.internal.batchimport.input.IdType.INTEGER; - case STRING -> org.neo4j.internal.batchimport.input.IdType.STRING; - }; - } - - private static org.neo4j.internal.batchimport.input.ReadableGroups adaptReadableGroups(ReadableGroups groups) { - return groups == null || groups == ReadableGroups.EMPTY - ? org.neo4j.internal.batchimport.input.ReadableGroups.EMPTY - : ((ReadableGroupsReverseAdapter) groups).delegate; - } - - private static ReadableGroups adaptReadableGroups(org.neo4j.internal.batchimport.input.ReadableGroups groups) { - return groups == null || groups == org.neo4j.internal.batchimport.input.ReadableGroups.EMPTY - ? ReadableGroups.EMPTY - : new ReadableGroupsReverseAdapter(groups); - } - - private static class ReadableGroupsReverseAdapter implements ReadableGroups { - private final org.neo4j.internal.batchimport.input.ReadableGroups delegate; - - ReadableGroupsReverseAdapter(org.neo4j.internal.batchimport.input.ReadableGroups delegate) {this.delegate = delegate;} - - @Override - public Group getGlobalGroup() { - return adaptGroup(delegate.get(null)); - } - } - - private static org.neo4j.internal.batchimport.input.Input.Estimates adaptEstimates(Estimates estimates) { - return estimates == null || estimates == Estimates.NULL - ? NULL_ESTIMATES - : ((EstimatesAdapter) estimates).delegate; - } - - static ReadableGroups newGroups() { - return adaptReadableGroups(new Groups()); - } - - static ReadableGroups newInitializedGroups() { - var groups = new Groups(); - groups.getOrCreate(null); - return adaptReadableGroups(groups); - } - - static Collector emptyCollector() { - return CollectorAdapter.EMPTY; - } - - static Collector badCollector(OutputStream outputStream, int batchSize) { - return new CollectorAdapter(Collectors.badCollector(outputStream, batchSize)); - } - - private static final class CollectorAdapter implements Collector { - private static final Collector EMPTY = new CollectorAdapter(org.neo4j.internal.batchimport.input.Collector.EMPTY); - - private final org.neo4j.internal.batchimport.input.Collector delegate; - - CollectorAdapter(org.neo4j.internal.batchimport.input.Collector delegate) { - this.delegate = delegate; - } - } - - private static final org.neo4j.internal.batchimport.input.Input.Estimates NULL_ESTIMATES = - org.neo4j.internal.batchimport.input.Input.knownEstimates(0, 0, 0, 0, 0, 0, 0); - - static Estimates knownEstimates( - long numberOfNodes, - long numberOfRelationships, - long numberOfNodeProperties, - long numberOfRelationshipProperties, - long sizeOfNodeProperties, - long sizeOfRelationshipProperties, - long numberOfNodeLabels - ) { - if (numberOfNodes == 0 && numberOfRelationships == 0 && numberOfNodeProperties == 0 - && numberOfRelationshipProperties == 0 && sizeOfNodeProperties == 0 && sizeOfRelationshipProperties == 0 - && numberOfNodeLabels == 0) { - return Estimates.NULL; - } - return new EstimatesAdapter(org.neo4j.internal.batchimport.input.Input.knownEstimates( - numberOfNodes, - numberOfRelationships, - numberOfNodeProperties, - numberOfRelationshipProperties, - sizeOfNodeProperties, - sizeOfRelationshipProperties, - numberOfNodeLabels - )); - } - - private static final class EstimatesAdapter implements Estimates { - private final org.neo4j.internal.batchimport.input.Input.Estimates delegate; - - EstimatesAdapter(org.neo4j.internal.batchimport.input.Input.Estimates delegate) { - this.delegate = delegate; - } - } -} diff --git a/compatibility/5.16/neo4j-kernel-adapter/src/main/java/org/neo4j/gds/compat/_516/Neo4jProxyFactoryImpl.java b/compatibility/5.16/neo4j-kernel-adapter/src/main/java/org/neo4j/gds/compat/_516/Neo4jProxyFactoryImpl.java deleted file mode 100644 index efc17b7215..0000000000 --- a/compatibility/5.16/neo4j-kernel-adapter/src/main/java/org/neo4j/gds/compat/_516/Neo4jProxyFactoryImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) "Neo4j" - * Neo4j Sweden AB [http://neo4j.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.gds.compat._516; - -import org.neo4j.annotations.service.ServiceProvider; -import org.neo4j.gds.compat.Neo4jProxyApi; -import org.neo4j.gds.compat.Neo4jProxyFactory; -import org.neo4j.gds.compat.Neo4jVersion; - -@ServiceProvider -public final class Neo4jProxyFactoryImpl implements Neo4jProxyFactory { - - @Override - public boolean canLoad(Neo4jVersion version) { - return version.matches(5, 16); - } - - @Override - public Neo4jProxyApi load() { - return new Neo4jProxyImpl(); - } - - @Override - public String description() { - return "Neo4j 5.16"; - } -} diff --git a/compatibility/5.16/neo4j-kernel-adapter/src/main/java/org/neo4j/gds/compat/_516/Neo4jProxyImpl.java b/compatibility/5.16/neo4j-kernel-adapter/src/main/java/org/neo4j/gds/compat/_516/Neo4jProxyImpl.java deleted file mode 100644 index a8479395c5..0000000000 --- a/compatibility/5.16/neo4j-kernel-adapter/src/main/java/org/neo4j/gds/compat/_516/Neo4jProxyImpl.java +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Copyright (c) "Neo4j" - * Neo4j Sweden AB [http://neo4j.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.gds.compat._516; - -import org.neo4j.configuration.Config; -import org.neo4j.exceptions.KernelException; -import org.neo4j.gds.compat.GlobalProcedureRegistry; -import org.neo4j.gds.compat.Neo4jProxyApi; -import org.neo4j.gds.compat.Write; -import org.neo4j.gds.compat.batchimport.BatchImporter; -import org.neo4j.gds.compat.batchimport.ExecutionMonitor; -import org.neo4j.gds.compat.batchimport.ImportConfig; -import org.neo4j.gds.compat.batchimport.Monitor; -import org.neo4j.gds.compat.batchimport.input.Collector; -import org.neo4j.gds.compat.batchimport.input.Estimates; -import org.neo4j.gds.compat.batchimport.input.ReadableGroups; -import org.neo4j.internal.kernel.api.PropertyCursor; -import org.neo4j.internal.kernel.api.Read; -import org.neo4j.internal.kernel.api.exceptions.InvalidTransactionTypeKernelException; -import org.neo4j.internal.kernel.api.procs.FieldSignature; -import org.neo4j.internal.kernel.api.procs.Neo4jTypes; -import org.neo4j.internal.kernel.api.procs.ProcedureSignature; -import org.neo4j.internal.kernel.api.procs.QualifiedName; -import org.neo4j.internal.kernel.api.procs.UserFunctionSignature; -import org.neo4j.io.fs.FileSystemAbstraction; -import org.neo4j.io.layout.DatabaseLayout; -import org.neo4j.kernel.api.KernelTransaction; -import org.neo4j.kernel.api.procedure.GlobalProcedures; -import org.neo4j.logging.internal.LogService; -import org.neo4j.procedure.Mode; -import org.neo4j.scheduler.JobScheduler; -import org.neo4j.storageengine.api.PropertySelection; -import org.neo4j.storageengine.api.Reference; -import org.neo4j.values.storable.Value; - -import java.io.OutputStream; -import java.util.List; -import java.util.Optional; -import java.util.function.LongConsumer; -import java.util.stream.Stream; - -import static java.util.function.Predicate.not; - -public final class Neo4jProxyImpl implements Neo4jProxyApi { - - @Override - public BatchImporter instantiateBlockBatchImporter( - DatabaseLayout dbLayout, - FileSystemAbstraction fileSystem, - ImportConfig config, - Monitor monitor, - LogService logService, - Config dbConfig, - JobScheduler jobScheduler, - Collector badCollector - ) { - throw new UnsupportedOperationException( - "GDS does not support block store format batch importer on this Neo4j version. Requires >= Neo4j 5.18."); - } - - @Override - public BatchImporter instantiateRecordBatchImporter( - DatabaseLayout directoryStructure, - FileSystemAbstraction fileSystem, - ImportConfig config, - ExecutionMonitor executionMonitor, - LogService logService, - Config dbConfig, - JobScheduler jobScheduler, - Collector badCollector - ) { - return BatchImporterCompat.instantiateRecordBatchImporter( - directoryStructure, - fileSystem, - config, - executionMonitor, - logService, - dbConfig, - jobScheduler, - badCollector - ); - } - - @Override - public ExecutionMonitor newCoarseBoundedProgressExecutionMonitor( - long highNodeId, - long highRelationshipId, - int batchSize, - LongConsumer progress, - LongConsumer outNumberOfBatches - ) { - return BatchImporterCompat.newCoarseBoundedProgressExecutionMonitor( - highNodeId, - highRelationshipId, - batchSize, - progress, - outNumberOfBatches - ); - } - - @Override - public ReadableGroups newGroups() { - return BatchImporterCompat.newGroups(); - } - - @Override - public ReadableGroups newInitializedGroups() { - return BatchImporterCompat.newInitializedGroups(); - } - - @Override - public Collector emptyCollector() { - return BatchImporterCompat.emptyCollector(); - } - - @Override - public Collector badCollector(OutputStream outputStream, int batchSize) { - return BatchImporterCompat.badCollector(outputStream, batchSize); - } - - @Override - public Estimates knownEstimates( - long numberOfNodes, - long numberOfRelationships, - long numberOfNodeProperties, - long numberOfRelationshipProperties, - long sizeOfNodeProperties, - long sizeOfRelationshipProperties, - long numberOfNodeLabels - ) { - return BatchImporterCompat.knownEstimates( - numberOfNodes, - numberOfRelationships, - numberOfNodeProperties, - numberOfRelationshipProperties, - sizeOfNodeProperties, - sizeOfRelationshipProperties, - numberOfNodeLabels - ); - } - - @Override - public GlobalProcedureRegistry globalProcedureRegistry(GlobalProcedures globalProcedures) { - return new GlobalProcedureRegistry() { - @Override - public Stream getAllProcedures() { - return globalProcedures.getCurrentView().getAllProcedures().stream(); - } - - @Override - public Stream getAllNonAggregatingFunctions() { - return globalProcedures.getCurrentView().getAllNonAggregatingFunctions(); - } - - @Override - public Stream getAllAggregatingFunctions() { - return globalProcedures.getCurrentView().getAllAggregatingFunctions(); - } - }; - } - - @Override - public Write dataWrite(KernelTransaction kernelTransaction) throws InvalidTransactionTypeKernelException { - var neoWrite = kernelTransaction.dataWrite(); - return new Write() { - - @Override - public void nodeAddLabel(long node, int nodeLabelToken) throws KernelException { - neoWrite.nodeAddLabel(node, nodeLabelToken); - } - - @Override - public void nodeSetProperty(long node, int propertyKey, Value value) throws KernelException { - neoWrite.nodeSetProperty(node, propertyKey, value); - } - - @Override - public long relationshipCreate(long source, int relationshipToken, long target) throws KernelException { - return neoWrite.relationshipCreate(source, relationshipToken, target); - } - - @Override - public void relationshipSetProperty(long relationship, int propertyKey, Value value) throws - KernelException { - neoWrite.relationshipSetProperty(relationship, propertyKey, value); - } - }; - } - - @Override - public ProcedureSignature procedureSignature( - QualifiedName name, - List inputSignature, - List outputSignature, - Mode mode, - boolean admin, - Optional deprecatedBy, - String description, - String warning, - boolean eager, - boolean caseInsensitive, - boolean systemProcedure, - boolean internal, - boolean allowExpiredCredentials, - boolean threadSafe - ) { - var deprecated = deprecatedBy.filter(not(String::isEmpty)); - return new ProcedureSignature( - name, - inputSignature, - outputSignature, - mode, - admin, - deprecated.orElse(null), - description, - warning, - eager, - caseInsensitive, - systemProcedure, - internal, - allowExpiredCredentials, - threadSafe - ); - } - - @Override - public UserFunctionSignature userFunctionSignature( - QualifiedName name, - List inputSignature, - Neo4jTypes.AnyType type, - String description, - Optional deprecatedBy, - boolean internal, - boolean threadSafe - ) { - String category = null; // No predefined category (like temporal or math) - var caseInsensitive = false; // case sensitive name match - var isBuiltIn = false; // is built in; never true for GDS - var deprecated = deprecatedBy.filter(not(String::isEmpty)); - - return new UserFunctionSignature( - name, - inputSignature, - type, - deprecated.orElse(null), - description, - category, - caseInsensitive, - isBuiltIn, - internal, - threadSafe - ); - } - - @Override - public void relationshipProperties( - Read read, - long relationshipReference, - long startNodeReference, - Reference reference, - PropertySelection selection, - PropertyCursor cursor - ) { - read.relationshipProperties(relationshipReference, reference, selection, cursor); - } -} diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 52d5a61ee8..a5bcd0b207 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -1,6 +1,5 @@ ext { neos = [ - '5.16': properties.getOrDefault('neo4jVersion516', '5.16.0'), '5.17': properties.getOrDefault('neo4jVersion517', '5.17.0'), '5.18': properties.getOrDefault('neo4jVersion518', '5.18.1'), '5.19': properties.getOrDefault('neo4jVersion519', '5.19.0'), @@ -14,7 +13,6 @@ ext { neo4j_minor = properties.getOrDefault('neo4jVersion', neo4jDefault).toString().split('\\.')[0..1].join('.') scalas = [ - '5.16': '2.13.11', '5.17': '2.13.11', '5.18': '2.13.11', '5.19': '2.13.11', @@ -25,7 +23,6 @@ ext { ] log4js = [ - '5.16': '2.20.0', '5.17': '2.20.0', '5.18': '2.20.0', '5.19': '2.20.0', @@ -36,7 +33,6 @@ ext { ] shiros = [ - '5.16': '1.13.0', '5.17': '1.13.0', '5.18': '1.13.0', '5.19': '2.0.0', diff --git a/neo4j-adapter/src/main/java/org/neo4j/gds/compat/Neo4jVersionLookup.java b/neo4j-adapter/src/main/java/org/neo4j/gds/compat/Neo4jVersionLookup.java index 40cfc7fe5d..56160a3798 100644 --- a/neo4j-adapter/src/main/java/org/neo4j/gds/compat/Neo4jVersionLookup.java +++ b/neo4j-adapter/src/main/java/org/neo4j/gds/compat/Neo4jVersionLookup.java @@ -55,7 +55,7 @@ static Neo4jVersion findNeo4jVersion() { } private static final int SUPPORTED_MAJOR_VERSION = 5; - private static final int MIN_SUPPORTED_MINOR_VERSION = 16; + private static final int MIN_SUPPORTED_MINOR_VERSION = 17; @VisibleForTesting static Neo4jVersion parse(CharSequence version, String fullVersion) { diff --git a/neo4j-adapter/src/test/java/org/neo4j/gds/compat/Neo4jVersionLookupTest.java b/neo4j-adapter/src/test/java/org/neo4j/gds/compat/Neo4jVersionLookupTest.java index 434b3be74f..1957ab4a56 100644 --- a/neo4j-adapter/src/test/java/org/neo4j/gds/compat/Neo4jVersionLookupTest.java +++ b/neo4j-adapter/src/test/java/org/neo4j/gds/compat/Neo4jVersionLookupTest.java @@ -33,7 +33,6 @@ class Neo4jVersionLookupTest { @ParameterizedTest @CsvSource( { - "5.16.0, 5, 16", "5.17.0, 5, 17", "5.18.1, 5, 18", "5.19.0, 5, 19", @@ -103,7 +102,6 @@ void shouldNotRespectVersionOverride() { @ParameterizedTest @CsvSource( { - "5.16.0, 5, 16", "5.17.0, 5, 17", "5.18.1, 5, 18", "5.19.0, 5, 19", diff --git a/settings.gradle b/settings.gradle index 2399c22b96..fc7a2f38e3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -297,8 +297,6 @@ include('defaults-and-limits-configuration') project(':defaults-and-limits-configuration').projectDir = file('defaults-and-limits-configuration') -include('neo4j-kernel-adapter-5.16') -project(':neo4j-kernel-adapter-5.16').projectDir = file('compatibility/5.16/neo4j-kernel-adapter') include('neo4j-kernel-adapter-5.17') project(':neo4j-kernel-adapter-5.17').projectDir = file('compatibility/5.17/neo4j-kernel-adapter') diff --git a/test-utils/src/main/java/org/neo4j/gds/junit/annotation/Neo4jVersion.java b/test-utils/src/main/java/org/neo4j/gds/junit/annotation/Neo4jVersion.java index ca30c812b3..5a75341167 100644 --- a/test-utils/src/main/java/org/neo4j/gds/junit/annotation/Neo4jVersion.java +++ b/test-utils/src/main/java/org/neo4j/gds/junit/annotation/Neo4jVersion.java @@ -21,7 +21,6 @@ @SuppressWarnings("all") // squelch checkstyle public enum Neo4jVersion { - V_5_16(16), V_5_17(17), V_5_18(18), V_5_19(19),