Skip to content

Commit

Permalink
Reveal property to enable auto_snapshot. (#1031) (#1033)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattl-netflix committed Mar 25, 2023
1 parent 068dc51 commit b3d4dd9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
Expand Up @@ -1171,6 +1171,9 @@ default long getCompressionTransitionEpochMillis() {
return 0L;
}

/** @return whether to enable auto_snapshot */
boolean getAutoSnapshot();

/**
* Escape hatch for getting any arbitrary property by key This is useful so we don't have to
* keep adding methods to this interface for every single configuration option ever. Also
Expand Down
Expand Up @@ -789,4 +789,9 @@ public int getTargetMinutesToCompleteSnaphotUpload() {
public double getRateLimitChangeThreshold() {
return config.get(PRIAM_PRE + ".rateLimitChangeThreshold", 0.1);
}

@Override
public boolean getAutoSnapshot() {
return config.get(PRIAM_PRE + ".autoSnapshot", false);
}
}
Expand Up @@ -126,6 +126,7 @@ public void writeAllProperties(String yamlLocation, String hostname, String seed
map.put(
"compaction_large_partition_warning_threshold_mb",
config.getCompactionLargePartitionWarnThresholdInMB());
map.put("auto_snapshot", config.getAutoSnapshot());

List<?> seedp = (List) map.get("seed_provider");
Map<String, String> m = (Map<String, String>) seedp.get(0);
Expand Down
Expand Up @@ -40,6 +40,7 @@ public class FakeConfiguration implements IConfiguration {
private boolean skipUpdatingOthersIngressRules;
private boolean skipIngressUnlessIPIsPublic;
private long compressionTransitionEpochMillis;
private boolean autoSnapshot;

public final Map<String, String> fakeProperties = new HashMap<>();

Expand Down Expand Up @@ -296,4 +297,14 @@ public void setCompressionTransitionEpochMillis(long transitionTime) {
public long getCompressionTransitionEpochMillis() {
return compressionTransitionEpochMillis;
}

public FakeConfiguration setAutoSnapshot(boolean autoSnapshot) {
this.autoSnapshot = autoSnapshot;
return this;
}

@Override
public boolean getAutoSnapshot() {
return autoSnapshot;
}
}

0 comments on commit b3d4dd9

Please sign in to comment.