Cleaning file formatting
This patch cleans the file formatting of ColumnFamilyStore, CommitLog, StorageProxy and StorageService. Those files will be modified when moving to 2.1 Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This commit is contained in:
parent
975de276b1
commit
057a3e27fd
@ -341,8 +341,8 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
||||
/**
|
||||
* force a major compaction of this column family
|
||||
*/
|
||||
public void forceMajorCompaction() throws ExecutionException,
|
||||
InterruptedException {
|
||||
public void forceMajorCompaction()
|
||||
throws ExecutionException, InterruptedException {
|
||||
log(" forceMajorCompaction() throws ExecutionException, InterruptedException");
|
||||
c.post("column_family/major_compaction/" + getCFName());
|
||||
}
|
||||
@ -515,8 +515,8 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
||||
*/
|
||||
public String getCompactionStrategyClass() {
|
||||
log(" getCompactionStrategyClass()");
|
||||
return c.getStringValue("column_family/compaction_strategy/"
|
||||
+ getCFName());
|
||||
return c.getStringValue(
|
||||
"column_family/compaction_strategy/" + getCFName());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -524,8 +524,8 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
||||
*/
|
||||
public Map<String, String> getCompressionParameters() {
|
||||
log(" getCompressionParameters()");
|
||||
return c.getMapStrValue("column_family/compression_parameters/"
|
||||
+ getCFName());
|
||||
return c.getMapStrValue(
|
||||
"column_family/compression_parameters/" + getCFName());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -623,8 +623,8 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
||||
log(" getSSTablesForKey(String key)");
|
||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
||||
queryParams.add("key", key);
|
||||
return c.getListStrValue(
|
||||
"column_family/sstables/by_key/" + getCFName(), queryParams);
|
||||
return c.getListStrValue("column_family/sstables/by_key/" + getCFName(),
|
||||
queryParams);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -652,8 +652,8 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
||||
*/
|
||||
public int[] getSSTableCountPerLevel() {
|
||||
log(" getSSTableCountPerLevel()");
|
||||
return c.getIntArrValue("column_family/sstables/per_level/"
|
||||
+ getCFName());
|
||||
return c.getIntArrValue(
|
||||
"column_family/sstables/per_level/" + getCFName());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -58,8 +58,8 @@ public class CommitLog implements CommitLogMBean {
|
||||
private CommitLog() {
|
||||
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
|
||||
try {
|
||||
mbs.registerMBean(this, new ObjectName(
|
||||
"org.apache.cassandra.db:type=Commitlog"));
|
||||
mbs.registerMBean(this,
|
||||
new ObjectName("org.apache.cassandra.db:type=Commitlog"));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -54,16 +54,16 @@ public class StorageProxy implements StorageProxyMBean {
|
||||
|
||||
public static final String UNREACHABLE = "UNREACHABLE";
|
||||
|
||||
private static final ClientRequestMetrics readMetrics = new ClientRequestMetrics("storage_proxy/metrics/read/",
|
||||
"Read");
|
||||
private static final ClientRequestMetrics rangeMetrics = new ClientRequestMetrics("storage_proxy/metrics/range/",
|
||||
"RangeSlice");
|
||||
private static final ClientRequestMetrics writeMetrics = new ClientRequestMetrics("storage_proxy/metrics/write/",
|
||||
"Write");
|
||||
private static final CASClientRequestMetrics casWriteMetrics = new CASClientRequestMetrics("storage_proxy/metrics/cas_write/",
|
||||
"CASWrite");
|
||||
private static final CASClientRequestMetrics casReadMetrics = new CASClientRequestMetrics("storage_proxy/metrics/cas_read/",
|
||||
"CASRead");
|
||||
private static final ClientRequestMetrics readMetrics = new ClientRequestMetrics(
|
||||
"storage_proxy/metrics/read/", "Read");
|
||||
private static final ClientRequestMetrics rangeMetrics = new ClientRequestMetrics(
|
||||
"storage_proxy/metrics/range/", "RangeSlice");
|
||||
private static final ClientRequestMetrics writeMetrics = new ClientRequestMetrics(
|
||||
"storage_proxy/metrics/write/", "Write");
|
||||
private static final CASClientRequestMetrics casWriteMetrics = new CASClientRequestMetrics(
|
||||
"storage_proxy/metrics/cas_write/", "CASWrite");
|
||||
private static final CASClientRequestMetrics casReadMetrics = new CASClientRequestMetrics(
|
||||
"storage_proxy/metrics/cas_read/", "CASRead");
|
||||
|
||||
private static final double CONCURRENT_SUBREQUESTS_MARGIN = 0.10;
|
||||
|
||||
@ -197,15 +197,15 @@ public class StorageProxy implements StorageProxyMBean {
|
||||
|
||||
public Set<String> getHintedHandoffEnabledByDC() {
|
||||
log(" getHintedHandoffEnabledByDC()");
|
||||
return c.getSetStringValue("storage_proxy/hinted_handoff_enabled_by_dc");
|
||||
return c.getSetStringValue(
|
||||
"storage_proxy/hinted_handoff_enabled_by_dc");
|
||||
}
|
||||
|
||||
public void setHintedHandoffEnabled(boolean b) {
|
||||
log(" setHintedHandoffEnabled(boolean b)");
|
||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
||||
queryParams.add("enable", Boolean.toString(b));
|
||||
c.post("storage_proxy/hinted_handoff_enabled",
|
||||
queryParams);
|
||||
c.post("storage_proxy/hinted_handoff_enabled", queryParams);
|
||||
}
|
||||
|
||||
public void setHintedHandoffEnabledByDCList(String dcs) {
|
||||
@ -289,8 +289,7 @@ public class StorageProxy implements StorageProxyMBean {
|
||||
log(" setCounterWriteRpcTimeout(Long timeoutInMillis)");
|
||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
||||
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
||||
c.post("storage_proxy/counter_write_rpc_timeout",
|
||||
queryParams);
|
||||
c.post("storage_proxy/counter_write_rpc_timeout", queryParams);
|
||||
}
|
||||
|
||||
public Long getCasContentionTimeout() {
|
||||
@ -302,8 +301,7 @@ public class StorageProxy implements StorageProxyMBean {
|
||||
log(" setCasContentionTimeout(Long timeoutInMillis)");
|
||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
||||
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
||||
c.post("storage_proxy/cas_contention_timeout",
|
||||
queryParams);
|
||||
c.post("storage_proxy/cas_contention_timeout", queryParams);
|
||||
}
|
||||
|
||||
public Long getRangeRpcTimeout() {
|
||||
|
@ -45,15 +45,15 @@ import com.sun.jersey.core.util.MultivaluedMapImpl;
|
||||
* space. This token gets gossiped around. This class will also maintain
|
||||
* histograms of the load information of other nodes in the cluster.
|
||||
*/
|
||||
public class StorageService extends NotificationBroadcasterSupport implements
|
||||
StorageServiceMBean {
|
||||
public class StorageService extends NotificationBroadcasterSupport
|
||||
implements StorageServiceMBean {
|
||||
private static final java.util.logging.Logger logger = java.util.logging.Logger
|
||||
.getLogger(StorageService.class.getName());
|
||||
|
||||
private APIClient c = new APIClient();
|
||||
|
||||
|
||||
private StorageMetrics metrics = new StorageMetrics();
|
||||
|
||||
|
||||
public static final StorageService instance = new StorageService();
|
||||
|
||||
public static StorageService getInstance() {
|
||||
@ -211,7 +211,8 @@ public class StorageService extends NotificationBroadcasterSupport implements
|
||||
*
|
||||
* @return mapping of ranges to end points
|
||||
*/
|
||||
public Map<List<String>, List<String>> getRangeToEndpointMap(String keyspace) {
|
||||
public Map<List<String>, List<String>> getRangeToEndpointMap(
|
||||
String keyspace) {
|
||||
log(" getRangeToEndpointMap(String keyspace)");
|
||||
return c.getMapListStrValue("/storage_service/range/" + keyspace);
|
||||
}
|
||||
@ -257,8 +258,8 @@ public class StorageService extends NotificationBroadcasterSupport implements
|
||||
public Map<List<String>, List<String>> getPendingRangeToEndpointMap(
|
||||
String keyspace) {
|
||||
log(" getPendingRangeToEndpointMap(String keyspace)");
|
||||
return c.getMapListStrValue("/storage_service/pending_range/"
|
||||
+ keyspace);
|
||||
return c.getMapListStrValue(
|
||||
"/storage_service/pending_range/" + keyspace);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -328,14 +329,15 @@ public class StorageService extends NotificationBroadcasterSupport implements
|
||||
* - key for which we need to find the endpoint return value -
|
||||
* the endpoint responsible for this key
|
||||
*/
|
||||
public List<InetAddress> getNaturalEndpoints(String keyspaceName,
|
||||
String cf, String key) {
|
||||
public List<InetAddress> getNaturalEndpoints(String keyspaceName, String cf,
|
||||
String key) {
|
||||
log(" getNaturalEndpoints(String keyspaceName, String cf, String key)");
|
||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
||||
queryParams.add("cf", cf);
|
||||
queryParams.add("key", key);
|
||||
return c.getListInetAddressValue("/storage_service/natural_endpoints/"
|
||||
+ keyspaceName, queryParams);
|
||||
return c.getListInetAddressValue(
|
||||
"/storage_service/natural_endpoints/" + keyspaceName,
|
||||
queryParams);
|
||||
}
|
||||
|
||||
public List<InetAddress> getNaturalEndpoints(String keyspaceName,
|
||||
@ -430,7 +432,7 @@ public class StorageService extends NotificationBroadcasterSupport implements
|
||||
*/
|
||||
public void forceKeyspaceCompaction(String keyspaceName,
|
||||
String... columnFamilies) throws IOException, ExecutionException,
|
||||
InterruptedException {
|
||||
InterruptedException {
|
||||
log(" forceKeyspaceCompaction(String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
|
||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
||||
APIClient.set_query_param(queryParams, "cf",
|
||||
@ -444,13 +446,14 @@ public class StorageService extends NotificationBroadcasterSupport implements
|
||||
*/
|
||||
public int forceKeyspaceCleanup(String keyspaceName,
|
||||
String... columnFamilies) throws IOException, ExecutionException,
|
||||
InterruptedException {
|
||||
InterruptedException {
|
||||
log(" forceKeyspaceCleanup(String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
|
||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
||||
APIClient.set_query_param(queryParams, "cf",
|
||||
APIClient.join(columnFamilies));
|
||||
return c.getIntValue("/storage_service/keyspace_compaction/"
|
||||
+ keyspaceName, queryParams);
|
||||
return c.getIntValue(
|
||||
"/storage_service/keyspace_compaction/" + keyspaceName,
|
||||
queryParams);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -462,7 +465,7 @@ public class StorageService extends NotificationBroadcasterSupport implements
|
||||
*/
|
||||
public int scrub(boolean disableSnapshot, boolean skipCorrupted,
|
||||
String keyspaceName, String... columnFamilies) throws IOException,
|
||||
ExecutionException, InterruptedException {
|
||||
ExecutionException, InterruptedException {
|
||||
log(" scrub(boolean disableSnapshot, boolean skipCorrupted, String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
|
||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
||||
APIClient.set_bool_query_param(queryParams, "disable_snapshot",
|
||||
@ -480,15 +483,16 @@ public class StorageService extends NotificationBroadcasterSupport implements
|
||||
*/
|
||||
public int upgradeSSTables(String keyspaceName,
|
||||
boolean excludeCurrentVersion, String... columnFamilies)
|
||||
throws IOException, ExecutionException, InterruptedException {
|
||||
throws IOException, ExecutionException,
|
||||
InterruptedException {
|
||||
log(" upgradeSSTables(String keyspaceName, boolean excludeCurrentVersion, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
|
||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
||||
APIClient.set_bool_query_param(queryParams, "exclude_current_version",
|
||||
excludeCurrentVersion);
|
||||
APIClient.set_query_param(queryParams, "cf",
|
||||
APIClient.join(columnFamilies));
|
||||
return c.getIntValue("/storage_service/keyspace_upgrade_sstables/"
|
||||
+ keyspaceName);
|
||||
return c.getIntValue(
|
||||
"/storage_service/keyspace_upgrade_sstables/" + keyspaceName);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -501,7 +505,7 @@ public class StorageService extends NotificationBroadcasterSupport implements
|
||||
*/
|
||||
public void forceKeyspaceFlush(String keyspaceName,
|
||||
String... columnFamilies) throws IOException, ExecutionException,
|
||||
InterruptedException {
|
||||
InterruptedException {
|
||||
log(" forceKeyspaceFlush(String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
|
||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
||||
APIClient.set_query_param(queryParams, "cf",
|
||||
@ -539,16 +543,16 @@ public class StorageService extends NotificationBroadcasterSupport implements
|
||||
public int forceRepairAsync(String keyspace, boolean isSequential,
|
||||
Collection<String> dataCenters, Collection<String> hosts,
|
||||
boolean primaryRange, boolean repairedAt, String... columnFamilies)
|
||||
throws IOException {
|
||||
throws IOException {
|
||||
log(" forceRepairAsync(String keyspace, boolean isSequential, Collection<String> dataCenters, Collection<String> hosts, boolean primaryRange, boolean repairedAt, String... columnFamilies) throws IOException");
|
||||
return c.getIntValue("");
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public int forceRepairAsync(String keyspace,
|
||||
RepairParallelism parallelismDegree,
|
||||
Collection<String> dataCenters, Collection<String> hosts,
|
||||
boolean primaryRange, boolean fullRepair, String... columnFamilies) {
|
||||
RepairParallelism parallelismDegree, Collection<String> dataCenters,
|
||||
Collection<String> hosts, boolean primaryRange, boolean fullRepair,
|
||||
String... columnFamilies) {
|
||||
log(" forceRepairAsync(String keyspace, RepairParallelism parallelismDegree, Collection<String> dataCenters, Collection<String> hosts, boolean primaryRange, boolean fullRepair, String... columnFamilies)");
|
||||
return c.getIntValue("");
|
||||
}
|
||||
@ -699,8 +703,8 @@ public class StorageService extends NotificationBroadcasterSupport implements
|
||||
* makes node unavailable for writes, flushes memtables and replays
|
||||
* commitlog.
|
||||
*/
|
||||
public void drain() throws IOException, InterruptedException,
|
||||
ExecutionException {
|
||||
public void drain()
|
||||
throws IOException, InterruptedException, ExecutionException {
|
||||
log(" drain() throws IOException, InterruptedException, ExecutionException");
|
||||
c.post("/storage_service/drain");
|
||||
}
|
||||
@ -946,7 +950,8 @@ public class StorageService extends NotificationBroadcasterSupport implements
|
||||
*/
|
||||
public String bulkLoadAsync(String directory) {
|
||||
log(" bulkLoadAsync(String directory)");
|
||||
return c.getStringValue("/storage_service/bulk_load_async/" + directory);
|
||||
return c.getStringValue(
|
||||
"/storage_service/bulk_load_async/" + directory);
|
||||
}
|
||||
|
||||
public void rescheduleFailedDeletions() {
|
||||
@ -1104,7 +1109,9 @@ public class StorageService extends NotificationBroadcasterSupport implements
|
||||
c.post("/storage_service/batch_size_failure_threshold", queryParams);
|
||||
}
|
||||
|
||||
/** Sets the hinted handoff throttle in kb per second, per delivery thread. */
|
||||
/**
|
||||
* Sets the hinted handoff throttle in kb per second, per delivery thread.
|
||||
*/
|
||||
public void setHintedHandoffThrottleInKB(int throttleInKB) {
|
||||
log(" setHintedHandoffThrottleInKB(int throttleInKB)");
|
||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
||||
|
Loading…
Reference in New Issue
Block a user