Skip to content

Commit 2ac4adf

Browse files
committed
Move configurations from :core to :config-api
1 parent e51fe33 commit 2ac4adf

File tree

56 files changed

+175
-113
lines changed

Some content is hidden

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

56 files changed

+175
-113
lines changed

applications/graph-store-catalog/src/main/java/org/neo4j/gds/applications/graphstorecatalog/FictitiousGraphStoreLoader.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.neo4j.gds.api.ResultStore;
2626
import org.neo4j.gds.config.GraphProjectConfig;
2727
import org.neo4j.gds.core.GraphDimensions;
28+
import org.neo4j.gds.core.GraphStoreFactorySupplier;
2829
import org.neo4j.gds.core.ImmutableGraphDimensions;
2930
import org.neo4j.gds.mem.MemoryEstimation;
3031
import org.neo4j.gds.projection.GraphProjectFromStoreConfig;
@@ -69,16 +70,16 @@ public GraphDimensions graphDimensions() {
6970

7071
@Override
7172
public MemoryEstimation estimateMemoryUsageDuringLoading() {
72-
return graphProjectConfig
73-
.graphStoreFactory()
73+
return GraphStoreFactorySupplier
74+
.supplier(graphProjectConfig)
7475
.getWithDimension(GraphLoaderContext.NULL_CONTEXT, graphDimensions())
7576
.estimateMemoryUsageDuringLoading();
7677
}
7778

7879
@Override
7980
public MemoryEstimation estimateMemoryUsageAfterLoading() {
80-
return graphProjectConfig
81-
.graphStoreFactory()
81+
return GraphStoreFactorySupplier
82+
.supplier(graphProjectConfig)
8283
.getWithDimension(GraphLoaderContext.NULL_CONTEXT, graphDimensions())
8384
.estimateMemoryUsageAfterLoading();
8485
}

applications/graph-store-catalog/src/test/java/org/neo4j/gds/applications/graphstorecatalog/StubGraphProjectConfig.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import org.apache.commons.lang3.builder.ToStringBuilder;
2323
import org.apache.commons.lang3.builder.ToStringStyle;
24-
import org.neo4j.gds.api.GraphStoreFactory;
2524
import org.neo4j.gds.config.GraphProjectConfig;
2625

2726
import java.util.Map;
@@ -59,10 +58,10 @@ public Map<String, Object> asProcedureResultConfigurationField() {
5958
throw new UnsupportedOperationException("TODO");
6059
}
6160

62-
@Override
63-
public GraphStoreFactory.Supplier graphStoreFactory() {
64-
throw new UnsupportedOperationException("TODO");
65-
}
61+
// @Override
62+
// public GraphStoreFactory.Supplier graphStoreFactory() {
63+
// throw new UnsupportedOperationException("TODO");
64+
// }
6665

6766
@Override
6867
public Optional<String> usernameOverride() {

config-api/build.gradle

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,36 @@ description = 'Neo4j Graph Data Science :: Config API'
55
group = 'org.neo4j.gds'
66

77
dependencies {
8+
annotationProcessor project(':annotations')
9+
annotationProcessor project(':config-generator')
10+
annotationProcessor openGds.immutables.builder
11+
annotationProcessor openGds.immutables.value
12+
annotationProcessor group: 'org.neo4j', name: 'annotations', version: ver.'neo4j'
13+
814
compileOnly project(':annotations')
915
compileOnly openGds.immutables.value.annotations
1016
compileOnly openGds.jetbrains.annotations
1117

18+
// Neo4j Dependencies
19+
// `org.neo4j.gds.config.UserInputAsStringOrListOfString` is using
20+
// - Node
21+
// - Relationship
22+
// - Path
23+
// TODO: Move UserInputAsStringOrListOfString up where it belongs
24+
compileOnly(
25+
[group: 'org.neo4j', name: 'neo4j-graphdb-api', version: ver.'neo4j'],
26+
)
27+
1228
api openGds.commons.lang3
29+
30+
implementation(
31+
project(':concurrency'),
32+
project(':concurrency-validation-api'),
33+
project(':core-api'),
34+
project(':graph-projection-api'),
35+
project(':graph-schema-api'),
36+
// `JobIdConfig` 🙈
37+
project(':progress-tracking'),
38+
project(':string-formatting'),
39+
)
1340
}

core/src/main/java/org/neo4j/gds/config/ConfigNodesValidations.java renamed to config-api/src/main/java/org/neo4j/gds/config/ConfigNodesValidations.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.neo4j.gds.NodeLabel;
2424
import org.neo4j.gds.api.GraphStore;
2525
import org.neo4j.gds.api.IdMap;
26+
import org.neo4j.gds.utils.StringFormatting;
2627
import org.neo4j.gds.utils.StringJoining;
2728

2829
import java.util.Collection;
@@ -72,7 +73,7 @@ static void nodesExistInGraph(
7273
.collect(Collectors.toList());
7374

7475
if (!missingNodes.isEmpty()) {
75-
throw new IllegalArgumentException(formatWithLocale(
76+
throw new IllegalArgumentException(StringFormatting.formatWithLocale(
7677
"%s nodes do not exist in the in-memory graph%s: %s",
7778
parameterKey,
7879
nodeLabelFilterDescription(filteredNodeLabels, graphStore),
@@ -88,7 +89,7 @@ public static void validateNodePropertyExists(
8889
@Nullable String propertyName
8990
) {
9091
if (graphStore.hasNodeProperty(nodeLabels, propertyName)) return;
91-
throw new IllegalArgumentException(formatWithLocale(
92+
throw new IllegalArgumentException(StringFormatting.formatWithLocale(
9293
"%s `%s` not found in graph with node properties: %s",
9394
configKey,
9495
propertyName,

0 commit comments

Comments
 (0)