Skip to content

Commit

Permalink
Merge pull request #8121 from knutwalker/2.4-rc-compat-3
Browse files Browse the repository at this point in the history
Update RC compat
  • Loading branch information
yuvalr1neo authored Sep 12, 2023
2 parents 59a2d2f + 756ae79 commit 32bc9fe
Show file tree
Hide file tree
Showing 28 changed files with 255 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -836,4 +836,21 @@ public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
}
};
}

private static final DependencyResolver EMPTY_DEPENDENCY_RESOLVER = new DependencyResolver.Adapter() {
@Override
public <T> T resolveDependency(Class<T> type, SelectionStrategy selector) {
return null;
}

@Override
public boolean containsDependency(Class<?> type) {
return false;
}
};

@Override
public DependencyResolver emptyDependencyResolver() {
return EMPTY_DEPENDENCY_RESOLVER;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -953,4 +953,21 @@ public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
}
};
}

private static final DependencyResolver EMPTY_DEPENDENCY_RESOLVER = new DependencyResolver.Adapter() {
@Override
public <T> T resolveDependency(Class<T> type, DependencyResolver.SelectionStrategy selector) {
return null;
}

@Override
public boolean containsDependency(Class<?> type) {
return false;
}
};

@Override
public DependencyResolver emptyDependencyResolver() {
return EMPTY_DEPENDENCY_RESOLVER;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -948,4 +948,21 @@ public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
}
};
}

private static final DependencyResolver EMPTY_DEPENDENCY_RESOLVER = new DependencyResolver.Adapter() {
@Override
public <T> T resolveDependency(Class<T> type, SelectionStrategy selector) {
return null;
}

@Override
public boolean containsDependency(Class<?> type) {
return false;
}
};

@Override
public DependencyResolver emptyDependencyResolver() {
return EMPTY_DEPENDENCY_RESOLVER;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,11 @@ public String versionLongToString(long storeVersion) {
Bits bits = Bits.bitsFromLongs(new long[]{storeVersion});
int length = bits.getShort(8);
if (length == 0 || length > 7) {
throw new IllegalArgumentException(format(Locale.ENGLISH, "The read version string length %d is not proper.", length));
throw new IllegalArgumentException(format(
Locale.ENGLISH,
"The read version string length %d is not proper.",
length
));
}
char[] result = new char[length];
for (int i = 0; i < length; i++) {
Expand Down Expand Up @@ -925,7 +929,10 @@ public boolean isCompositeDatabase(GraphDatabaseService databaseService) {

@Override
public <T> T lookupComponentProvider(Context ctx, Class<T> component, boolean safe) throws ProcedureException {
var globalProcedures = GraphDatabaseApiProxy.resolveDependency(ctx.dependencyResolver(), GlobalProcedures.class);
var globalProcedures = GraphDatabaseApiProxy.resolveDependency(
ctx.dependencyResolver(),
GlobalProcedures.class
);
return globalProcedures.getCurrentView().lookupComponentProvider(component, safe).apply(ctx);
}

Expand All @@ -948,4 +955,21 @@ public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
}
};
}

private static final DependencyResolver EMPTY_DEPENDENCY_RESOLVER = new DependencyResolver.Adapter() {
@Override
public <T> T resolveDependency(Class<T> type, SelectionStrategy selector) {
return null;
}

@Override
public boolean containsDependency(Class<?> type) {
return false;
}
};

@Override
public DependencyResolver emptyDependencyResolver() {
return EMPTY_DEPENDENCY_RESOLVER;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -947,4 +947,21 @@ public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
}
};
}

private static final DependencyResolver EMPTY_DEPENDENCY_RESOLVER = new DependencyResolver() {
@Override
public <T> T resolveDependency(Class<T> type, SelectionStrategy selector) {
return null;
}

@Override
public boolean containsDependency(Class<?> type) {
return false;
}
};

