Skip to content

Commit 5147d84

Browse files
authored
Merge pull request #6581 from jjaderberg/2.2-53compat
2.2 53compat
2 parents 6be9d9e + 62ff2d6 commit 5147d84

File tree

20 files changed

+317
-6
lines changed

20 files changed

+317
-6
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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._43;
21+
22+
import org.neo4j.collection.RawIterator;
23+
import org.neo4j.gds.annotation.SuppressForbidden;
24+
import org.neo4j.gds.compat.CompatCallableProcedure;
25+
import org.neo4j.internal.kernel.api.exceptions.ProcedureException;
26+
import org.neo4j.internal.kernel.api.procs.ProcedureSignature;
27+
import org.neo4j.kernel.api.ResourceTracker;
28+
import org.neo4j.kernel.api.procedure.CallableProcedure;
29+
import org.neo4j.kernel.api.procedure.Context;
30+
import org.neo4j.values.AnyValue;
31+
32+
@SuppressForbidden(reason = "This is the compat API")
33+
public final class CallableProcedureImpl implements CallableProcedure {
34+
private final CompatCallableProcedure procedure;
35+
36+
CallableProcedureImpl(CompatCallableProcedure procedure) {
37+
this.procedure = procedure;
38+
}
39+
40+
@Override
41+
public ProcedureSignature signature() {
42+
return this.procedure.signature();
43+
}
44+
45+
@Override
46+
public RawIterator<AnyValue[], ProcedureException> apply(
47+
Context ctx,
48+
AnyValue[] input,
49+
ResourceTracker resourceTracker
50+
) throws ProcedureException {
51+
return this.procedure.apply(ctx, input);
52+
}
53+
}

compatibility/4.3/neo4j-kernel-adapter/src/main/java/org/neo4j/gds/compat/_43/Neo4jProxyImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.neo4j.exceptions.KernelException;
3232
import org.neo4j.gds.annotation.SuppressForbidden;
3333
import org.neo4j.gds.compat.BoltTransactionRunner;
34+
import org.neo4j.gds.compat.CompatCallableProcedure;
3435
import org.neo4j.gds.compat.CompatExecutionMonitor;
3536
import org.neo4j.gds.compat.CompatIndexQuery;
3637
import org.neo4j.gds.compat.CompatInput;
@@ -100,6 +101,7 @@
100101
import org.neo4j.io.pagecache.tracing.PageCacheTracer;
101102
import org.neo4j.kernel.api.KernelTransaction;
102103
import org.neo4j.kernel.api.KernelTransactionHandle;
104+
import org.neo4j.kernel.api.procedure.CallableProcedure;
103105
import org.neo4j.kernel.database.NamedDatabaseId;
104106
import org.neo4j.kernel.database.TestDatabaseIdRepository;
105107
import org.neo4j.kernel.impl.index.schema.IndexImporterFactoryImpl;
@@ -749,6 +751,12 @@ public UserFunctionSignature userFunctionSignature(
749751
);
750752
}
751753

