File tree 1 file changed +12
-6
lines changed
core/src/main/java/org/neo4j/gds/core/loading
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -267,11 +267,21 @@ public static void setDegreeDistribution(
267
267
}
268
268
269
269
public static void removeAllLoadedGraphs () {
270
- userCatalogs .clear ();
270
+ userCatalogs .forEach ((username , userCatalog ) -> {
271
+ userCatalog .graphsByName .forEach (((userCatalogKey , graphStoreCatalogEntry ) -> {
272
+ userCatalog .remove (userCatalogKey , __ -> {}, false );
273
+ }));
274
+ });
271
275
}
272
276
273
277
public static void removeAllLoadedGraphs (DatabaseId databaseId ) {
274
- userCatalogs .forEach ((user , userCatalog ) -> userCatalog .remove (databaseId .databaseName ()));
278
+ userCatalogs .forEach ((user , userCatalog ) -> {
279
+ userCatalog .graphsByName .forEach (((userCatalogKey , graphStoreCatalogEntry ) -> {
280
+ if (databaseId .databaseName ().equals (userCatalogKey .databaseName ())) {
281
+ userCatalog .remove (userCatalogKey , __ -> {}, false );
282
+ }
283
+ }));
284
+ });
275
285
}
276
286
277
287
public static Collection <GraphStoreCatalogEntry > getGraphStores (String username ) {
@@ -430,10 +440,6 @@ private boolean remove(
430
440
.orElse (Boolean .FALSE );
431
441
}
432
442
433
- private void remove (String databaseName ) {
434
- graphsByName .keySet ().removeIf (userCatalogKey -> userCatalogKey .databaseName ().equals (databaseName ));
435
- }
436
-
437
443
private Stream <GraphStoreCatalogEntryWithUsername > streamGraphStores (String userName ) {
438
444
return graphsByName
439
445
.values ()
You can’t perform that action at this time.
0 commit comments