Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lassewesth committed Aug 16, 2024
1 parent db066b9 commit ff1fc09
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.neo4j.gds.core.utils.warnings.UserLogRegistryFactory;
import org.neo4j.gds.core.write.NodePropertyExporterBuilder;
import org.neo4j.gds.core.write.RelationshipExporterBuilder;
import org.neo4j.gds.core.write.RelationshipStreamExporterBuilder;
import org.neo4j.gds.logging.Log;
import org.neo4j.gds.metrics.MetricsFacade;
import org.neo4j.gds.procedures.algorithms.AlgorithmsProcedureFacade;
Expand Down Expand Up @@ -76,9 +75,6 @@ public interface ExecutionContext {
@Nullable
AlgorithmsProcedureFacade algorithmsProcedureFacade();

@Nullable
RelationshipStreamExporterBuilder relationshipStreamExporterBuilder();

@Nullable
RelationshipExporterBuilder relationshipExporterBuilder();

Expand All @@ -93,14 +89,6 @@ default ExecutionContext withNodePropertyExporterBuilder(NodePropertyExporterBui
.build();
}

default ExecutionContext withRelationshipStreamExporterBuilder(RelationshipStreamExporterBuilder relationshipStreamExporterBuilder) {
return ImmutableExecutionContext
.builder()
.from(this)
.relationshipStreamExporterBuilder(relationshipStreamExporterBuilder)
.build();
}

default ExecutionContext withRelationshipExporterBuilder(RelationshipExporterBuilder relationshipExporterBuilder) {
return ImmutableExecutionContext
.builder()
Expand Down Expand Up @@ -182,19 +170,13 @@ public boolean isGdsAdmin() {
@Override
public MetricsFacade metricsFacade() {
return MetricsFacade.PASSTHROUGH_METRICS_FACADE;

}

@Override
public AlgorithmsProcedureFacade algorithmsProcedureFacade() {
return null;
}

@Override
public @Nullable RelationshipStreamExporterBuilder relationshipStreamExporterBuilder() {
return null;
}

@Override
public @Nullable RelationshipExporterBuilder relationshipExporterBuilder() {
return null;
Expand Down
31 changes: 1 addition & 30 deletions proc/common/src/main/java/org/neo4j/gds/BaseProc.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,18 @@
package org.neo4j.gds;

import org.neo4j.gds.api.DatabaseId;
import org.neo4j.gds.applications.graphstorecatalog.GraphStoreFromCatalogLoader;
import org.neo4j.gds.compat.GraphDatabaseApiProxy;
import org.neo4j.gds.config.BaseConfig;
import org.neo4j.gds.core.CypherMapAccess;
import org.neo4j.gds.core.Username;
import org.neo4j.gds.core.loading.GraphStoreCatalogEntry;
import org.neo4j.gds.core.utils.progress.TaskRegistryFactory;
import org.neo4j.gds.core.utils.warnings.UserLogRegistryFactory;
import org.neo4j.gds.executor.ExecutionContext;
import org.neo4j.gds.executor.ImmutableExecutionContext;
import org.neo4j.gds.logging.LogAdapter;
import org.neo4j.gds.metrics.MetricsFacade;
import org.neo4j.gds.procedures.GraphDataScienceProcedures;
import org.neo4j.gds.procedures.ProcedureCallContextReturnColumns;
import org.neo4j.gds.procedures.TransactionCloseableResourceRegistry;
import org.neo4j.gds.procedures.TransactionNodeLookup;
import org.neo4j.gds.logging.LogAdapter;
import org.neo4j.gds.procedures.integration.TransactionTerminationMonitor;
import org.neo4j.gds.transaction.DatabaseTransactionContext;
import org.neo4j.gds.transaction.EmptyTransactionContext;
Expand All @@ -48,8 +44,6 @@
import org.neo4j.logging.Log;
import org.neo4j.procedure.Context;

import java.util.function.Supplier;

public abstract class BaseProc {

public static final String ESTIMATE_DESCRIPTION = "Returns an estimation of the memory consumption for that procedure.";
Expand Down Expand Up @@ -88,16 +82,6 @@ protected String username() {
return username.username();
}

protected GraphStoreCatalogEntry graphStoreFromCatalog(String graphName, BaseConfig config) {
return GraphStoreFromCatalogLoader.graphStoreFromCatalog(
graphName,
config,
username(),
databaseId(),
isGdsAdmin()
);
}

protected boolean isGdsAdmin() {
if (transaction == null) {
// No transaction available (likely we're in a test), no-one is admin here
Expand All @@ -109,19 +93,6 @@ protected boolean isGdsAdmin() {
return transaction.securityContext().roles().contains(PREDEFINED_ADMIN_ROLE);
}

protected final <R> R runWithExceptionLogging(String message, Supplier<R> supplier) {
try {
return supplier.get();
} catch (Exception e) {
log.warn(message, e);
throw e;
}
}

protected final void validateConfig(CypherMapAccess cypherConfig, BaseConfig config) {
cypherConfig.requireOnlyKeysFrom(config.configKeys());
}

public ExecutionContext executionContext() {
return databaseService == null
? ExecutionContext.EMPTY
Expand Down
55 changes: 0 additions & 55 deletions proc/test/src/test/java/org/neo4j/gds/BaseProcUnitTest.java

This file was deleted.

0 comments on commit ff1fc09

Please sign in to comment.