@Override
public DependencyResolver emptyDependencyResolver() {
return EMPTY_DEPENDENCY_RESOLVER;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -951,4 +951,21 @@ public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
}
};
}

private static final DependencyResolver EMPTY_DEPENDENCY_RESOLVER = new DependencyResolver.Adapter() {
@Override
public <T> T resolveDependency(Class<T> type, DependencyResolver.SelectionStrategy selector) {
return null;
}

@Override
public boolean containsDependency(Class<?> type) {
return false;
}
};

@Override
public DependencyResolver emptyDependencyResolver() {
return EMPTY_DEPENDENCY_RESOLVER;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -952,4 +952,21 @@ public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
}
};
}

private static final DependencyResolver EMPTY_DEPENDENCY_RESOLVER = new DependencyResolver.Adapter() {
@Override
public <T> T resolveDependency(Class<T> type, DependencyResolver.SelectionStrategy selector) {
return null;
}

@Override
public boolean containsDependency(Class<?> type) {
return false;
}
};

@Override
public DependencyResolver emptyDependencyResolver() {
return EMPTY_DEPENDENCY_RESOLVER;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -951,4 +951,21 @@ public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
}
};
}

private static final DependencyResolver EMPTY_DEPENDENCY_RESOLVER = new DependencyResolver.Adapter() {
@Override
public <T> T resolveDependency(Class<T> type, DependencyResolver.SelectionStrategy selector) {
return null;
}

@Override
public boolean containsDependency(Class<?> type) {
return false;
}
};

@Override
public DependencyResolver emptyDependencyResolver() {
return EMPTY_DEPENDENCY_RESOLVER;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -952,4 +952,21 @@ public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
}
};
}

private static final DependencyResolver EMPTY_DEPENDENCY_RESOLVER = new DependencyResolver.Adapter() {
@Override
public <T> T resolveDependency(Class<T> type, DependencyResolver.SelectionStrategy selector) {
return null;
}

@Override
public boolean containsDependency(Class<?> type) {
return false;
}
};

@Override
public DependencyResolver emptyDependencyResolver() {
return EMPTY_DEPENDENCY_RESOLVER;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -952,4 +952,21 @@ public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
}
};
}

private static final DependencyResolver EMPTY_DEPENDENCY_RESOLVER = new DependencyResolver.Adapter() {
@Override
public <T> T resolveDependency(Class<T> type, SelectionStrategy selector) {
return null;
}

@Override
public boolean containsDependency(Class<?> type) {
return false;
}
};

@Override
public DependencyResolver emptyDependencyResolver() {
return EMPTY_DEPENDENCY_RESOLVER;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -947,4 +947,21 @@ public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
}
};
}

private static final DependencyResolver EMPTY_DEPENDENCY_RESOLVER = new DependencyResolver.Adapter() {
@Override
public <T> T resolveDependency(Class<T> type, SelectionStrategy selector) {
return null;
}

@Override
public boolean containsDependency(Class<?> type) {
return false;
}
};

@Override
public DependencyResolver emptyDependencyResolver() {
return EMPTY_DEPENDENCY_RESOLVER;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -947,4 +947,21 @@ public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
}
};
}

private static final DependencyResolver EMPTY_DEPENDENCY_RESOLVER = new DependencyResolver.Adapter() {
@Override
public <T> T resolveDependency(Class<T> type, SelectionStrategy selector) {
return null;
}

@Override
public boolean containsDependency(Class<?> type) {
return false;
}
};

@Override
public DependencyResolver emptyDependencyResolver() {
return EMPTY_DEPENDENCY_RESOLVER;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -947,4 +947,21 @@ public Stream<UserFunctionSignature> getAllAggregatingFunctions() {
}
};
}

private static final DependencyResolver EMPTY_DEPENDENCY_RESOLVER = new DependencyResolver.Adapter() {
@Override
public <T> T resolveDependency(Class<T> type, SelectionStrategy selector) {
return null;
}

@Override
public boolean containsDependency(Class<?> type) {
return false;
}
};