754+
@Override
755+
@SuppressForbidden(reason = "This is the compat API")
756+
public CallableProcedure callableProcedure(CompatCallableProcedure procedure) {
757+
return new CallableProcedureImpl(procedure);
758+
}
759+
752760
@Override
753761
public long transactionId(KernelTransactionHandle kernelTransactionHandle) {
754762
return kernelTransactionHandle.lastTransactionTimestampWhenStarted();
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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._44;
21+
22+
import org.neo4j.collection.RawIterator;
23+
import org.neo4j.gds.annotation.SuppressForbidden;
24+
import org.neo4j.gds.compat.CompatCallableProcedure;
25+
import org.neo4j.internal.kernel.api.exceptions.ProcedureException;
26+
import org.neo4j.internal.kernel.api.procs.ProcedureSignature;
27+
import org.neo4j.kernel.api.ResourceTracker;
28+
import org.neo4j.kernel.api.procedure.CallableProcedure;
29+
import org.neo4j.kernel.api.procedure.Context;
30+
import org.neo4j.values.AnyValue;
31+
32+
@SuppressForbidden(reason = "This is the compat API")
33+
public final class CallableProcedureImpl implements CallableProcedure {
34+
private final CompatCallableProcedure procedure;
35+
36+
CallableProcedureImpl(CompatCallableProcedure procedure) {
37+
this.procedure = procedure;
38+
}
39+
40+
@Override
41+
public ProcedureSignature signature() {
42+
return this.procedure.signature();
43+
}
44+
45+
@Override
46+
public RawIterator<AnyValue[], ProcedureException> apply(
47+
Context ctx,
48+
AnyValue[] input,
49+
ResourceTracker resourceTracker
50+
) throws ProcedureException {
51+
return this.procedure.apply(ctx, input);
52+
}
53+
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.neo4j.exceptions.KernelException;
3131
import org.neo4j.gds.annotation.SuppressForbidden;
3232
import org.neo4j.gds.compat.BoltTransactionRunner;
33+
import org.neo4j.gds.compat.CompatCallableProcedure;
3334
import org.neo4j.gds.compat.CompatExecutionMonitor;
3435
import org.neo4j.gds.compat.CompatIndexQuery;
3536
import org.neo4j.gds.compat.CompatInput;
@@ -101,6 +102,7 @@
101102
import org.neo4j.io.pagecache.tracing.PageCacheTracer;
102103
import org.neo4j.kernel.api.KernelTransaction;
103104
import org.neo4j.kernel.api.KernelTransactionHandle;
105+
import org.neo4j.kernel.api.procedure.CallableProcedure;
104106
import org.neo4j.kernel.database.NamedDatabaseId;
105107
import org.neo4j.kernel.database.NormalizedDatabaseName;
106108
import org.neo4j.kernel.database.TestDatabaseIdRepository;
@@ -752,6 +754,12 @@ public UserFunctionSignature userFunctionSignature(
752754
);
753755
}
754756

757+
@Override
758+
@SuppressForbidden(reason = "This is the compat API")
759+
public CallableProcedure callableProcedure(CompatCallableProcedure procedure) {
760+
return new CallableProcedureImpl(procedure);
761+
}
762+
755763
@Override
756764
public long transactionId(KernelTransactionHandle kernelTransactionHandle) {
757765
return kernelTransactionHandle.lastTransactionTimestampWhenStarted();

compatibility/5.1/neo4j-kernel-adapter/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = 'Neo4j Graph Data Science :: Neo4j Kernel Adapter 5.1'
55

66
group = 'org.neo4j.gds'
77

8-
// for 5.1.0-dev and all 5.x drops
8+
// for all 5.x versions
99
if (ver.'neo4j'.startsWith('5.')) {
1010
sourceSets {
1111
main {
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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._51;
21+
22+
import org.neo4j.collection.RawIterator;
23+
import org.neo4j.gds.annotation.SuppressForbidden;
24+
import org.neo4j.gds.compat.CompatCallableProcedure;
25+
import org.neo4j.internal.kernel.api.exceptions.ProcedureException;
26+
import org.neo4j.internal.kernel.api.procs.ProcedureSignature;
27+
import org.neo4j.kernel.api.ResourceTracker;
28+
import org.neo4j.kernel.api.procedure.CallableProcedure;
29+
import org.neo4j.kernel.api.procedure.Context;
30+
import org.neo4j.values.AnyValue;
31+
32+
@SuppressForbidden(reason = "This is the compat API")
33+
public final class CallableProcedureImpl implements CallableProcedure {
34+
private final CompatCallableProcedure procedure;
35+
36+
CallableProcedureImpl(CompatCallableProcedure procedure) {
37+
this.procedure = procedure;
38+
}
39+
40+
@Override
41+
public ProcedureSignature signature() {
42+
return this.procedure.signature();
43+
}
44+
45+
@Override
46+
public RawIterator<AnyValue[], ProcedureException> apply(
47+
Context ctx,
48+
AnyValue[] input,
49+
ResourceTracker resourceTracker
50+
) throws ProcedureException {
51+
return this.procedure.apply(ctx, input);
52+
}
53+
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.neo4j.exceptions.KernelException;
3434
import org.neo4j.gds.annotation.SuppressForbidden;
3535
import org.neo4j.gds.compat.BoltTransactionRunner;
36+
import org.neo4j.gds.compat.CompatCallableProcedure;
3637
import org.neo4j.gds.compat.CompatExecutionMonitor;
3738
import org.neo4j.gds.compat.CompatIndexQuery;
3839
import org.neo4j.gds.compat.CompatInput;
@@ -109,6 +110,7 @@
109110
import org.neo4j.io.pagecache.tracing.PageCacheTracer;
110111
import org.neo4j.kernel.api.KernelTransaction;
111112
import org.neo4j.kernel.api.KernelTransactionHandle;
113+
import org.neo4j.kernel.api.procedure.CallableProcedure;
112114
import org.neo4j.kernel.database.NamedDatabaseId;
113115
import org.neo4j.kernel.database.NormalizedDatabaseName;
114116
import org.neo4j.kernel.database.TestDatabaseIdRepository;
@@ -879,6 +881,12 @@ public long transactionId(KernelTransactionHandle kernelTransactionHandle) {
879881
return kernelTransactionHandle.getTransactionSequenceNumber();
880882
}
881883

884+
@Override
885+
@SuppressForbidden(reason = "This is the compat API")
886+
public CallableProcedure callableProcedure(CompatCallableProcedure procedure) {
887+
return new CallableProcedureImpl(procedure);
888+
}
889+
882890
@Override
883891
public void reserveNeo4jIds(IdGeneratorFactory generatorFactory, int size, CursorContext cursorContext) {
884892
IdGenerator idGenerator = generatorFactory.get(RecordIdType.NODE);

compatibility/5.2/neo4j-kernel-adapter/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = 'Neo4j Graph Data Science :: Neo4j Kernel Adapter 5.2'
55

66
group = 'org.neo4j.gds'
77

8-
// for 5.2.0 and all 5.x drops
8+
// for all 5.x versions
99
if (ver.'neo4j'.startsWith('5.')) {
1010
sourceSets {
1111
main {
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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._52;
21+
22+
import org.neo4j.collection.RawIterator;
23+
import org.neo4j.gds.annotation.SuppressForbidden;
24+
import org.neo4j.gds.compat.CompatCallableProcedure;
25+
import org.neo4j.internal.kernel.api.exceptions.ProcedureException;
26+
import org.neo4j.internal.kernel.api.procs.ProcedureSignature;
27+
import org.neo4j.kernel.api.ResourceTracker;
28+
import org.neo4j.kernel.api.procedure.CallableProcedure;
29+
import org.neo4j.kernel.api.procedure.Context;
30+
import org.neo4j.values.AnyValue;
31+
32+
@SuppressForbidden(reason = "This is the compat API")
33+
public final class CallableProcedureImpl implements CallableProcedure {
34+
private final CompatCallableProcedure procedure;
35+
36+
CallableProcedureImpl(CompatCallableProcedure procedure) {
37+
this.procedure = procedure;
38+
}
39+
40+
@Override
41+
public ProcedureSignature signature() {
42+
return this.procedure.signature();
43+
}
44+
45+
@Override
46+
public RawIterator<AnyValue[], ProcedureException> apply(
47+
Context ctx,
48+
AnyValue[] input,
49+
ResourceTracker resourceTracker
50+
) throws ProcedureException {
51+
return this.procedure.apply(ctx, input);
52+
}
53+
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.neo4j.exceptions.KernelException;
3434
import org.neo4j.gds.annotation.SuppressForbidden;
3535
import org.neo4j.gds.compat.BoltTransactionRunner;
36+
import org.neo4j.gds.compat.CompatCallableProcedure;
3637
import org.neo4j.gds.compat.CompatExecutionMonitor;
3738
import org.neo4j.gds.compat.CompatIndexQuery;
3839
import org.neo4j.gds.compat.CompatInput;
@@ -109,6 +110,7 @@
109110
import org.neo4j.io.pagecache.tracing.PageCacheTracer;
110111
import org.neo4j.kernel.api.KernelTransaction;
111112
import org.neo4j.kernel.api.KernelTransactionHandle;
113+
import org.neo4j.kernel.api.procedure.CallableProcedure;
112114
import org.neo4j.kernel.database.NamedDatabaseId;
113115
import org.neo4j.kernel.database.NormalizedDatabaseName;
114116
import org.neo4j.kernel.database.TestDatabaseIdRepository;
@@ -872,6 +874,12 @@ public UserFunctionSignature userFunctionSignature(
872874
);
873875
}
874876

877+
@Override
878+
@SuppressForbidden(reason = "This is the compat API")
879+
public CallableProcedure callableProcedure(CompatCallableProcedure procedure) {
880+
return new CallableProcedureImpl(procedure);
881+
}
882+
875883
@Override
876884
public long transactionId(KernelTransactionHandle kernelTransactionHandle) {
877885
return kernelTransactionHandle.getTransactionSequenceNumber();

0 commit comments

Comments
 (0)