Skip to content

Commit 2c4c5ed

Browse files
authored
Merge pull request #6907 from jjaderberg/2.3-compat
2.3 Publish 5.4 compat
2 parents 1575cae + dd77e7e commit 2c4c5ed

File tree

60 files changed

+5013
-27
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+5013
-27
lines changed

build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,15 @@ ext {
3131
project(':neo4j-kernel-adapter-4.4'),
3232
project(':neo4j-kernel-adapter-5.1'),
3333
project(':neo4j-kernel-adapter-5.2'),
34+
project(':neo4j-kernel-adapter-5.3'),
35+
project(':neo4j-kernel-adapter-5.4'),
3436
],
3537
'storage-engine-adapter': [
3638
project(':storage-engine-adapter-4.4'),
3739
project(':storage-engine-adapter-5.1'),
3840
project(':storage-engine-adapter-5.2'),
41+
project(':storage-engine-adapter-5.3'),
42+
project(':storage-engine-adapter-5.4'),
3943
]
4044
]
4145
}

compatibility/4.4/neo4j-kernel-adapter/src/main/java/org/neo4j/gds/compat/_44/Neo4jProxyImpl.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@
108108
import org.neo4j.kernel.database.NamedDatabaseId;
109109
import org.neo4j.kernel.database.NormalizedDatabaseName;
110110
import org.neo4j.kernel.database.TestDatabaseIdRepository;
111+
import org.neo4j.kernel.impl.coreapi.InternalTransaction;
111112
import org.neo4j.kernel.impl.index.schema.IndexImporterFactoryImpl;
113+
import org.neo4j.kernel.impl.query.TransactionalContext;
114+
import org.neo4j.kernel.impl.query.TransactionalContextFactory;
112115
import org.neo4j.kernel.impl.store.MetaDataStore;
113116
import org.neo4j.kernel.impl.store.RecordStore;
114117
import org.neo4j.kernel.impl.store.format.RecordFormatSelector;
@@ -124,6 +127,7 @@
124127
import org.neo4j.storageengine.api.PropertySelection;
125128
import org.neo4j.values.storable.ValueCategory;
126129
import org.neo4j.values.storable.ValueGroup;
130+
import org.neo4j.values.virtual.MapValue;
127131

128132
import java.io.IOException;
129133
import java.nio.file.Path;
@@ -785,5 +789,13 @@ public void reserveNeo4jIds(IdGeneratorFactory generatorFactory, int size, Curso
785789

786790
idGenerator.nextConsecutiveIdRange(size, false, cursorContext);
787791
}
788-
792+
@Override
793+
public TransactionalContext newQueryContext(
794+
TransactionalContextFactory contextFactory,
795+
InternalTransaction tx,
796+
String queryText,
797+
MapValue queryParameters
798+
) {
799+
return contextFactory.newContext(tx, queryText, queryParameters);
800+
}
789801
}

compatibility/5.1/neo4j-kernel-adapter/src/main/java17/org/neo4j/gds/compat/_51/Neo4jProxyImpl.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@
116116
import org.neo4j.kernel.database.NamedDatabaseId;
117117
import org.neo4j.kernel.database.NormalizedDatabaseName;
118118
import org.neo4j.kernel.database.TestDatabaseIdRepository;
119+
import org.neo4j.kernel.impl.coreapi.InternalTransaction;
119120
import org.neo4j.kernel.impl.index.schema.IndexImporterFactoryImpl;
121+
import org.neo4j.kernel.impl.query.TransactionalContext;
122+
import org.neo4j.kernel.impl.query.TransactionalContextFactory;
120123
import org.neo4j.kernel.impl.store.RecordStore;
121124
import org.neo4j.kernel.impl.store.format.RecordFormatSelector;
122125
import org.neo4j.kernel.impl.store.format.RecordFormats;
@@ -134,6 +137,7 @@
134137
import org.neo4j.util.Bits;
135138
import org.neo4j.values.storable.ValueCategory;
136139
import org.neo4j.values.storable.Values;
140+
import org.neo4j.values.virtual.MapValue;
137141

138142
import java.io.IOException;
139143
import java.nio.file.Path;
@@ -908,5 +912,13 @@ public void reserveNeo4jIds(IdGeneratorFactory generatorFactory, int size, Curso
908912

909913
idGenerator.nextConsecutiveIdRange(size, false, cursorContext);
910914
}
911-
915+
@Override
916+
public TransactionalContext newQueryContext(
917+
TransactionalContextFactory contextFactory,
918+
InternalTransaction tx,
919+
String queryText,
920+
MapValue queryParameters
921+
) {
922+
return contextFactory.newContext(tx, queryText, queryParameters);
923+
}
912924
}

