20
20
package org .neo4j .gds .procedures .catalog ;
21
21
22
22
import org .neo4j .gds .api .ProcedureReturnColumns ;
23
- import org .neo4j .gds .applications .ApplicationsFacade ;
24
23
import org .neo4j .gds .applications .algorithms .machinery .MemoryEstimateResult ;
25
24
import org .neo4j .gds .applications .algorithms .machinery .RequestScopedDependencies ;
26
25
import org .neo4j .gds .applications .algorithms .machinery .WriteContext ;
@@ -84,7 +83,7 @@ public class GraphCatalogProcedureFacade {
84
83
private final DatabaseModeRestriction databaseModeRestriction ;
85
84
86
85
// business facade
87
- private final ApplicationsFacade applicationsFacade ;
86
+ private final GraphCatalogApplications catalog ;
88
87
89
88
/**
90
89
* @param streamCloser A special thing needed for property streaming
@@ -95,7 +94,7 @@ public GraphCatalogProcedureFacade(
95
94
GraphDatabaseService graphDatabaseService ,
96
95
GraphProjectMemoryUsageService graphProjectMemoryUsageService ,
97
96
TransactionContext transactionContext ,
98
- ApplicationsFacade applicationsFacade ,
97
+ GraphCatalogApplications catalog ,
99
98
WriteContext writeContext ,
100
99
ProcedureReturnColumns procedureReturnColumns ,
101
100
DatabaseModeRestriction databaseModeRestriction
@@ -106,7 +105,7 @@ public GraphCatalogProcedureFacade(
106
105
this .graphProjectMemoryUsageService = graphProjectMemoryUsageService ;
107
106
this .transactionContext = transactionContext ;
108
107
109
- this .applicationsFacade = applicationsFacade ;
108
+ this .catalog = catalog ;
110
109
this .writeContext = writeContext ;
111
110
this .procedureReturnColumns = procedureReturnColumns ;
112
111
this .databaseModeRestriction = databaseModeRestriction ;
@@ -131,7 +130,7 @@ public <RETURN_TYPE> RETURN_TYPE graphExists(String graphName, Function<Boolean,
131
130
}
132
131
133
132
public boolean graphExists (String graphName ) {
134
- return catalog () .graphExists (
133
+ return catalog .graphExists (
135
134
requestScopedDependencies .getUser (),
136
135
requestScopedDependencies .getDatabaseId (),
137
136
graphName
@@ -150,7 +149,7 @@ public Stream<GraphInfo> dropGraph(
150
149
String databaseName ,
151
150
String username
152
151
) throws IllegalArgumentException {
153
- var results = catalog () .dropGraph (
152
+ var results = catalog .dropGraph (
154
153
graphNameOrListOfGraphNames ,
155
154
failIfMissing ,
156
155
databaseName ,
@@ -171,7 +170,7 @@ public Stream<GraphInfoWithHistogram> listGraphs(String graphName) {
171
170
172
171
var displayDegreeDistribution = procedureReturnColumns .contains ("degreeDistribution" );
173
172
174
- var results = catalog () .listGraphs (
173
+ var results = catalog .listGraphs (
175
174
requestScopedDependencies .getUser (),
176
175
graphName ,
177
176
displayDegreeDistribution ,
@@ -195,7 +194,7 @@ public Stream<GraphProjectNativeResult> nativeProject(
195
194
Object relationshipProjection ,
196
195
Map <String , Object > configuration
197
196
) {
198
- var result = catalog () .nativeProject (
197
+ var result = catalog .nativeProject (
199
198
requestScopedDependencies .getUser (),
200
199
requestScopedDependencies .getDatabaseId (),
201
200
graphDatabaseService ,
@@ -219,7 +218,7 @@ public Stream<MemoryEstimateResult> estimateNativeProject(
219
218
Object relationshipProjection ,
220
219
Map <String , Object > configuration
221
220
) {
222
- var result = catalog () .estimateNativeProject (
221
+ var result = catalog .estimateNativeProject (
223
222
requestScopedDependencies .getDatabaseId (),
224
223
graphProjectMemoryUsageService ,
225
224
requestScopedDependencies .getTaskRegistryFactory (),
@@ -240,7 +239,7 @@ public Stream<GraphProjectCypherResult> cypherProject(
240
239
String relationshipQuery ,
241
240
Map <String , Object > configuration
242
241
) {
243
- var result = catalog () .cypherProject (
242
+ var result = catalog .cypherProject (
244
243
requestScopedDependencies .getUser (),
245
244
requestScopedDependencies .getDatabaseId (),
246
245
graphDatabaseService ,
@@ -263,7 +262,7 @@ public Stream<MemoryEstimateResult> estimateCypherProject(
263
262
String relationshipQuery ,
264
263
Map <String , Object > configuration
265
264
) {
266
- var result = catalog () .estimateCypherProject (
265
+ var result = catalog .estimateCypherProject (
267
266
requestScopedDependencies .getDatabaseId (),
268
267
graphProjectMemoryUsageService ,
269
268
requestScopedDependencies .getTaskRegistryFactory (),
@@ -285,7 +284,7 @@ public Stream<GraphFilterResult> subGraphProject(
285
284
String relationshipFilter ,
286
285
Map <String , Object > configuration
287
286
) {
288
- var result = catalog () .subGraphProject (
287
+ var result = catalog .subGraphProject (
289
288
requestScopedDependencies .getUser (),
290
289
requestScopedDependencies .getDatabaseId (),
291
290
requestScopedDependencies .getTaskRegistryFactory (),
@@ -301,7 +300,7 @@ public Stream<GraphFilterResult> subGraphProject(
301
300
}
302
301
303
302
public Stream <GraphMemoryUsage > sizeOf (String graphName ) {
304
- var result = catalog () .sizeOf (
303
+ var result = catalog .sizeOf (
305
304
requestScopedDependencies .getUser (),
306
305
requestScopedDependencies .getDatabaseId (),
307
306
graphName
@@ -315,7 +314,7 @@ public Stream<GraphDropNodePropertiesResult> dropNodeProperties(
315
314
Object nodeProperties ,
316
315
Map <String , Object > configuration
317
316
) {
318
- var result = catalog () .dropNodeProperties (
317
+ var result = catalog .dropNodeProperties (
319
318
requestScopedDependencies .getUser (),
320
319
requestScopedDependencies .getDatabaseId (),
321
320
requestScopedDependencies .getTaskRegistryFactory (),
@@ -332,7 +331,7 @@ public Stream<GraphDropRelationshipResult> dropRelationships(
332
331
String graphName ,
333
332
String relationshipType
334
333
) {
335
- var result = catalog () .dropRelationships (
334
+ var result = catalog .dropRelationships (
336
335
requestScopedDependencies .getUser (),
337
336
requestScopedDependencies .getDatabaseId (),
338
337
requestScopedDependencies .getTaskRegistryFactory (),
@@ -349,7 +348,7 @@ public Stream<GraphDropGraphPropertiesResult> dropGraphProperty(
349
348
String graphProperty ,
350
349
Map <String , Object > configuration
351
350
) {
352
- var numberOfPropertiesRemoved = catalog () .dropGraphProperty (
351
+ var numberOfPropertiesRemoved = catalog .dropGraphProperty (
353
352
requestScopedDependencies .getUser (),
354
353
requestScopedDependencies .getDatabaseId (),
355
354
graphName ,
@@ -371,7 +370,7 @@ public Stream<MutateLabelResult> mutateNodeLabel(
371
370
String nodeLabel ,
372
371
Map <String , Object > configuration
373
372
) {
374
- var result = catalog () .mutateNodeLabel (
373
+ var result = catalog .mutateNodeLabel (
375
374
requestScopedDependencies .getUser (),
376
375
requestScopedDependencies .getDatabaseId (),
377
376
graphName ,
@@ -387,7 +386,7 @@ public Stream<StreamGraphPropertyResult> streamGraphProperty(
387
386
String graphProperty ,
388
387
Map <String , Object > configuration
389
388
) {
390
- var result = catalog () .streamGraphProperty (
389
+ var result = catalog .streamGraphProperty (
391
390
requestScopedDependencies .getUser (),
392
391
requestScopedDependencies .getDatabaseId (),
393
392
graphName ,
@@ -442,7 +441,7 @@ private <T> Stream<T> streamNodePropertyOrProperties(
442
441
) {
443
442
var usesPropertyNameColumn = procedureReturnColumns .contains ("nodeProperty" );
444
443
445
- var resultStream = catalog () .streamNodeProperties (
444
+ var resultStream = catalog .streamNodeProperties (
446
445
requestScopedDependencies .getUser (),
447
446
requestScopedDependencies .getDatabaseId (),
448
447
requestScopedDependencies .getTaskRegistryFactory (),
@@ -500,7 +499,7 @@ public Stream<TopologyResult> streamRelationships(
500
499
Object relationshipTypes ,
501
500
Map <String , Object > configuration
502
501
) {
503
- return catalog () .streamRelationships (
502
+ return catalog .streamRelationships (
504
503
requestScopedDependencies .getUser (),
505
504
requestScopedDependencies .getDatabaseId (),
506
505
graphName ,
@@ -515,7 +514,7 @@ public Stream<NodePropertiesWriteResult> writeNodeProperties(
515
514
Object nodeLabels ,
516
515
Map <String , Object > configuration
517
516
) {
518
- var result = catalog () .writeNodeProperties (
517
+ var result = catalog .writeNodeProperties (
519
518
requestScopedDependencies .getUser (),
520
519
requestScopedDependencies .getDatabaseId (),
521
520
writeContext .nodePropertyExporterBuilder (),
@@ -537,7 +536,7 @@ public Stream<WriteRelationshipPropertiesResult> writeRelationshipProperties(
537
536
List <String > relationshipProperties ,
538
537
Map <String , Object > configuration
539
538
) {
540
- var result = catalog () .writeRelationshipProperties (
539
+ var result = catalog .writeRelationshipProperties (
541
540
requestScopedDependencies .getUser (),
542
541
requestScopedDependencies .getDatabaseId (),
543
542
writeContext .relationshipPropertiesExporterBuilder (),
@@ -556,7 +555,7 @@ public Stream<WriteLabelResult> writeNodeLabel(
556
555
String nodeLabel ,
557
556
Map <String , Object > configuration
558
557
) {
559
- var result = catalog () .writeNodeLabel (
558
+ var result = catalog .writeNodeLabel (
560
559
requestScopedDependencies .getUser (),
561
560
requestScopedDependencies .getDatabaseId (),
562
561
writeContext .nodeLabelExporterBuilder (),
@@ -575,7 +574,7 @@ public Stream<WriteRelationshipResult> writeRelationships(
575
574
String relationshipProperty ,
576
575
Map <String , Object > configuration
577
576
) {
578
- var result = catalog () .writeRelationships (
577
+ var result = catalog .writeRelationships (
579
578
requestScopedDependencies .getUser (),
580
579
requestScopedDependencies .getDatabaseId (),
581
580
writeContext .relationshipExporterBuilder (),
@@ -596,7 +595,7 @@ public Stream<RandomWalkSamplingResult> sampleRandomWalkWithRestarts(
596
595
String originGraphName ,
597
596
Map <String , Object > configuration
598
597
) {
599
- var result = catalog () .sampleRandomWalkWithRestarts (
598
+ var result = catalog .sampleRandomWalkWithRestarts (
600
599
requestScopedDependencies .getUser (),
601
600
requestScopedDependencies .getDatabaseId (),
602
601
requestScopedDependencies .getTaskRegistryFactory (),
@@ -614,7 +613,7 @@ public Stream<RandomWalkSamplingResult> sampleCommonNeighbourAwareRandomWalk(
614
613
String originGraphName ,
615
614
Map <String , Object > configuration
616
615
) {
617
- var result = catalog () .sampleCommonNeighbourAwareRandomWalk (
616
+ var result = catalog .sampleCommonNeighbourAwareRandomWalk (
618
617
requestScopedDependencies .getUser (),
619
618
requestScopedDependencies .getDatabaseId (),
620
619
requestScopedDependencies .getTaskRegistryFactory (),
@@ -631,7 +630,7 @@ public Stream<MemoryEstimateResult> estimateCommonNeighbourAwareRandomWalk(
631
630
String graphName ,
632
631
Map <String , Object > configuration
633
632
) {
634
- var result = catalog () .estimateCommonNeighbourAwareRandomWalk (
633
+ var result = catalog .estimateCommonNeighbourAwareRandomWalk (
635
634
requestScopedDependencies .getUser (),
636
635
requestScopedDependencies .getDatabaseId (),
637
636
graphName ,
@@ -645,13 +644,13 @@ public Stream<FileExportResult> exportToCsv(
645
644
String graphName ,
646
645
Map <String , Object > configuration
647
646
) {
648
- var result = catalog () .exportToCsv (graphName , configuration );
647
+ var result = catalog .exportToCsv (graphName , configuration );
649
648
650
649
return Stream .of (result );
651
650
}
652
651
653
652
public Stream <MemoryEstimateResult > exportToCsvEstimate (String graphName , Map <String , Object > configuration ) {
654
- var result = catalog () .exportToCsvEstimate (graphName , configuration );
653
+ var result = catalog .exportToCsvEstimate (graphName , configuration );
655
654
656
655
return Stream .of (result );
657
656
}
@@ -662,7 +661,7 @@ public Stream<DatabaseExportResult> exportToDatabase(
662
661
) {
663
662
databaseModeRestriction .ensureNotOnCluster ();
664
663
665
- var result = catalog () .exportToDatabase (graphName , configuration );
664
+ var result = catalog .exportToDatabase (graphName , configuration );
666
665
667
666
return Stream .of (result );
668
667
}
@@ -673,7 +672,7 @@ public Stream<GraphGenerationStats> generateGraph(
673
672
long averageDegree ,
674
673
Map <String , Object > configuration
675
674
) {
676
- var result = catalog () .generateGraph (
675
+ var result = catalog .generateGraph (
677
676
requestScopedDependencies .getUser (),
678
677
requestScopedDependencies .getDatabaseId (),
679
678
graphName ,
@@ -694,7 +693,7 @@ private <T> Stream<T> streamRelationshipPropertyOrProperties(
694
693
) {
695
694
var usesPropertyNameColumn = procedureReturnColumns .contains ("relationshipProperty" );
696
695
697
- var resultStream = catalog () .streamRelationshipProperties (
696
+ var resultStream = catalog .streamRelationshipProperties (
698
697
requestScopedDependencies .getUser (),
699
698
requestScopedDependencies .getDatabaseId (),
700
699
requestScopedDependencies .getTaskRegistryFactory (),
@@ -720,8 +719,4 @@ private String validateValue(String graphName) {
720
719
721
720
return graphName ;
722
721
}
723
-
724
- private GraphCatalogApplications catalog () {
725
- return applicationsFacade .graphCatalog ();
726
- }
727
722
}
0 commit comments