From ac496328532c2d2f9d91213eb989182f4b5ee81d Mon Sep 17 00:00:00 2001 From: Lasse Westh-Nielsen Date: Thu, 22 Aug 2024 17:32:39 +0200 Subject: [PATCH] ever more migrating feature toggles 8 --- .../operations/FeatureTogglesRepository.java | 6 ++++++ .../operations/OperationsApplications.java | 4 ++++ .../java/org/neo4j/gds/FeatureToggleProc.java | 16 +++++++--------- .../operations/OperationsProcedureFacade.java | 6 ++++++ 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/applications/operations/src/main/java/org/neo4j/gds/applications/operations/FeatureTogglesRepository.java b/applications/operations/src/main/java/org/neo4j/gds/applications/operations/FeatureTogglesRepository.java index 66a8b8bcf1..52a463f5d3 100644 --- a/applications/operations/src/main/java/org/neo4j/gds/applications/operations/FeatureTogglesRepository.java +++ b/applications/operations/src/main/java/org/neo4j/gds/applications/operations/FeatureTogglesRepository.java @@ -46,6 +46,12 @@ String resetAdjacencyPackingStrategy() { return GdsFeatureToggles.ADJACENCY_PACKING_STRATEGY.get().name(); } + boolean resetEnableAdjacencyCompressionMemoryTracking() { + GdsFeatureToggles.ENABLE_ADJACENCY_COMPRESSION_MEMORY_TRACKING.reset(); + + return GdsFeatureToggles.ENABLE_ADJACENCY_COMPRESSION_MEMORY_TRACKING.isEnabled(); + } + boolean resetEnableArrowDatabaseImport() { GdsFeatureToggles.ENABLE_ARROW_DATABASE_IMPORT.reset(); diff --git a/applications/operations/src/main/java/org/neo4j/gds/applications/operations/OperationsApplications.java b/applications/operations/src/main/java/org/neo4j/gds/applications/operations/OperationsApplications.java index b999cd9578..85bee6e4b6 100644 --- a/applications/operations/src/main/java/org/neo4j/gds/applications/operations/OperationsApplications.java +++ b/applications/operations/src/main/java/org/neo4j/gds/applications/operations/OperationsApplications.java @@ -99,6 +99,10 @@ public String resetAdjacencyPackingStrategy() { return featureTogglesRepository.resetAdjacencyPackingStrategy(); } + public boolean resetEnableAdjacencyCompressionMemoryTracking() { + return featureTogglesRepository.resetEnableAdjacencyCompressionMemoryTracking(); + } + public boolean resetEnableArrowDatabaseImport() { return featureTogglesRepository.resetEnableArrowDatabaseImport(); } diff --git a/proc/misc/src/main/java/org/neo4j/gds/FeatureToggleProc.java b/proc/misc/src/main/java/org/neo4j/gds/FeatureToggleProc.java index ff673757ee..a6c40328b9 100644 --- a/proc/misc/src/main/java/org/neo4j/gds/FeatureToggleProc.java +++ b/proc/misc/src/main/java/org/neo4j/gds/FeatureToggleProc.java @@ -23,7 +23,6 @@ import org.neo4j.gds.procedures.operations.FeatureLongValue; import org.neo4j.gds.procedures.operations.FeatureState; import org.neo4j.gds.procedures.operations.FeatureStringValue; -import org.neo4j.gds.utils.GdsFeatureToggles; import org.neo4j.procedure.Context; import org.neo4j.procedure.Description; import org.neo4j.procedure.Internal; @@ -76,6 +75,13 @@ public Stream resetAdjacencyPackingStrategy() { return facade.operations().resetAdjacencyPackingStrategy(); } + @Internal + @Procedure("gds.features.enableAdjacencyCompressionMemoryTracking.reset") + @Description("Sets the default behaviour for enabling memory tracking during the construction of an adjacency list. That value is returned.") + public Stream resetEnableAdjacencyCompressionMemoryTracking() { + return facade.operations().resetEnableAdjacencyCompressionMemoryTracking(); + } + @Internal @Procedure("gds.features.enableArrowDatabaseImport.reset") @Description("Sets the default behaviour for enabling Neo4j database import via the GDS Arrow Flight Server. That value is returned.") @@ -145,12 +151,4 @@ public void useReorderedAdjacencyList(@Name(value = "useReorderedAdjacencyList") public void useUncompressedAdjacencyList(@Name(value = "useUncompressedAdjacencyList") boolean useUncompressedAdjacencyList) { facade.operations().setUseUncompressedAdjacencyList(useUncompressedAdjacencyList); } - - @Internal - @Procedure("gds.features.enableAdjacencyCompressionMemoryTracking.reset") - @Description("Sets the default behaviour for enabling memory tracking during the construction of an adjacency list. That value is returned.") - public Stream resetEnableAdjacencyCompressionMemoryTracking() { - GdsFeatureToggles.ENABLE_ADJACENCY_COMPRESSION_MEMORY_TRACKING.reset(); - return Stream.of(new FeatureState(GdsFeatureToggles.ENABLE_ADJACENCY_COMPRESSION_MEMORY_TRACKING.isEnabled())); - } } diff --git a/procedures/operations-facade/src/main/java/org/neo4j/gds/procedures/operations/OperationsProcedureFacade.java b/procedures/operations-facade/src/main/java/org/neo4j/gds/procedures/operations/OperationsProcedureFacade.java index 6e24be77bd..97c575f15d 100644 --- a/procedures/operations-facade/src/main/java/org/neo4j/gds/procedures/operations/OperationsProcedureFacade.java +++ b/procedures/operations-facade/src/main/java/org/neo4j/gds/procedures/operations/OperationsProcedureFacade.java @@ -58,6 +58,12 @@ public Stream resetAdjacencyPackingStrategy() { return Stream.of(new FeatureStringValue(canonicalStrategyIdentifier)); } + public Stream resetEnableAdjacencyCompressionMemoryTracking() { + var isEnabled = applicationsFacade.operations().resetEnableAdjacencyCompressionMemoryTracking(); + + return Stream.of(new FeatureState(isEnabled)); + } + public Stream resetEnableArrowDatabaseImport() { var isEnabled = applicationsFacade.operations().resetEnableArrowDatabaseImport();