compatibility/5.2/neo4j-kernel-adapter/src/main/java17/org/neo4j/gds/compat/_52/Neo4jProxyImpl.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@
116116
import org.neo4j.kernel.database.NamedDatabaseId;
117117
import org.neo4j.kernel.database.NormalizedDatabaseName;
118118
import org.neo4j.kernel.database.TestDatabaseIdRepository;
119+
import org.neo4j.kernel.impl.coreapi.InternalTransaction;
119120
import org.neo4j.kernel.impl.index.schema.IndexImporterFactoryImpl;
121+
import org.neo4j.kernel.impl.query.TransactionalContext;
122+
import org.neo4j.kernel.impl.query.TransactionalContextFactory;
120123
import org.neo4j.kernel.impl.store.RecordStore;
121124
import org.neo4j.kernel.impl.store.format.RecordFormatSelector;
122125
import org.neo4j.kernel.impl.store.format.RecordFormats;
@@ -134,6 +137,7 @@
134137
import org.neo4j.util.Bits;
135138
import org.neo4j.values.storable.ValueCategory;
136139
import org.neo4j.values.storable.Values;
140+
import org.neo4j.values.virtual.MapValue;
137141

138142
import java.io.IOException;
139143
import java.nio.file.Path;
@@ -906,5 +910,13 @@ public void reserveNeo4jIds(IdGeneratorFactory generatorFactory, int size, Curso
906910

907911
idGenerator.nextConsecutiveIdRange(size, false, cursorContext);
908912
}
909-
913+
@Override
914+
public TransactionalContext newQueryContext(
915+
TransactionalContextFactory contextFactory,
916+
InternalTransaction tx,
917+
String queryText,
918+
MapValue queryParameters
919+
) {
920+
return contextFactory.newContext(tx, queryText, queryParameters);
921+
}
910922
}

compatibility/5.3/neo4j-kernel-adapter/src/main/java17/org/neo4j/gds/compat/_53/Neo4jProxyImpl.java

+13
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@
116116
import org.neo4j.kernel.database.NamedDatabaseId;
117117
import org.neo4j.kernel.database.NormalizedDatabaseName;
118118
import org.neo4j.kernel.database.TestDatabaseIdRepository;
119+
import org.neo4j.kernel.impl.coreapi.InternalTransaction;
119120
import org.neo4j.kernel.impl.index.schema.IndexImporterFactoryImpl;
121+
import org.neo4j.kernel.impl.query.TransactionalContext;
122+
import org.neo4j.kernel.impl.query.TransactionalContextFactory;
120123
import org.neo4j.kernel.impl.store.RecordStore;
121124
import org.neo4j.kernel.impl.store.format.RecordFormatSelector;
122125
import org.neo4j.kernel.impl.store.format.RecordFormats;
@@ -134,6 +137,7 @@
134137
import org.neo4j.util.Bits;
135138
import org.neo4j.values.storable.ValueCategory;
136139
import org.neo4j.values.storable.Values;
140+
import org.neo4j.values.virtual.MapValue;
137141

138142
import java.io.IOException;
139143
import java.nio.file.Path;
@@ -907,4 +911,13 @@ public void reserveNeo4jIds(IdGeneratorFactory generatorFactory, int size, Curso
907911
idGenerator.nextConsecutiveIdRange(size, false, cursorContext);
908912
}
909913

