Skip to content

Commit

Permalink
Adding memtable_cleanup_threshold YAML config option
Browse files Browse the repository at this point in the history
  • Loading branch information
vinaykumarchella committed Sep 27, 2016
1 parent 2d95453 commit 3531341
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions priam/src/main/java/com/netflix/priam/IConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ public interface IConfiguration
* @return Get Memtable throughput settings
*/
public int getMemtableTotalSpaceMB();

/**
* @return memtable_cleanup_threshold in C* yaml
*/
double getMemtableCleanupThreshold();

/**
* @return stream_throughput_outbound_megabits_per_sec in yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public class PriamConfiguration implements IConfiguration
private static final String CONFIG_BOOTCLUSTER_NAME = PRIAM_PRE + ".bootcluster";
private static final String CONFIG_ENDPOINT_SNITCH = PRIAM_PRE + ".endpoint_snitch";
private static final String CONFIG_MEMTABLE_TOTAL_SPACE = PRIAM_PRE + ".memtabletotalspace";
private static final String CONFIG_MEMTABLE_CLEANUP_THRESHOLD = PRIAM_PRE + ".memtable.cleanup.threshold";
private static final String CONFIG_CASS_PROCESS_NAME = PRIAM_PRE + ".cass.process";
private static final String CONFIG_VNODE_NUM_TOKENS = PRIAM_PRE + ".vnodes.numTokens";
private static final String CONFIG_YAML_LOCATION = PRIAM_PRE + ".yamlLocation";
Expand Down Expand Up @@ -761,6 +762,12 @@ public int getMemtableTotalSpaceMB()
return config.get(CONFIG_MEMTABLE_TOTAL_SPACE, 1024);
}

/**
* memtable_cleanup_threshold defaults to 1 / (memtable_flush_writers + 1) ==> 0.11
*/
public double getMemtableCleanupThreshold(){return config.get(CONFIG_MEMTABLE_CLEANUP_THRESHOLD, 0.11);
}

@Override
public int getStreamingThroughputMB()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public void writeAllProperties(String yamlLocation, String hostname, String seed
map.put("tombstone_failure_threshold", config.getTombstoneFailureThreshold());
map.put("streaming_socket_timeout_in_ms", config.getStreamingSocketTimeoutInMS());

map.put("memtable_cleanup_threshold", config.getMemtableCleanupThreshold());

List<?> seedp = (List) map.get("seed_provider");
Map<String, String> m = (Map<String, String>) seedp.get(0);
m.put("class_name", seedProvider);
Expand Down
8 changes: 8 additions & 0 deletions priam/src/test/java/com/netflix/priam/FakeConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,14 @@ public int getMemtableTotalSpaceMB()
return 0;
}

/**
* @return memtable_cleanup_threshold in C* yaml
*/
@Override
public double getMemtableCleanupThreshold() {
return 0.11;
}

@Override
public int getStreamingThroughputMB()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,14 @@ public int getMemtableTotalSpaceMB()
return 0;
}

/**
* @return memtable_cleanup_threshold in C* yaml
*/
@Override
public double getMemtableCleanupThreshold() {
return 0.11;
}

@Override
public int getStreamingThroughputMB()
{
Expand Down

0 comments on commit 3531341

Please sign in to comment.