@Override
public DependencyResolver emptyDependencyResolver() {
return EMPTY_DEPENDENCY_RESOLVER;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
import org.neo4j.common.DependencyResolver;
import org.neo4j.configuration.Config;
import org.neo4j.configuration.connectors.ConnectorPortRegister;
import org.neo4j.dbms.api.DatabaseManagementService;
Expand Down Expand Up @@ -327,4 +328,6 @@ TransactionalContext newQueryContext(
<T> T lookupComponentProvider(Context ctx, Class<T> component, boolean safe) throws ProcedureException;

GlobalProcedureRegistry globalProcedureRegistry(GlobalProcedures globalProcedures);

DependencyResolver emptyDependencyResolver();
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
import org.neo4j.common.DependencyResolver;
import org.neo4j.configuration.Config;
import org.neo4j.configuration.connectors.ConnectorPortRegister;
import org.neo4j.dbms.api.DatabaseManagementService;
Expand Down Expand Up @@ -493,6 +494,10 @@ public static GlobalProcedureRegistry globalProcedureRegistry(GlobalProcedures g
return IMPL.globalProcedureRegistry(globalProcedures);
}

public static DependencyResolver emptyDependencyResolver() {
return IMPL.emptyDependencyResolver();
}

private Neo4jProxy() {
throw new UnsupportedOperationException("No instances");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
import org.neo4j.gds.api.AlgorithmMetaDataSetter;
import org.neo4j.gds.api.CloseableResourceRegistry;
import org.neo4j.gds.api.DatabaseId;
import org.neo4j.gds.api.EmptyDependencyResolver;
import org.neo4j.gds.api.NodeLookup;
import org.neo4j.gds.api.ProcedureReturnColumns;
import org.neo4j.gds.api.TerminationMonitor;
import org.neo4j.gds.compat.Neo4jProxy;
import org.neo4j.gds.core.model.ModelCatalog;
import org.neo4j.gds.core.utils.progress.EmptyTaskRegistryFactory;
import org.neo4j.gds.core.utils.progress.TaskRegistryFactory;
Expand Down Expand Up @@ -120,7 +120,7 @@ public DatabaseId databaseId() {

@Override
public DependencyResolver dependencyResolver() {
return EmptyDependencyResolver.INSTANCE;
return Neo4jProxy.emptyDependencyResolver();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.neo4j.gds.ProcedureCallContextReturnColumns;
import org.neo4j.gds.api.AlgorithmMetaDataSetter;
import org.neo4j.gds.api.CloseableResourceRegistry;
import org.neo4j.gds.api.EmptyDependencyResolver;
import org.neo4j.gds.api.GraphStore;
import org.neo4j.gds.api.NodeLookup;
import org.neo4j.gds.api.TerminationMonitor;
Expand Down Expand Up @@ -131,7 +130,7 @@ private ExecutionContext executionContext(TaskStore taskStore) {
.username("")
.terminationMonitor(TerminationMonitor.EMPTY)
.isGdsAdmin(true)
.dependencyResolver(EmptyDependencyResolver.INSTANCE)
.dependencyResolver(Neo4jProxy.emptyDependencyResolver())
.modelCatalog(ModelCatalog.EMPTY)
.closeableResourceRegistry(CloseableResourceRegistry.EMPTY)
.algorithmMetaDataSetter(AlgorithmMetaDataSetter.EMPTY)
Expand Down
1 change: 0 additions & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ ext {
'5.9': properties.getOrDefault('neo4jVersion59', '5.9.0'),
'5.10': properties.getOrDefault('neo4jVersion510', '5.10.0'),
'5.11': properties.getOrDefault('neo4jVersion511', '5.11.0'),
'5.12': properties.getOrDefault('neo4jVersion511', '5.12.0'),
'5.12': properties.getOrDefault('neo4jVersion512', '5.12.0'),
]

Expand Down
Loading

0 comments on commit 32bc9fe

Please sign in to comment.