File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
core/src/main/java/org/neo4j/gds/core/loading Expand file tree Collapse file tree 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(
267267 }
268268
269269 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+ });
271275 }
272276
273277 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+ });
275285 }
276286
277287 public static Collection <GraphStoreCatalogEntry > getGraphStores (String username ) {
@@ -430,10 +440,6 @@ private boolean remove(
430440 .orElse (Boolean .FALSE );
431441 }
432442
433- private void remove (String databaseName ) {
434- graphsByName .keySet ().removeIf (userCatalogKey -> userCatalogKey .databaseName ().equals (databaseName ));
435- }
436-
437443 private Stream <GraphStoreCatalogEntryWithUsername > streamGraphStores (String userName ) {
438444 return graphsByName
439445 .values ()
You can’t perform that action at this time.
0 commit comments