Skip to content

Commit

Permalink
Merge pull request #9119 from soerenreichardt/fix-dev
Browse files Browse the repository at this point in the history
Fix dev
  • Loading branch information
soerenreichardt authored Jun 3, 2024
2 parents 621d2b1 + a5d228b commit 03a5559
Show file tree
Hide file tree
Showing 9 changed files with 158 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@
*/
package org.neo4j.gds.compat._515;

import org.neo4j.gds.compat.GlobalProcedureRegistry;
import org.neo4j.gds.compat.Neo4jProxyApi;
import org.neo4j.internal.kernel.api.Read;
import org.neo4j.internal.kernel.api.procs.ProcedureSignature;
import org.neo4j.internal.kernel.api.procs.UserFunctionSignature;
import org.neo4j.kernel.api.procedure.GlobalProcedures;

import java.util.stream.Stream;

public final class Neo4jProxyImpl implements Neo4jProxyApi {

Expand All @@ -33,4 +39,24 @@ public long estimateNodeCount(Read read, int label) {
public long estimateRelationshipCount(Read read, int sourceLabel, int targetLabel, int type) {
return read.estimateCountsForRelationships(sourceLabel, type, targetLabel);
}

@Override
public GlobalProcedureRegistry globalProcedureRegistry(GlobalProcedures globalProcedures) {
return new GlobalProcedureRegistry() {
@Override
public Stream<ProcedureSignature> getAllProcedures() {
return globalProcedures.getCurrentView().getAllProcedures().stream();
}

@Override
public Stream<UserFunctionSignature> getAllNonAggregatingFunctions() {
return globalProcedures.getCurrentView().getAllNonAggregatingFunctions();
}

@Override
public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
return globalProcedures.getCurrentView().getAllAggregatingFunctions();
}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@
*/
package org.neo4j.gds.compat._516;

import org.neo4j.gds.compat.GlobalProcedureRegistry;
import org.neo4j.gds.compat.Neo4jProxyApi;
import org.neo4j.internal.kernel.api.Read;
import org.neo4j.internal.kernel.api.procs.ProcedureSignature;
import org.neo4j.internal.kernel.api.procs.UserFunctionSignature;
import org.neo4j.kernel.api.procedure.GlobalProcedures;

import java.util.stream.Stream;

public final class Neo4jProxyImpl implements Neo4jProxyApi {

Expand All @@ -33,4 +39,24 @@ public long estimateNodeCount(Read read, int label) {
public long estimateRelationshipCount(Read read, int sourceLabel, int targetLabel, int type) {
return read.estimateCountsForRelationships(sourceLabel, type, targetLabel);
}

@Override
public GlobalProcedureRegistry globalProcedureRegistry(GlobalProcedures globalProcedures) {
return new GlobalProcedureRegistry() {
@Override
public Stream<ProcedureSignature> getAllProcedures() {
return globalProcedures.getCurrentView().getAllProcedures().stream();
}

@Override
public Stream<UserFunctionSignature> getAllNonAggregatingFunctions() {
return globalProcedures.getCurrentView().getAllNonAggregatingFunctions();
}

@Override
public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
return globalProcedures.getCurrentView().getAllAggregatingFunctions();
}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@
*/
package org.neo4j.gds.compat._517;

import org.neo4j.gds.compat.GlobalProcedureRegistry;
import org.neo4j.gds.compat.Neo4jProxyApi;
import org.neo4j.internal.kernel.api.Read;
import org.neo4j.internal.kernel.api.procs.ProcedureSignature;
import org.neo4j.internal.kernel.api.procs.UserFunctionSignature;
import org.neo4j.kernel.api.procedure.GlobalProcedures;

import java.util.stream.Stream;

public final class Neo4jProxyImpl implements Neo4jProxyApi {

Expand All @@ -33,4 +39,24 @@ public long estimateNodeCount(Read read, int label) {
public long estimateRelationshipCount(Read read, int sourceLabel, int targetLabel, int type) {
return read.estimateCountsForRelationships(sourceLabel, type, targetLabel);
}

@Override
public GlobalProcedureRegistry globalProcedureRegistry(GlobalProcedures globalProcedures) {
return new GlobalProcedureRegistry() {
@Override
public Stream<ProcedureSignature> getAllProcedures() {
return globalProcedures.getCurrentView().getAllProcedures().stream();
}

@Override
public Stream<UserFunctionSignature> getAllNonAggregatingFunctions() {
return globalProcedures.getCurrentView().getAllNonAggregatingFunctions();
}

@Override
public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
return globalProcedures.getCurrentView().getAllAggregatingFunctions();
}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,21 @@

import org.neo4j.configuration.Config;
import org.neo4j.gds.compat.CompatMonitor;
import org.neo4j.gds.compat.GlobalProcedureRegistry;
import org.neo4j.gds.compat.Neo4jProxyApi;
import org.neo4j.internal.batchimport.AdditionalInitialIds;
import org.neo4j.internal.batchimport.BatchImporter;
import org.neo4j.internal.batchimport.Configuration;
import org.neo4j.internal.batchimport.Monitor;
import org.neo4j.internal.batchimport.input.Collector;
import org.neo4j.internal.kernel.api.Read;
import org.neo4j.internal.kernel.api.procs.ProcedureSignature;
import org.neo4j.internal.kernel.api.procs.UserFunctionSignature;
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.api.procedure.GlobalProcedures;
import org.neo4j.kernel.impl.index.schema.IndexImporterFactoryImpl;
import org.neo4j.kernel.impl.transaction.log.files.TransactionLogInitializer;
import org.neo4j.logging.internal.LogService;
Expand All @@ -41,6 +45,7 @@

import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.util.stream.Stream;

public final class Neo4jProxyImpl implements Neo4jProxyApi {

Expand Down Expand Up @@ -109,4 +114,24 @@ public void completed(boolean success) {
}
};
}

@Override
public GlobalProcedureRegistry globalProcedureRegistry(GlobalProcedures globalProcedures) {
return new GlobalProcedureRegistry() {
@Override
public Stream<ProcedureSignature> getAllProcedures() {
return globalProcedures.getCurrentView().getAllProcedures().stream();
}

@Override
public Stream<UserFunctionSignature> getAllNonAggregatingFunctions() {
return globalProcedures.getCurrentView().getAllNonAggregatingFunctions();
}

@Override
public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
return globalProcedures.getCurrentView().getAllAggregatingFunctions();
}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,21 @@

import org.neo4j.configuration.Config;
import org.neo4j.gds.compat.CompatMonitor;
import org.neo4j.gds.compat.GlobalProcedureRegistry;
import org.neo4j.gds.compat.Neo4jProxyApi;
import org.neo4j.internal.batchimport.AdditionalInitialIds;
import org.neo4j.internal.batchimport.BatchImporter;
import org.neo4j.internal.batchimport.Configuration;
import org.neo4j.internal.batchimport.Monitor;
import org.neo4j.internal.batchimport.input.Collector;
import org.neo4j.internal.kernel.api.Read;
import org.neo4j.internal.kernel.api.procs.ProcedureSignature;
import org.neo4j.internal.kernel.api.procs.UserFunctionSignature;
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.api.procedure.GlobalProcedures;
import org.neo4j.kernel.impl.index.schema.IndexImporterFactoryImpl;
import org.neo4j.kernel.impl.transaction.log.files.TransactionLogInitializer;
import org.neo4j.logging.internal.LogService;
Expand All @@ -41,6 +45,7 @@

import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.util.stream.Stream;

public final class Neo4jProxyImpl implements Neo4jProxyApi {

Expand Down Expand Up @@ -109,4 +114,24 @@ public void completed(boolean success) {
}
};
}

@Override
public GlobalProcedureRegistry globalProcedureRegistry(GlobalProcedures globalProcedures) {
return new GlobalProcedureRegistry() {
@Override
public Stream<ProcedureSignature> getAllProcedures() {
return globalProcedures.getCurrentView().getAllProcedures().stream();
}

@Override
public Stream<UserFunctionSignature> getAllNonAggregatingFunctions() {
return globalProcedures.getCurrentView().getAllNonAggregatingFunctions();
}

@Override
public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
return globalProcedures.getCurrentView().getAllAggregatingFunctions();
}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,22 @@

import org.neo4j.configuration.Config;
import org.neo4j.gds.compat.CompatMonitor;
import org.neo4j.gds.compat.GlobalProcedureRegistry;
import org.neo4j.gds.compat.Neo4jProxyApi;
import org.neo4j.internal.batchimport.AdditionalInitialIds;
import org.neo4j.internal.batchimport.BatchImporter;
import org.neo4j.internal.batchimport.Configuration;
import org.neo4j.internal.batchimport.Monitor;
import org.neo4j.internal.batchimport.input.Collector;
import org.neo4j.internal.kernel.api.Read;
import org.neo4j.internal.kernel.api.procs.ProcedureSignature;
import org.neo4j.internal.kernel.api.procs.UserFunctionSignature;
import org.neo4j.io.fs.FileSystemAbstraction;
import org.neo4j.io.layout.DatabaseLayout;
import org.neo4j.io.pagecache.context.CursorContextFactory;
import org.neo4j.io.pagecache.context.FixedVersionContextSupplier;
import org.neo4j.io.pagecache.tracing.PageCacheTracer;
import org.neo4j.kernel.api.procedure.GlobalProcedures;
import org.neo4j.kernel.impl.index.schema.IndexImporterFactoryImpl;
import org.neo4j.kernel.impl.transaction.log.files.TransactionLogInitializer;
import org.neo4j.logging.internal.LogService;
Expand All @@ -43,6 +47,7 @@
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.util.Optional;
import java.util.stream.Stream;

public final class Neo4jProxyImpl implements Neo4jProxyApi {

Expand Down Expand Up @@ -118,4 +123,24 @@ public void completed(boolean success) {
}
};
}

@Override
public GlobalProcedureRegistry globalProcedureRegistry(GlobalProcedures globalProcedures) {
return new GlobalProcedureRegistry() {
@Override
public Stream<ProcedureSignature> getAllProcedures() {
return globalProcedures.getCurrentView().getAllProcedures().stream();
}

@Override
public Stream<UserFunctionSignature> getAllNonAggregatingFunctions() {
return globalProcedures.getCurrentView().getAllNonAggregatingFunctions();
}

@Override
public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
return globalProcedures.getCurrentView().getAllAggregatingFunctions();
}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
import org.neo4j.internal.kernel.api.procs.ProcedureSignature;
import org.neo4j.internal.kernel.api.procs.UserFunctionSignature;

import java.util.Set;
import java.util.stream.Stream;

public interface GlobalProcedureRegistry {
Set<ProcedureSignature> getAllProcedures();
Stream<ProcedureSignature> getAllProcedures();
Stream<UserFunctionSignature> getAllNonAggregatingFunctions();
Stream<UserFunctionSignature> getAllAggregatingFunctions();
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.neo4j.io.fs.FileSystemAbstraction;
import org.neo4j.io.layout.DatabaseLayout;
import org.neo4j.io.pagecache.tracing.PageCacheTracer;
import org.neo4j.kernel.api.procedure.GlobalProcedures;
import org.neo4j.logging.internal.LogService;
import org.neo4j.scheduler.JobScheduler;

Expand All @@ -54,4 +55,6 @@ default BatchImporter instantiateBlockBatchImporter(
) {
throw new UnsupportedOperationException("GDS does not support block store format batch importer on this Neo4j version. Requires >= Neo4j 5.18.");
}

GlobalProcedureRegistry globalProcedureRegistry(GlobalProcedures globalProcedures);
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@
import java.util.Locale;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Stream;

import static java.lang.String.format;
import static org.neo4j.gds.compat.InternalReadOps.countByIdGenerator;
Expand Down Expand Up @@ -226,22 +224,7 @@ public static <T> T lookupComponentProvider(Context ctx, Class<T> component, boo
}

public static GlobalProcedureRegistry globalProcedureRegistry(GlobalProcedures globalProcedures) {
return new GlobalProcedureRegistry() {
@Override
public Set<ProcedureSignature> getAllProcedures() {
return globalProcedures.getCurrentView().getAllProcedures();
}

@Override
public Stream<UserFunctionSignature> getAllNonAggregatingFunctions() {
return globalProcedures.getCurrentView().getAllNonAggregatingFunctions();
}

@Override
public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
return globalProcedures.getCurrentView().getAllAggregatingFunctions();
}
};
return IMPL.globalProcedureRegistry(globalProcedures);
}

public static String validateExternalDatabaseName(String databaseName) {
Expand Down

0 comments on commit 03a5559

Please sign in to comment.