914+
@Override
915+
public TransactionalContext newQueryContext(
916+
TransactionalContextFactory contextFactory,
917+
InternalTransaction tx,
918+
String queryText,
919+
MapValue queryParameters
920+
) {
921+
return contextFactory.newContext(tx, queryText, queryParameters);
922+
}
910923
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
apply plugin: 'java-library'
2+
apply plugin: 'me.champeau.mrjar'
3+
4+
description = 'Neo4j Graph Data Science :: Neo4j Kernel Adapter 5.4'
5+
6+
group = 'org.neo4j.gds'
7+
8+
// for all 5.x versions
9+
if (ver.'neo4j'.startsWith('5.')) {
10+
sourceSets {
11+
main {
12+
java {
13+
srcDirs = ['src/main/java17']
14+
}
15+
}
16+
}
17+
18+
dependencies {
19+
annotationProcessor project(':annotations')
20+
annotationProcessor group: 'org.immutables', name: 'value', version: ver.'immutables'
21+
annotationProcessor group: 'org.neo4j', name: 'annotations', version: neos.'5.4'
22+
23+
compileOnly project(':annotations')
24+
compileOnly group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: ver.'spotbugsToolVersion'
25+
compileOnly group: 'org.immutables', name: 'value-annotations', version: ver.'immutables'
26+
compileOnly group: 'org.neo4j', name: 'annotations', version: neos.'5.4'
27+
compileOnly group: 'org.neo4j', name: 'neo4j', version: neos.'5.4'
28+
compileOnly group: 'org.neo4j', name: 'neo4j-record-storage-engine', version: neos.'5.4'
29+
compileOnly group: 'org.neo4j.community', name: 'it-test-support', version: neos.'5.4'
30+
31+
implementation project(':neo4j-kernel-adapter-api')
32+
}
33+
} else {
34+
multiRelease {
35+
targetVersions 11, 17
36+
}
37+
38+
if (!project.hasProperty('no-forbidden-apis')) {
39+
forbiddenApisJava17 {
40+
exclude('**')
41+
}
42+
}
43+
44+
dependencies {
45+
annotationProcessor group: 'org.neo4j', name: 'annotations', version: ver.'neo4j'
46+
compileOnly group: 'org.neo4j', name: 'annotations', version: ver.'neo4j'
47+
48+
implementation project(':neo4j-kernel-adapter-api')
49+
50+
java17AnnotationProcessor project(':annotations')
51+
java17AnnotationProcessor group: 'org.immutables', name: 'value', version: ver.'immutables'
52+
java17AnnotationProcessor group: 'org.neo4j', name: 'annotations', version: neos.'5.4'
53+
54+
java17CompileOnly project(':annotations')
55+
java17CompileOnly group: 'org.immutables', name: 'value-annotations', version: ver.'immutables'
56+
java17CompileOnly group: 'org.neo4j', name: 'neo4j', version: neos.'5.4'
57+
java17CompileOnly group: 'org.neo4j', name: 'neo4j-record-storage-engine', version: neos.'5.4'
58+
java17CompileOnly group: 'org.neo4j.community', name: 'it-test-support', version: neos.'5.4'
59+
java17CompileOnly group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: ver.'spotbugsToolVersion'
60+
61+
java17Implementation project(':neo4j-kernel-adapter-api')
62+
}
63+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) "Neo4j"
3+
* Neo4j Sweden AB [http://neo4j.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Neo4j is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
package org.neo4j.gds.compat._54;
21+
22+
import org.neo4j.annotations.service.ServiceProvider;
23+
import org.neo4j.gds.compat.Neo4jProxyApi;
24+
import org.neo4j.gds.compat.Neo4jProxyFactory;
25+
import org.neo4j.gds.compat.Neo4jVersion;
26+
27+
@ServiceProvider
28+
public final class Neo4jProxyFactoryImpl implements Neo4jProxyFactory {
29+
30+
@Override
31+
public boolean canLoad(Neo4jVersion version) {
32+
return false;
33+
}
34+
35+
@Override
36+
public Neo4jProxyApi load() {
37+
throw new UnsupportedOperationException("5.4 compatibility requires JDK17");
38+
}
39+
40+
@Override
41+
public String description() {
42+
return "Neo4j 5.4 (placeholder)";
43+
}
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) "Neo4j"
3+
* Neo4j Sweden AB [http://neo4j.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Neo4j is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
package org.neo4j.gds.compat._54;
21+
22+
import org.neo4j.annotations.service.ServiceProvider;
23+
import org.neo4j.gds.compat.Neo4jVersion;
24+
import org.neo4j.gds.compat.SettingProxyApi;
25+
import org.neo4j.gds.compat.SettingProxyFactory;
26+
27+
@ServiceProvider
28+
public final class SettingProxyFactoryImpl implements SettingProxyFactory {
29+
30+
@Override
31+
public boolean canLoad(Neo4jVersion version) {
32+
return false;
33+
}
34+
35+
@Override
36+
public SettingProxyApi load() {
37+
throw new UnsupportedOperationException("5.4 compatibility requires JDK17");
38+
}
39+
40+
@Override
41+
public String description() {
42+
return "Neo4j Settings 5.4 (placeholder)";
43+
}
44+
}

0 commit comments

Comments
 (0)