Skip to content

Commit

Permalink
ever more migrating feature toggles 7
Browse files Browse the repository at this point in the history
  • Loading branch information
lassewesth committed Aug 22, 2024
1 parent 1c369e7 commit 0a89763
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
* Let's encapsulate feature toggles and eventually make them not a global singleton.
*/
public class FeatureTogglesRepository {
void enableAdjacencyCompressionMemoryTracking(boolean value) {
GdsFeatureToggles.ENABLE_ADJACENCY_COMPRESSION_MEMORY_TRACKING.toggle(value);
}

void enableArrowDatabaseImport(boolean value) {
GdsFeatureToggles.ENABLE_ARROW_DATABASE_IMPORT.toggle(value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public static OperationsApplications create(
return new OperationsApplications(featureTogglesRepository, requestScopedDependencies);
}

public void enableAdjacencyCompressionMemoryTracking(boolean value) {
featureTogglesRepository.enableAdjacencyCompressionMemoryTracking(value);
}

public void enableArrowDatabaseImport(boolean value) {
featureTogglesRepository.enableArrowDatabaseImport(value);
}
Expand Down
14 changes: 7 additions & 7 deletions proc/misc/src/main/java/org/neo4j/gds/FeatureToggleProc.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ public void adjacencyPackingStrategy(@Name(value = "adjacencyPackingStrategy") S
facade.operations().setAdjacencyPackingStrategy(adjacencyPackingStrategy);
}

@Internal
@Procedure("gds.features.enableAdjacencyCompressionMemoryTracking")
@Description("Enables memory tracking during the construction of an adjacency list.")
public void enableAdjacencyCompressionMemoryTracking(@Name(value = "enableAdjacencyCompressionMemoryTracking") boolean enableAdjacencyCompressionMemoryTracking) {
facade.operations().enableAdjacencyCompressionMemoryTracking(enableAdjacencyCompressionMemoryTracking);
}

@Internal
@Procedure("gds.features.enableArrowDatabaseImport")
@Description("Enables support for importing Neo4j databases via the GDS Arrow Flight Server.")
Expand Down Expand Up @@ -139,13 +146,6 @@ public void useUncompressedAdjacencyList(@Name(value = "useUncompressedAdjacency
facade.operations().setUseUncompressedAdjacencyList(useUncompressedAdjacencyList);
}

@Internal
@Procedure("gds.features.enableAdjacencyCompressionMemoryTracking")
@Description("Enables memory tracking during the construction of an adjacency list.")
public void enableAdjacencyCompressionMemoryTracking(@Name(value = "enableAdjacencyCompressionMemoryTracking") boolean enableAdjacencyCompressionMemoryTracking) {
GdsFeatureToggles.ENABLE_ADJACENCY_COMPRESSION_MEMORY_TRACKING.toggle(enableAdjacencyCompressionMemoryTracking);
}

@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.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public OperationsProcedureFacade(ApplicationsFacade applicationsFacade) {
this.applicationsFacade = applicationsFacade;
}

public void enableAdjacencyCompressionMemoryTracking(boolean value) {
applicationsFacade.operations().enableAdjacencyCompressionMemoryTracking(value);
}

public void enableArrowDatabaseImport(boolean value) {
applicationsFacade.operations().enableArrowDatabaseImport(value);
}
Expand Down

0 comments on commit 0a89763

Please sign in to comment.