Merge "Populate the API exception" from Amnon
"The trigger for this patch is the nodetool remove command, the expected behaviour is that the error that return from the API would be populate to the JMX client. In this first stage the API errors are send as a generic RuntimeException, in a later phase specific methods would catch this exception and replace it with a specific one. Note that the thrown exceptions should be one that is known to the client, or it would fail to handle it and in general should be equivalent to origin. After this patch a call to the nodetool remove with a bad host name would result in: ./bin/nodetool removenode dcc0477a-b4a7-448a-bc79-27853f61b92d error: Host ID not found. -- StackTrace -- java.lang.RuntimeException: Host ID not found. at com.cloudius.urchin.api.APIClient.getException(APIClient.java:114) at com.cloudius.urchin.api.APIClient.post(APIClient.java:101) ....."
This commit is contained in:
commit
d88d017385
19
pom.xml
19
pom.xml
@ -16,9 +16,24 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sun.jersey</groupId>
|
<groupId>org.glassfish.jersey.core</groupId>
|
||||||
|
<artifactId>jersey-common</artifactId>
|
||||||
|
<version>2.22.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.ws.rs</groupId>
|
||||||
|
<artifactId>javax.ws.rs-api</artifactId>
|
||||||
|
<version>2.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.ws.rs</groupId>
|
||||||
|
<artifactId>jsr311-api</artifactId>
|
||||||
|
<version>1.1.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.glassfish.jersey.core</groupId>
|
||||||
<artifactId>jersey-client</artifactId>
|
<artifactId>jersey-client</artifactId>
|
||||||
<version>1.19</version>
|
<version>2.22.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -12,6 +12,7 @@ import java.util.HashSet;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.json.Json;
|
import javax.json.Json;
|
||||||
@ -22,17 +23,17 @@ import javax.json.JsonReaderFactory;
|
|||||||
import javax.json.JsonString;
|
import javax.json.JsonString;
|
||||||
import javax.management.openmbean.TabularData;
|
import javax.management.openmbean.TabularData;
|
||||||
import javax.management.openmbean.TabularDataSupport;
|
import javax.management.openmbean.TabularDataSupport;
|
||||||
|
import javax.ws.rs.client.Client;
|
||||||
|
import javax.ws.rs.client.ClientBuilder;
|
||||||
|
import javax.ws.rs.client.Entity;
|
||||||
|
import javax.ws.rs.client.Invocation;
|
||||||
|
import javax.ws.rs.client.WebTarget;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import javax.ws.rs.core.MultivaluedMap;
|
import javax.ws.rs.core.MultivaluedMap;
|
||||||
import javax.ws.rs.core.UriBuilder;
|
import javax.ws.rs.core.Response;
|
||||||
|
import org.glassfish.jersey.client.ClientConfig;
|
||||||
import com.cloudius.urchin.utils.EstimatedHistogram;
|
import com.cloudius.urchin.utils.EstimatedHistogram;
|
||||||
import com.cloudius.urchin.utils.SnapshotDetailsTabularData;
|
import com.cloudius.urchin.utils.SnapshotDetailsTabularData;
|
||||||
import com.sun.jersey.api.client.Client;
|
|
||||||
import com.sun.jersey.api.client.WebResource;
|
|
||||||
import com.sun.jersey.api.client.WebResource.Builder;
|
|
||||||
import com.sun.jersey.api.client.config.ClientConfig;
|
|
||||||
import com.sun.jersey.api.client.config.DefaultClientConfig;
|
|
||||||
import com.yammer.metrics.core.HistogramValues;
|
import com.yammer.metrics.core.HistogramValues;
|
||||||
|
|
||||||
public class APIClient {
|
public class APIClient {
|
||||||
@ -77,43 +78,44 @@ public class APIClient {
|
|||||||
+ System.getProperty("apiport", "10000");
|
+ System.getProperty("apiport", "10000");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder get(String path) {
|
public Invocation.Builder get(String path, MultivaluedMap<String, String> queryParams) {
|
||||||
ClientConfig config = new DefaultClientConfig();
|
Client client = ClientBuilder.newClient( new ClientConfig());
|
||||||
Client client = Client.create(config);
|
WebTarget webTarget = client.target(getBaseUrl()).path(path);
|
||||||
WebResource service = client.resource(UriBuilder.fromUri(getBaseUrl())
|
|
||||||
.build());
|
|
||||||
return service.path(path).accept(MediaType.APPLICATION_JSON);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Builder get(String path, MultivaluedMap<String, String> queryParams) {
|
|
||||||
if (queryParams == null) {
|
|
||||||
return get(path);
|
|
||||||
}
|
|
||||||
ClientConfig config = new DefaultClientConfig();
|
|
||||||
Client client = Client.create(config);
|
|
||||||
WebResource service = client.resource(UriBuilder.fromUri(getBaseUrl())
|
|
||||||
.build());
|
|
||||||
return service.queryParams(queryParams).path(path)
|
|
||||||
.accept(MediaType.APPLICATION_JSON);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void post(String path, MultivaluedMap<String, String> queryParams) {
|
|
||||||
if (queryParams != null) {
|
if (queryParams != null) {
|
||||||
get(path, queryParams).post();
|
for (Entry<String, List<String>> qp : queryParams.entrySet()) {
|
||||||
return;
|
for (String e : qp.getValue()) {
|
||||||
|
webTarget = webTarget.queryParam(qp.getKey(), e);
|
||||||
}
|
}
|
||||||
get(path).post();
|
}
|
||||||
|
}
|
||||||
|
return webTarget.request(MediaType.APPLICATION_JSON);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Invocation.Builder get(String path) {
|
||||||
|
return get(path, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Response post(String path, MultivaluedMap<String, String> queryParams) {
|
||||||
|
Response response = get(path, queryParams).post(Entity.entity(null, MediaType.TEXT_PLAIN));
|
||||||
|
if (response.getStatus() != Response.Status.OK.getStatusCode() ) {
|
||||||
|
throw getException(response.readEntity(String.class));
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void post(String path) {
|
public void post(String path) {
|
||||||
post(path, null);
|
post(path, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String postGetVal(String path, MultivaluedMap<String, String> queryParams) {
|
public RuntimeException getException(String txt) {
|
||||||
if (queryParams != null) {
|
JsonReader reader = factory.createReader(new StringReader(txt));
|
||||||
return get(path, queryParams).post(String.class);
|
JsonObject res = reader.readObject();
|
||||||
|
return new RuntimeException(res.getString("message"));
|
||||||
}
|
}
|
||||||
return get(path).post(String.class);
|
|
||||||
|
public String postGetVal(String path, MultivaluedMap<String, String> queryParams) {
|
||||||
|
return post(path, queryParams).readEntity(String.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int postInt(String path, MultivaluedMap<String, String> queryParams) {
|
public int postInt(String path, MultivaluedMap<String, String> queryParams) {
|
||||||
@ -146,8 +148,15 @@ public class APIClient {
|
|||||||
if (res != null) {
|
if (res != null) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
Response response = get(string, queryParams).get(Response.class);
|
||||||
|
|
||||||
res = get(string, queryParams).get(String.class);
|
if (response.getStatus() != Response.Status.OK.getStatusCode() ) {
|
||||||
|
// TBD
|
||||||
|
// We are currently not caching errors,
|
||||||
|
// it should be reconsider.
|
||||||
|
throw getException(response.readEntity(String.class));
|
||||||
|
}
|
||||||
|
res = response.readEntity(String.class);
|
||||||
if (duration > 0) {
|
if (duration > 0) {
|
||||||
cache.put(key, new CacheEntry(res));
|
cache.put(key, new CacheEntry(res));
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
package org.apache.cassandra.db;
|
package org.apache.cassandra.db;
|
||||||
|
|
||||||
import java.lang.management.ManagementFactory;
|
import java.lang.management.ManagementFactory;
|
||||||
|
import java.net.ConnectException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
|
|
||||||
@ -32,13 +33,14 @@ import javax.json.JsonObject;
|
|||||||
import javax.management.*;
|
import javax.management.*;
|
||||||
import javax.management.openmbean.CompositeData;
|
import javax.management.openmbean.CompositeData;
|
||||||
import javax.management.openmbean.OpenDataException;
|
import javax.management.openmbean.OpenDataException;
|
||||||
|
import javax.ws.rs.ProcessingException;
|
||||||
|
import javax.ws.rs.core.MultivaluedHashMap;
|
||||||
import javax.ws.rs.core.MultivaluedMap;
|
import javax.ws.rs.core.MultivaluedMap;
|
||||||
|
|
||||||
import org.apache.cassandra.metrics.ColumnFamilyMetrics;
|
import org.apache.cassandra.metrics.ColumnFamilyMetrics;
|
||||||
|
|
||||||
import com.cloudius.urchin.api.APIClient;
|
import com.cloudius.urchin.api.APIClient;
|
||||||
import com.sun.jersey.api.client.ClientHandlerException;
|
import com.google.common.base.Throwables;
|
||||||
import com.sun.jersey.core.util.MultivaluedMapImpl;
|
|
||||||
|
|
||||||
public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
||||||
private static final java.util.logging.Logger logger = java.util.logging.Logger
|
private static final java.util.logging.Logger logger = java.util.logging.Logger
|
||||||
@ -130,11 +132,15 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
missed_response = 0;
|
missed_response = 0;
|
||||||
} catch (ClientHandlerException e) {
|
} catch (ProcessingException e) {
|
||||||
|
if (Throwables.getRootCause(e) instanceof ConnectException) {
|
||||||
if (missed_response++ > MAX_RETRY) {
|
if (missed_response++ > MAX_RETRY) {
|
||||||
System.err.println("API is not available, JMX is shuting down");
|
System.err.println("API is not available, JMX is shuting down");
|
||||||
System.exit(-1);
|
System.exit(-1);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// ignoring exceptions, will retry on the next interval
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// ignoring exceptions, will retry on the next interval
|
// ignoring exceptions, will retry on the next interval
|
||||||
}
|
}
|
||||||
@ -474,7 +480,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
|||||||
*/
|
*/
|
||||||
public void setMinimumCompactionThreshold(int threshold) {
|
public void setMinimumCompactionThreshold(int threshold) {
|
||||||
log(" setMinimumCompactionThreshold(int threshold)");
|
log(" setMinimumCompactionThreshold(int threshold)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("value", Integer.toString(threshold));
|
queryParams.add("value", Integer.toString(threshold));
|
||||||
c.post("column_family/minimum_compaction/" + getCFName(), queryParams);
|
c.post("column_family/minimum_compaction/" + getCFName(), queryParams);
|
||||||
}
|
}
|
||||||
@ -493,7 +499,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
|||||||
*/
|
*/
|
||||||
public void setCompactionThresholds(int minThreshold, int maxThreshold) {
|
public void setCompactionThresholds(int minThreshold, int maxThreshold) {
|
||||||
log(" setCompactionThresholds(int minThreshold, int maxThreshold)");
|
log(" setCompactionThresholds(int minThreshold, int maxThreshold)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("minimum", Integer.toString(minThreshold));
|
queryParams.add("minimum", Integer.toString(minThreshold));
|
||||||
queryParams.add("maximum", Integer.toString(maxThreshold));
|
queryParams.add("maximum", Integer.toString(maxThreshold));
|
||||||
c.post("column_family/compaction" + getCFName(), queryParams);
|
c.post("column_family/compaction" + getCFName(), queryParams);
|
||||||
@ -504,7 +510,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
|||||||
*/
|
*/
|
||||||
public void setMaximumCompactionThreshold(int threshold) {
|
public void setMaximumCompactionThreshold(int threshold) {
|
||||||
log(" setMaximumCompactionThreshold(int threshold)");
|
log(" setMaximumCompactionThreshold(int threshold)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("value", Integer.toString(threshold));
|
queryParams.add("value", Integer.toString(threshold));
|
||||||
c.post("column_family/maximum_compaction/" + getCFName(), queryParams);
|
c.post("column_family/maximum_compaction/" + getCFName(), queryParams);
|
||||||
}
|
}
|
||||||
@ -517,7 +523,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
|||||||
*/
|
*/
|
||||||
public void setCompactionStrategyClass(String className) {
|
public void setCompactionStrategyClass(String className) {
|
||||||
log(" setCompactionStrategyClass(String className)");
|
log(" setCompactionStrategyClass(String className)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("class_name", className);
|
queryParams.add("class_name", className);
|
||||||
c.post("column_family/compaction_strategy/" + getCFName(), queryParams);
|
c.post("column_family/compaction_strategy/" + getCFName(), queryParams);
|
||||||
}
|
}
|
||||||
@ -548,7 +554,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
|||||||
*/
|
*/
|
||||||
public void setCompressionParameters(Map<String, String> opts) {
|
public void setCompressionParameters(Map<String, String> opts) {
|
||||||
log(" setCompressionParameters(Map<String,String> opts)");
|
log(" setCompressionParameters(Map<String,String> opts)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("opts", APIClient.mapToString(opts));
|
queryParams.add("opts", APIClient.mapToString(opts));
|
||||||
c.post("column_family/compression_parameters/" + getCFName(),
|
c.post("column_family/compression_parameters/" + getCFName(),
|
||||||
queryParams);
|
queryParams);
|
||||||
@ -559,7 +565,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
|||||||
*/
|
*/
|
||||||
public void setCrcCheckChance(double crcCheckChance) {
|
public void setCrcCheckChance(double crcCheckChance) {
|
||||||
log(" setCrcCheckChance(double crcCheckChance)");
|
log(" setCrcCheckChance(double crcCheckChance)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("check_chance", Double.toString(crcCheckChance));
|
queryParams.add("check_chance", Double.toString(crcCheckChance));
|
||||||
c.post("column_family/crc_check_chance/" + getCFName(), queryParams);
|
c.post("column_family/crc_check_chance/" + getCFName(), queryParams);
|
||||||
}
|
}
|
||||||
@ -633,7 +639,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
|||||||
*/
|
*/
|
||||||
public List<String> getSSTablesForKey(String key) {
|
public List<String> getSSTablesForKey(String key) {
|
||||||
log(" getSSTablesForKey(String key)");
|
log(" getSSTablesForKey(String key)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("key", key);
|
queryParams.add("key", key);
|
||||||
return c.getListStrValue("column_family/sstables/by_key/" + getCFName(),
|
return c.getListStrValue("column_family/sstables/by_key/" + getCFName(),
|
||||||
queryParams);
|
queryParams);
|
||||||
|
@ -23,12 +23,12 @@ import java.util.*;
|
|||||||
import javax.management.MBeanServer;
|
import javax.management.MBeanServer;
|
||||||
import javax.management.ObjectName;
|
import javax.management.ObjectName;
|
||||||
import javax.management.openmbean.TabularData;
|
import javax.management.openmbean.TabularData;
|
||||||
|
import javax.ws.rs.core.MultivaluedHashMap;
|
||||||
import javax.ws.rs.core.MultivaluedMap;
|
import javax.ws.rs.core.MultivaluedMap;
|
||||||
|
|
||||||
import org.apache.cassandra.metrics.CompactionMetrics;
|
import org.apache.cassandra.metrics.CompactionMetrics;
|
||||||
|
|
||||||
import com.cloudius.urchin.api.APIClient;
|
import com.cloudius.urchin.api.APIClient;
|
||||||
import com.sun.jersey.core.util.MultivaluedMapImpl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A singleton which manages a private executor of ongoing compactions.
|
* A singleton which manages a private executor of ongoing compactions.
|
||||||
@ -140,7 +140,7 @@ public class CompactionManager implements CompactionManagerMBean {
|
|||||||
*/
|
*/
|
||||||
public void forceUserDefinedCompaction(String dataFiles) {
|
public void forceUserDefinedCompaction(String dataFiles) {
|
||||||
log(" forceUserDefinedCompaction(String dataFiles)");
|
log(" forceUserDefinedCompaction(String dataFiles)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("dataFiles", dataFiles);
|
queryParams.add("dataFiles", dataFiles);
|
||||||
c.post("compaction_manager/compaction_manager/force_user_defined_compaction",
|
c.post("compaction_manager/compaction_manager/force_user_defined_compaction",
|
||||||
queryParams);
|
queryParams);
|
||||||
@ -155,7 +155,7 @@ public class CompactionManager implements CompactionManagerMBean {
|
|||||||
*/
|
*/
|
||||||
public void stopCompaction(String type) {
|
public void stopCompaction(String type) {
|
||||||
log(" stopCompaction(String type)");
|
log(" stopCompaction(String type)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("type", type);
|
queryParams.add("type", type);
|
||||||
c.post("compaction_manager/compaction_manager/stop_compaction",
|
c.post("compaction_manager/compaction_manager/stop_compaction",
|
||||||
queryParams);
|
queryParams);
|
||||||
|
@ -28,10 +28,10 @@ import java.net.UnknownHostException;
|
|||||||
|
|
||||||
import javax.management.MBeanServer;
|
import javax.management.MBeanServer;
|
||||||
import javax.management.ObjectName;
|
import javax.management.ObjectName;
|
||||||
|
import javax.ws.rs.core.MultivaluedHashMap;
|
||||||
import javax.ws.rs.core.MultivaluedMap;
|
import javax.ws.rs.core.MultivaluedMap;
|
||||||
|
|
||||||
import com.cloudius.urchin.api.APIClient;
|
import com.cloudius.urchin.api.APIClient;
|
||||||
import com.sun.jersey.core.util.MultivaluedMapImpl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This module is responsible for Gossiping information for the local endpoint.
|
* This module is responsible for Gossiping information for the local endpoint.
|
||||||
@ -91,7 +91,7 @@ public class Gossiper implements GossiperMBean {
|
|||||||
public void unsafeAssassinateEndpoint(String address)
|
public void unsafeAssassinateEndpoint(String address)
|
||||||
throws UnknownHostException {
|
throws UnknownHostException {
|
||||||
log(" unsafeAssassinateEndpoint(String address) throws UnknownHostException");
|
log(" unsafeAssassinateEndpoint(String address) throws UnknownHostException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("unsafe", "True");
|
queryParams.add("unsafe", "True");
|
||||||
c.post("gossiper/assassinate/" + address, queryParams);
|
c.post("gossiper/assassinate/" + address, queryParams);
|
||||||
}
|
}
|
||||||
|
@ -23,10 +23,10 @@ import java.net.UnknownHostException;
|
|||||||
|
|
||||||
import javax.management.MBeanServer;
|
import javax.management.MBeanServer;
|
||||||
import javax.management.ObjectName;
|
import javax.management.ObjectName;
|
||||||
|
import javax.ws.rs.core.MultivaluedHashMap;
|
||||||
import javax.ws.rs.core.MultivaluedMap;
|
import javax.ws.rs.core.MultivaluedMap;
|
||||||
|
|
||||||
import com.cloudius.urchin.api.APIClient;
|
import com.cloudius.urchin.api.APIClient;
|
||||||
import com.sun.jersey.core.util.MultivaluedMapImpl;
|
|
||||||
|
|
||||||
public class EndpointSnitchInfo implements EndpointSnitchInfoMBean {
|
public class EndpointSnitchInfo implements EndpointSnitchInfoMBean {
|
||||||
private static final java.util.logging.Logger logger = java.util.logging.Logger
|
private static final java.util.logging.Logger logger = java.util.logging.Logger
|
||||||
@ -64,7 +64,7 @@ public class EndpointSnitchInfo implements EndpointSnitchInfoMBean {
|
|||||||
@Override
|
@Override
|
||||||
public String getRack(String host) throws UnknownHostException {
|
public String getRack(String host) throws UnknownHostException {
|
||||||
log("getRack(String host) throws UnknownHostException");
|
log("getRack(String host) throws UnknownHostException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
if (host == null) {
|
if (host == null) {
|
||||||
host = InetAddress.getLoopbackAddress().getHostAddress();
|
host = InetAddress.getLoopbackAddress().getHostAddress();
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ public class EndpointSnitchInfo implements EndpointSnitchInfoMBean {
|
|||||||
@Override
|
@Override
|
||||||
public String getDatacenter(String host) throws UnknownHostException {
|
public String getDatacenter(String host) throws UnknownHostException {
|
||||||
log(" getDatacenter(String host) throws UnknownHostException");
|
log(" getDatacenter(String host) throws UnknownHostException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
if (host == null) {
|
if (host == null) {
|
||||||
host = InetAddress.getLoopbackAddress().getHostAddress();
|
host = InetAddress.getLoopbackAddress().getHostAddress();
|
||||||
}
|
}
|
||||||
|
@ -29,12 +29,12 @@ import java.util.concurrent.ExecutionException;
|
|||||||
|
|
||||||
import javax.management.MBeanServer;
|
import javax.management.MBeanServer;
|
||||||
import javax.management.ObjectName;
|
import javax.management.ObjectName;
|
||||||
|
import javax.ws.rs.core.MultivaluedHashMap;
|
||||||
import javax.ws.rs.core.MultivaluedMap;
|
import javax.ws.rs.core.MultivaluedMap;
|
||||||
|
|
||||||
import org.apache.cassandra.metrics.CacheMetrics;
|
import org.apache.cassandra.metrics.CacheMetrics;
|
||||||
|
|
||||||
import com.cloudius.urchin.api.APIClient;
|
import com.cloudius.urchin.api.APIClient;
|
||||||
import com.sun.jersey.core.util.MultivaluedMapImpl;
|
|
||||||
|
|
||||||
public class CacheService implements CacheServiceMBean {
|
public class CacheService implements CacheServiceMBean {
|
||||||
private static final java.util.logging.Logger logger = java.util.logging.Logger
|
private static final java.util.logging.Logger logger = java.util.logging.Logger
|
||||||
@ -77,7 +77,7 @@ public class CacheService implements CacheServiceMBean {
|
|||||||
|
|
||||||
public void setRowCacheSavePeriodInSeconds(int rcspis) {
|
public void setRowCacheSavePeriodInSeconds(int rcspis) {
|
||||||
log(" setRowCacheSavePeriodInSeconds(int rcspis)");
|
log(" setRowCacheSavePeriodInSeconds(int rcspis)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("period", Integer.toString(rcspis));
|
queryParams.add("period", Integer.toString(rcspis));
|
||||||
c.post("cache_service/row_cache_save_period", queryParams);
|
c.post("cache_service/row_cache_save_period", queryParams);
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ public class CacheService implements CacheServiceMBean {
|
|||||||
|
|
||||||
public void setKeyCacheSavePeriodInSeconds(int kcspis) {
|
public void setKeyCacheSavePeriodInSeconds(int kcspis) {
|
||||||
log(" setKeyCacheSavePeriodInSeconds(int kcspis)");
|
log(" setKeyCacheSavePeriodInSeconds(int kcspis)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("period", Integer.toString(kcspis));
|
queryParams.add("period", Integer.toString(kcspis));
|
||||||
c.post("cache_service/key_cache_save_period", queryParams);
|
c.post("cache_service/key_cache_save_period", queryParams);
|
||||||
}
|
}
|
||||||
@ -101,7 +101,7 @@ public class CacheService implements CacheServiceMBean {
|
|||||||
|
|
||||||
public void setCounterCacheSavePeriodInSeconds(int ccspis) {
|
public void setCounterCacheSavePeriodInSeconds(int ccspis) {
|
||||||
log(" setCounterCacheSavePeriodInSeconds(int ccspis)");
|
log(" setCounterCacheSavePeriodInSeconds(int ccspis)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("ccspis", Integer.toString(ccspis));
|
queryParams.add("ccspis", Integer.toString(ccspis));
|
||||||
c.post("cache_service/counter_cache_save_period", queryParams);
|
c.post("cache_service/counter_cache_save_period", queryParams);
|
||||||
}
|
}
|
||||||
@ -113,7 +113,7 @@ public class CacheService implements CacheServiceMBean {
|
|||||||
|
|
||||||
public void setRowCacheKeysToSave(int rckts) {
|
public void setRowCacheKeysToSave(int rckts) {
|
||||||
log(" setRowCacheKeysToSave(int rckts)");
|
log(" setRowCacheKeysToSave(int rckts)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("rckts", Integer.toString(rckts));
|
queryParams.add("rckts", Integer.toString(rckts));
|
||||||
c.post("cache_service/row_cache_keys_to_save", queryParams);
|
c.post("cache_service/row_cache_keys_to_save", queryParams);
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ public class CacheService implements CacheServiceMBean {
|
|||||||
|
|
||||||
public void setKeyCacheKeysToSave(int kckts) {
|
public void setKeyCacheKeysToSave(int kckts) {
|
||||||
log(" setKeyCacheKeysToSave(int kckts)");
|
log(" setKeyCacheKeysToSave(int kckts)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("kckts", Integer.toString(kckts));
|
queryParams.add("kckts", Integer.toString(kckts));
|
||||||
c.post("cache_service/key_cache_keys_to_save", queryParams);
|
c.post("cache_service/key_cache_keys_to_save", queryParams);
|
||||||
}
|
}
|
||||||
@ -137,7 +137,7 @@ public class CacheService implements CacheServiceMBean {
|
|||||||
|
|
||||||
public void setCounterCacheKeysToSave(int cckts) {
|
public void setCounterCacheKeysToSave(int cckts) {
|
||||||
log(" setCounterCacheKeysToSave(int cckts)");
|
log(" setCounterCacheKeysToSave(int cckts)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("cckts", Integer.toString(cckts));
|
queryParams.add("cckts", Integer.toString(cckts));
|
||||||
c.post("cache_service/counter_cache_keys_to_save", queryParams);
|
c.post("cache_service/counter_cache_keys_to_save", queryParams);
|
||||||
}
|
}
|
||||||
@ -165,21 +165,21 @@ public class CacheService implements CacheServiceMBean {
|
|||||||
|
|
||||||
public void setRowCacheCapacityInMB(long capacity) {
|
public void setRowCacheCapacityInMB(long capacity) {
|
||||||
log(" setRowCacheCapacityInMB(long capacity)");
|
log(" setRowCacheCapacityInMB(long capacity)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("capacity", Long.toString(capacity));
|
queryParams.add("capacity", Long.toString(capacity));
|
||||||
c.post("cache_service/row_cache_capacity", queryParams);
|
c.post("cache_service/row_cache_capacity", queryParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setKeyCacheCapacityInMB(long capacity) {
|
public void setKeyCacheCapacityInMB(long capacity) {
|
||||||
log(" setKeyCacheCapacityInMB(long capacity)");
|
log(" setKeyCacheCapacityInMB(long capacity)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("capacity", Long.toString(capacity));
|
queryParams.add("capacity", Long.toString(capacity));
|
||||||
c.post("cache_service/key_cache_capacity", queryParams);
|
c.post("cache_service/key_cache_capacity", queryParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCounterCacheCapacityInMB(long capacity) {
|
public void setCounterCacheCapacityInMB(long capacity) {
|
||||||
log(" setCounterCacheCapacityInMB(long capacity)");
|
log(" setCounterCacheCapacityInMB(long capacity)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("capacity", Long.toString(capacity));
|
queryParams.add("capacity", Long.toString(capacity));
|
||||||
c.post("cache_service/counter_cache_capacity_in_mb", queryParams);
|
c.post("cache_service/counter_cache_capacity_in_mb", queryParams);
|
||||||
}
|
}
|
||||||
|
@ -28,10 +28,10 @@ import java.util.*;
|
|||||||
|
|
||||||
import javax.management.MBeanServer;
|
import javax.management.MBeanServer;
|
||||||
import javax.management.ObjectName;
|
import javax.management.ObjectName;
|
||||||
|
import javax.ws.rs.core.MultivaluedHashMap;
|
||||||
import javax.ws.rs.core.MultivaluedMap;
|
import javax.ws.rs.core.MultivaluedMap;
|
||||||
|
|
||||||
import com.cloudius.urchin.api.APIClient;
|
import com.cloudius.urchin.api.APIClient;
|
||||||
import com.sun.jersey.core.util.MultivaluedMapImpl;
|
|
||||||
|
|
||||||
import org.apache.cassandra.metrics.*;
|
import org.apache.cassandra.metrics.*;
|
||||||
|
|
||||||
@ -203,14 +203,14 @@ public class StorageProxy implements StorageProxyMBean {
|
|||||||
|
|
||||||
public void setHintedHandoffEnabled(boolean b) {
|
public void setHintedHandoffEnabled(boolean b) {
|
||||||
log(" setHintedHandoffEnabled(boolean b)");
|
log(" setHintedHandoffEnabled(boolean b)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("enable", Boolean.toString(b));
|
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) {
|
public void setHintedHandoffEnabledByDCList(String dcs) {
|
||||||
log(" setHintedHandoffEnabledByDCList(String dcs)");
|
log(" setHintedHandoffEnabledByDCList(String dcs)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("dcs", dcs);
|
queryParams.add("dcs", dcs);
|
||||||
c.post("storage_proxy/hinted_handoff_enabled_by_dc_list");
|
c.post("storage_proxy/hinted_handoff_enabled_by_dc_list");
|
||||||
}
|
}
|
||||||
@ -222,7 +222,7 @@ public class StorageProxy implements StorageProxyMBean {
|
|||||||
|
|
||||||
public void setMaxHintWindow(int ms) {
|
public void setMaxHintWindow(int ms) {
|
||||||
log(" setMaxHintWindow(int ms)");
|
log(" setMaxHintWindow(int ms)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("ms", Integer.toString(ms));
|
queryParams.add("ms", Integer.toString(ms));
|
||||||
c.post("storage_proxy/max_hint_window", queryParams);
|
c.post("storage_proxy/max_hint_window", queryParams);
|
||||||
}
|
}
|
||||||
@ -234,7 +234,7 @@ public class StorageProxy implements StorageProxyMBean {
|
|||||||
|
|
||||||
public void setMaxHintsInProgress(int qs) {
|
public void setMaxHintsInProgress(int qs) {
|
||||||
log(" setMaxHintsInProgress(int qs)");
|
log(" setMaxHintsInProgress(int qs)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("qs", Integer.toString(qs));
|
queryParams.add("qs", Integer.toString(qs));
|
||||||
c.post("storage_proxy/max_hints_in_progress", queryParams);
|
c.post("storage_proxy/max_hints_in_progress", queryParams);
|
||||||
}
|
}
|
||||||
@ -251,7 +251,7 @@ public class StorageProxy implements StorageProxyMBean {
|
|||||||
|
|
||||||
public void setRpcTimeout(Long timeoutInMillis) {
|
public void setRpcTimeout(Long timeoutInMillis) {
|
||||||
log(" setRpcTimeout(Long timeoutInMillis)");
|
log(" setRpcTimeout(Long timeoutInMillis)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
||||||
c.post("storage_proxy/rpc_timeout", queryParams);
|
c.post("storage_proxy/rpc_timeout", queryParams);
|
||||||
}
|
}
|
||||||
@ -263,7 +263,7 @@ public class StorageProxy implements StorageProxyMBean {
|
|||||||
|
|
||||||
public void setReadRpcTimeout(Long timeoutInMillis) {
|
public void setReadRpcTimeout(Long timeoutInMillis) {
|
||||||
log(" setReadRpcTimeout(Long timeoutInMillis)");
|
log(" setReadRpcTimeout(Long timeoutInMillis)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
||||||
c.post("storage_proxy/read_rpc_timeout", queryParams);
|
c.post("storage_proxy/read_rpc_timeout", queryParams);
|
||||||
}
|
}
|
||||||
@ -275,7 +275,7 @@ public class StorageProxy implements StorageProxyMBean {
|
|||||||
|
|
||||||
public void setWriteRpcTimeout(Long timeoutInMillis) {
|
public void setWriteRpcTimeout(Long timeoutInMillis) {
|
||||||
log(" setWriteRpcTimeout(Long timeoutInMillis)");
|
log(" setWriteRpcTimeout(Long timeoutInMillis)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
||||||
c.post("storage_proxy/write_rpc_timeout", queryParams);
|
c.post("storage_proxy/write_rpc_timeout", queryParams);
|
||||||
}
|
}
|
||||||
@ -287,7 +287,7 @@ public class StorageProxy implements StorageProxyMBean {
|
|||||||
|
|
||||||
public void setCounterWriteRpcTimeout(Long timeoutInMillis) {
|
public void setCounterWriteRpcTimeout(Long timeoutInMillis) {
|
||||||
log(" setCounterWriteRpcTimeout(Long timeoutInMillis)");
|
log(" setCounterWriteRpcTimeout(Long timeoutInMillis)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
||||||
c.post("storage_proxy/counter_write_rpc_timeout", queryParams);
|
c.post("storage_proxy/counter_write_rpc_timeout", queryParams);
|
||||||
}
|
}
|
||||||
@ -299,7 +299,7 @@ public class StorageProxy implements StorageProxyMBean {
|
|||||||
|
|
||||||
public void setCasContentionTimeout(Long timeoutInMillis) {
|
public void setCasContentionTimeout(Long timeoutInMillis) {
|
||||||
log(" setCasContentionTimeout(Long timeoutInMillis)");
|
log(" setCasContentionTimeout(Long timeoutInMillis)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
||||||
c.post("storage_proxy/cas_contention_timeout", queryParams);
|
c.post("storage_proxy/cas_contention_timeout", queryParams);
|
||||||
}
|
}
|
||||||
@ -311,7 +311,7 @@ public class StorageProxy implements StorageProxyMBean {
|
|||||||
|
|
||||||
public void setRangeRpcTimeout(Long timeoutInMillis) {
|
public void setRangeRpcTimeout(Long timeoutInMillis) {
|
||||||
log(" setRangeRpcTimeout(Long timeoutInMillis)");
|
log(" setRangeRpcTimeout(Long timeoutInMillis)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
||||||
c.post("storage_proxy/range_rpc_timeout", queryParams);
|
c.post("storage_proxy/range_rpc_timeout", queryParams);
|
||||||
}
|
}
|
||||||
@ -323,7 +323,7 @@ public class StorageProxy implements StorageProxyMBean {
|
|||||||
|
|
||||||
public void setTruncateRpcTimeout(Long timeoutInMillis) {
|
public void setTruncateRpcTimeout(Long timeoutInMillis) {
|
||||||
log(" setTruncateRpcTimeout(Long timeoutInMillis)");
|
log(" setTruncateRpcTimeout(Long timeoutInMillis)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
queryParams.add("timeout", Long.toString(timeoutInMillis));
|
||||||
c.post("storage_proxy/truncate_rpc_timeout", queryParams);
|
c.post("storage_proxy/truncate_rpc_timeout", queryParams);
|
||||||
}
|
}
|
||||||
|
@ -33,12 +33,12 @@ import java.util.concurrent.atomic.AtomicLong;
|
|||||||
|
|
||||||
import javax.management.*;
|
import javax.management.*;
|
||||||
import javax.management.openmbean.TabularData;
|
import javax.management.openmbean.TabularData;
|
||||||
|
import javax.ws.rs.core.MultivaluedHashMap;
|
||||||
import javax.ws.rs.core.MultivaluedMap;
|
import javax.ws.rs.core.MultivaluedMap;
|
||||||
|
|
||||||
import org.apache.cassandra.metrics.StorageMetrics;
|
import org.apache.cassandra.metrics.StorageMetrics;
|
||||||
import org.apache.cassandra.repair.RepairParallelism;
|
import org.apache.cassandra.repair.RepairParallelism;
|
||||||
import com.cloudius.urchin.api.APIClient;
|
import com.cloudius.urchin.api.APIClient;
|
||||||
import com.sun.jersey.core.util.MultivaluedMapImpl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This abstraction contains the token/identifier of this node on the identifier
|
* This abstraction contains the token/identifier of this node on the identifier
|
||||||
@ -234,7 +234,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
public Map<List<String>, List<String>> getRangeToRpcaddressMap(
|
public Map<List<String>, List<String>> getRangeToRpcaddressMap(
|
||||||
String keyspace) {
|
String keyspace) {
|
||||||
log(" getRangeToRpcaddressMap(String keyspace)");
|
log(" getRangeToRpcaddressMap(String keyspace)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("rpc", "true");
|
queryParams.add("rpc", "true");
|
||||||
return c.getMapListStrValue("/storage_service/range/" + keyspace,
|
return c.getMapListStrValue("/storage_service/range/" + keyspace,
|
||||||
queryParams);
|
queryParams);
|
||||||
@ -340,7 +340,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
public List<InetAddress> getNaturalEndpoints(String keyspaceName, String cf,
|
public List<InetAddress> getNaturalEndpoints(String keyspaceName, String cf,
|
||||||
String key) {
|
String key) {
|
||||||
log(" getNaturalEndpoints(String keyspaceName, String cf, String key)");
|
log(" getNaturalEndpoints(String keyspaceName, String cf, String key)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("cf", cf);
|
queryParams.add("cf", cf);
|
||||||
queryParams.add("key", key);
|
queryParams.add("key", key);
|
||||||
return c.getListInetAddressValue(
|
return c.getListInetAddressValue(
|
||||||
@ -366,7 +366,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
public void takeSnapshot(String tag, String... keyspaceNames)
|
public void takeSnapshot(String tag, String... keyspaceNames)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
log(" takeSnapshot(String tag, String... keyspaceNames) throws IOException");
|
log(" takeSnapshot(String tag, String... keyspaceNames) throws IOException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
APIClient.set_query_param(queryParams, "tag", tag);
|
APIClient.set_query_param(queryParams, "tag", tag);
|
||||||
APIClient.set_query_param(queryParams, "kn",
|
APIClient.set_query_param(queryParams, "kn",
|
||||||
APIClient.join(keyspaceNames));
|
APIClient.join(keyspaceNames));
|
||||||
@ -387,7 +387,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
public void takeColumnFamilySnapshot(String keyspaceName,
|
public void takeColumnFamilySnapshot(String keyspaceName,
|
||||||
String columnFamilyName, String tag) throws IOException {
|
String columnFamilyName, String tag) throws IOException {
|
||||||
log(" takeColumnFamilySnapshot(String keyspaceName, String columnFamilyName, String tag) throws IOException");
|
log(" takeColumnFamilySnapshot(String keyspaceName, String columnFamilyName, String tag) throws IOException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
if (keyspaceName == null)
|
if (keyspaceName == null)
|
||||||
throw new IOException("You must supply a keyspace name");
|
throw new IOException("You must supply a keyspace name");
|
||||||
if (columnFamilyName == null)
|
if (columnFamilyName == null)
|
||||||
@ -407,7 +407,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
public void clearSnapshot(String tag, String... keyspaceNames)
|
public void clearSnapshot(String tag, String... keyspaceNames)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
log(" clearSnapshot(String tag, String... keyspaceNames) throws IOException");
|
log(" clearSnapshot(String tag, String... keyspaceNames) throws IOException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
APIClient.set_query_param(queryParams, "tag", tag);
|
APIClient.set_query_param(queryParams, "tag", tag);
|
||||||
APIClient.set_query_param(queryParams, "kn",
|
APIClient.set_query_param(queryParams, "kn",
|
||||||
APIClient.join(keyspaceNames));
|
APIClient.join(keyspaceNames));
|
||||||
@ -442,7 +442,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
String... columnFamilies) throws IOException, ExecutionException,
|
String... columnFamilies) throws IOException, ExecutionException,
|
||||||
InterruptedException {
|
InterruptedException {
|
||||||
log(" forceKeyspaceCompaction(String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
|
log(" forceKeyspaceCompaction(String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
APIClient.set_query_param(queryParams, "cf",
|
APIClient.set_query_param(queryParams, "cf",
|
||||||
APIClient.join(columnFamilies));
|
APIClient.join(columnFamilies));
|
||||||
c.post("/storage_service/keyspace_compaction/" + keyspaceName,
|
c.post("/storage_service/keyspace_compaction/" + keyspaceName,
|
||||||
@ -456,7 +456,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
String... columnFamilies) throws IOException, ExecutionException,
|
String... columnFamilies) throws IOException, ExecutionException,
|
||||||
InterruptedException {
|
InterruptedException {
|
||||||
log(" forceKeyspaceCleanup(String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
|
log(" forceKeyspaceCleanup(String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
APIClient.set_query_param(queryParams, "cf",
|
APIClient.set_query_param(queryParams, "cf",
|
||||||
APIClient.join(columnFamilies));
|
APIClient.join(columnFamilies));
|
||||||
return c.postInt("/storage_service/keyspace_cleanup/" + keyspaceName,
|
return c.postInt("/storage_service/keyspace_cleanup/" + keyspaceName,
|
||||||
@ -474,7 +474,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
String keyspaceName, String... columnFamilies) throws IOException,
|
String keyspaceName, String... columnFamilies) throws IOException,
|
||||||
ExecutionException, InterruptedException {
|
ExecutionException, InterruptedException {
|
||||||
log(" scrub(boolean disableSnapshot, boolean skipCorrupted, String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
|
log(" scrub(boolean disableSnapshot, boolean skipCorrupted, String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
APIClient.set_bool_query_param(queryParams, "disable_snapshot",
|
APIClient.set_bool_query_param(queryParams, "disable_snapshot",
|
||||||
disableSnapshot);
|
disableSnapshot);
|
||||||
APIClient.set_bool_query_param(queryParams, "skip_corrupted",
|
APIClient.set_bool_query_param(queryParams, "skip_corrupted",
|
||||||
@ -493,7 +493,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
throws IOException, ExecutionException,
|
throws IOException, ExecutionException,
|
||||||
InterruptedException {
|
InterruptedException {
|
||||||
log(" upgradeSSTables(String keyspaceName, boolean excludeCurrentVersion, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
|
log(" upgradeSSTables(String keyspaceName, boolean excludeCurrentVersion, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
APIClient.set_bool_query_param(queryParams, "exclude_current_version",
|
APIClient.set_bool_query_param(queryParams, "exclude_current_version",
|
||||||
excludeCurrentVersion);
|
excludeCurrentVersion);
|
||||||
APIClient.set_query_param(queryParams, "cf",
|
APIClient.set_query_param(queryParams, "cf",
|
||||||
@ -514,7 +514,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
String... columnFamilies) throws IOException, ExecutionException,
|
String... columnFamilies) throws IOException, ExecutionException,
|
||||||
InterruptedException {
|
InterruptedException {
|
||||||
log(" forceKeyspaceFlush(String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
|
log(" forceKeyspaceFlush(String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
APIClient.set_query_param(queryParams, "cf",
|
APIClient.set_query_param(queryParams, "cf",
|
||||||
APIClient.join(columnFamilies));
|
APIClient.join(columnFamilies));
|
||||||
c.post("/storage_service/keyspace_flush/" + keyspaceName, queryParams);
|
c.post("/storage_service/keyspace_flush/" + keyspaceName, queryParams);
|
||||||
@ -525,7 +525,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
int id;
|
int id;
|
||||||
String keyspace;
|
String keyspace;
|
||||||
String message;
|
String message;
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
int cmd;
|
int cmd;
|
||||||
public CheckRepair(int id, String keyspace) {
|
public CheckRepair(int id, String keyspace) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@ -598,7 +598,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
*/
|
*/
|
||||||
public int repairAsync(String keyspace, Map<String, String> options) {
|
public int repairAsync(String keyspace, Map<String, String> options) {
|
||||||
log(" repairAsync(String keyspace, Map<String, String> options)");
|
log(" repairAsync(String keyspace, Map<String, String> options)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
String opts = "";
|
String opts = "";
|
||||||
for (String op : options.keySet()) {
|
for (String op : options.keySet()) {
|
||||||
if (!opts.equals("")) {
|
if (!opts.equals("")) {
|
||||||
@ -681,7 +681,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
*/
|
*/
|
||||||
public void move(String newToken) throws IOException {
|
public void move(String newToken) throws IOException {
|
||||||
log(" move(String newToken) throws IOException");
|
log(" move(String newToken) throws IOException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
APIClient.set_query_param(queryParams, "new_token", newToken);
|
APIClient.set_query_param(queryParams, "new_token", newToken);
|
||||||
c.post("/storage_service/move");
|
c.post("/storage_service/move");
|
||||||
}
|
}
|
||||||
@ -693,7 +693,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
*/
|
*/
|
||||||
public void removeNode(String hostIdString) {
|
public void removeNode(String hostIdString) {
|
||||||
log(" removeNode(String token)");
|
log(" removeNode(String token)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
APIClient.set_query_param(queryParams, "host_id", hostIdString);
|
APIClient.set_query_param(queryParams, "host_id", hostIdString);
|
||||||
c.post("/storage_service/remove_node", queryParams);
|
c.post("/storage_service/remove_node", queryParams);
|
||||||
}
|
}
|
||||||
@ -736,7 +736,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
public void setLoggingLevel(String classQualifier, String level)
|
public void setLoggingLevel(String classQualifier, String level)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
log(" setLoggingLevel(String classQualifier, String level) throws Exception");
|
log(" setLoggingLevel(String classQualifier, String level) throws Exception");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
APIClient.set_query_param(queryParams, "level", level);
|
APIClient.set_query_param(queryParams, "level", level);
|
||||||
APIClient.set_query_param(queryParams, "class_qualifier",
|
APIClient.set_query_param(queryParams, "class_qualifier",
|
||||||
classQualifier);
|
classQualifier);
|
||||||
@ -795,7 +795,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
public void truncate(String keyspace, String columnFamily)
|
public void truncate(String keyspace, String columnFamily)
|
||||||
throws TimeoutException, IOException {
|
throws TimeoutException, IOException {
|
||||||
log(" truncate(String keyspace, String columnFamily)throws TimeoutException, IOException");
|
log(" truncate(String keyspace, String columnFamily)throws TimeoutException, IOException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
APIClient.set_query_param(queryParams, "cf", columnFamily);
|
APIClient.set_query_param(queryParams, "cf", columnFamily);
|
||||||
c.post("/storage_service/truncate/" + keyspace, queryParams);
|
c.post("/storage_service/truncate/" + keyspace, queryParams);
|
||||||
}
|
}
|
||||||
@ -828,7 +828,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
|
|
||||||
public List<String> getKeyspaces() {
|
public List<String> getKeyspaces() {
|
||||||
log(" getKeyspaces()");
|
log(" getKeyspaces()");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("non_system", "true");
|
queryParams.add("non_system", "true");
|
||||||
return c.getListStrValue("/storage_service/keyspaces", queryParams);
|
return c.getListStrValue("/storage_service/keyspaces", queryParams);
|
||||||
}
|
}
|
||||||
@ -858,7 +858,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
Integer dynamicUpdateInterval, Integer dynamicResetInterval,
|
Integer dynamicUpdateInterval, Integer dynamicResetInterval,
|
||||||
Double dynamicBadnessThreshold) throws ClassNotFoundException {
|
Double dynamicBadnessThreshold) throws ClassNotFoundException {
|
||||||
log(" updateSnitch(String epSnitchClassName, Boolean dynamic, Integer dynamicUpdateInterval, Integer dynamicResetInterval, Double dynamicBadnessThreshold) throws ClassNotFoundException");
|
log(" updateSnitch(String epSnitchClassName, Boolean dynamic, Integer dynamicUpdateInterval, Integer dynamicResetInterval, Double dynamicBadnessThreshold) throws ClassNotFoundException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
APIClient.set_bool_query_param(queryParams, "dynamic", dynamic);
|
APIClient.set_bool_query_param(queryParams, "dynamic", dynamic);
|
||||||
APIClient.set_query_param(queryParams, "epSnitchClassName",
|
APIClient.set_query_param(queryParams, "epSnitchClassName",
|
||||||
epSnitchClassName);
|
epSnitchClassName);
|
||||||
@ -959,10 +959,9 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
|
|
||||||
public void setStreamThroughputMbPerSec(int value) {
|
public void setStreamThroughputMbPerSec(int value) {
|
||||||
log(" setStreamThroughputMbPerSec(int value)");
|
log(" setStreamThroughputMbPerSec(int value)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("value", Integer.toString(value));
|
queryParams.add("value", Integer.toString(value));
|
||||||
c.post("/storage_service/stream_throughput", queryParams);
|
c.post("/storage_service/stream_throughput", queryParams);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getStreamThroughputMbPerSec() {
|
public int getStreamThroughputMbPerSec() {
|
||||||
@ -977,7 +976,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
|
|
||||||
public void setCompactionThroughputMbPerSec(int value) {
|
public void setCompactionThroughputMbPerSec(int value) {
|
||||||
log(" setCompactionThroughputMbPerSec(int value)");
|
log(" setCompactionThroughputMbPerSec(int value)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("value", Integer.toString(value));
|
queryParams.add("value", Integer.toString(value));
|
||||||
c.post("/storage_service/compaction_throughput", queryParams);
|
c.post("/storage_service/compaction_throughput", queryParams);
|
||||||
}
|
}
|
||||||
@ -989,7 +988,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
|
|
||||||
public void setIncrementalBackupsEnabled(boolean value) {
|
public void setIncrementalBackupsEnabled(boolean value) {
|
||||||
log(" setIncrementalBackupsEnabled(boolean value)");
|
log(" setIncrementalBackupsEnabled(boolean value)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("value", Boolean.toString(value));
|
queryParams.add("value", Boolean.toString(value));
|
||||||
c.post("/storage_service/incremental_backups", queryParams);
|
c.post("/storage_service/incremental_backups", queryParams);
|
||||||
}
|
}
|
||||||
@ -1006,7 +1005,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
*/
|
*/
|
||||||
public void rebuild(String sourceDc) {
|
public void rebuild(String sourceDc) {
|
||||||
log(" rebuild(String sourceDc)");
|
log(" rebuild(String sourceDc)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
APIClient.set_query_param(queryParams, "value", sourceDc);
|
APIClient.set_query_param(queryParams, "value", sourceDc);
|
||||||
c.post("/storage_service/rebuild", queryParams);
|
c.post("/storage_service/rebuild", queryParams);
|
||||||
}
|
}
|
||||||
@ -1042,7 +1041,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
*/
|
*/
|
||||||
public void loadNewSSTables(String ksName, String cfName) {
|
public void loadNewSSTables(String ksName, String cfName) {
|
||||||
log(" loadNewSSTables(String ksName, String cfName)");
|
log(" loadNewSSTables(String ksName, String cfName)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("cf", cfName);
|
queryParams.add("cf", cfName);
|
||||||
c.post("/storage_service/sstables/" + ksName, queryParams);
|
c.post("/storage_service/sstables/" + ksName, queryParams);
|
||||||
}
|
}
|
||||||
@ -1087,7 +1086,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
*/
|
*/
|
||||||
public void setTraceProbability(double probability) {
|
public void setTraceProbability(double probability) {
|
||||||
log(" setTraceProbability(double probability)");
|
log(" setTraceProbability(double probability)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("probability", Double.toString(probability));
|
queryParams.add("probability", Double.toString(probability));
|
||||||
c.post("/storage_service/trace_probability", queryParams);
|
c.post("/storage_service/trace_probability", queryParams);
|
||||||
}
|
}
|
||||||
@ -1103,7 +1102,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
public void disableAutoCompaction(String ks, String... columnFamilies)
|
public void disableAutoCompaction(String ks, String... columnFamilies)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
log("disableAutoCompaction(String ks, String... columnFamilies)");
|
log("disableAutoCompaction(String ks, String... columnFamilies)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
APIClient.set_query_param(queryParams, "cf",
|
APIClient.set_query_param(queryParams, "cf",
|
||||||
APIClient.join(columnFamilies));
|
APIClient.join(columnFamilies));
|
||||||
c.delete("/storage_service/auto_compaction/", queryParams);
|
c.delete("/storage_service/auto_compaction/", queryParams);
|
||||||
@ -1112,16 +1111,21 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
public void enableAutoCompaction(String ks, String... columnFamilies)
|
public void enableAutoCompaction(String ks, String... columnFamilies)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
log("enableAutoCompaction(String ks, String... columnFamilies)");
|
log("enableAutoCompaction(String ks, String... columnFamilies)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
APIClient.set_query_param(queryParams, "cf",
|
APIClient.set_query_param(queryParams, "cf",
|
||||||
APIClient.join(columnFamilies));
|
APIClient.join(columnFamilies));
|
||||||
|
try {
|
||||||
c.post("/storage_service/auto_compaction/", queryParams);
|
c.post("/storage_service/auto_compaction/", queryParams);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
// FIXME should throw the right exception
|
||||||
|
throw new IOException(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deliverHints(String host) throws UnknownHostException {
|
public void deliverHints(String host) throws UnknownHostException {
|
||||||
log(" deliverHints(String host) throws UnknownHostException");
|
log(" deliverHints(String host) throws UnknownHostException");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("host", host);
|
queryParams.add("host", host);
|
||||||
c.post("/storage_service/deliver_hints", queryParams);
|
c.post("/storage_service/deliver_hints", queryParams);
|
||||||
}
|
}
|
||||||
@ -1147,7 +1151,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
/** Sets the threshold for warning queries with many tombstones */
|
/** Sets the threshold for warning queries with many tombstones */
|
||||||
public void setTombstoneWarnThreshold(int tombstoneDebugThreshold) {
|
public void setTombstoneWarnThreshold(int tombstoneDebugThreshold) {
|
||||||
log(" setTombstoneWarnThreshold(int tombstoneDebugThreshold)");
|
log(" setTombstoneWarnThreshold(int tombstoneDebugThreshold)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("debug_threshold",
|
queryParams.add("debug_threshold",
|
||||||
Integer.toString(tombstoneDebugThreshold));
|
Integer.toString(tombstoneDebugThreshold));
|
||||||
c.post("/storage_service/tombstone_warn_threshold", queryParams);
|
c.post("/storage_service/tombstone_warn_threshold", queryParams);
|
||||||
@ -1162,7 +1166,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
/** Sets the threshold for abandoning queries with many tombstones */
|
/** Sets the threshold for abandoning queries with many tombstones */
|
||||||
public void setTombstoneFailureThreshold(int tombstoneDebugThreshold) {
|
public void setTombstoneFailureThreshold(int tombstoneDebugThreshold) {
|
||||||
log(" setTombstoneFailureThreshold(int tombstoneDebugThreshold)");
|
log(" setTombstoneFailureThreshold(int tombstoneDebugThreshold)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("debug_threshold",
|
queryParams.add("debug_threshold",
|
||||||
Integer.toString(tombstoneDebugThreshold));
|
Integer.toString(tombstoneDebugThreshold));
|
||||||
c.post("/storage_service/tombstone_failure_threshold", queryParams);
|
c.post("/storage_service/tombstone_failure_threshold", queryParams);
|
||||||
@ -1177,7 +1181,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
/** Sets the threshold for rejecting queries due to a large batch size */
|
/** Sets the threshold for rejecting queries due to a large batch size */
|
||||||
public void setBatchSizeFailureThreshold(int batchSizeDebugThreshold) {
|
public void setBatchSizeFailureThreshold(int batchSizeDebugThreshold) {
|
||||||
log(" setBatchSizeFailureThreshold(int batchSizeDebugThreshold)");
|
log(" setBatchSizeFailureThreshold(int batchSizeDebugThreshold)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("threshold", Integer.toString(batchSizeDebugThreshold));
|
queryParams.add("threshold", Integer.toString(batchSizeDebugThreshold));
|
||||||
c.post("/storage_service/batch_size_failure_threshold", queryParams);
|
c.post("/storage_service/batch_size_failure_threshold", queryParams);
|
||||||
}
|
}
|
||||||
@ -1187,7 +1191,7 @@ public class StorageService extends NotificationBroadcasterSupport
|
|||||||
*/
|
*/
|
||||||
public void setHintedHandoffThrottleInKB(int throttleInKB) {
|
public void setHintedHandoffThrottleInKB(int throttleInKB) {
|
||||||
log(" setHintedHandoffThrottleInKB(int throttleInKB)");
|
log(" setHintedHandoffThrottleInKB(int throttleInKB)");
|
||||||
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
|
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
|
||||||
queryParams.add("throttle", Integer.toString(throttleInKB));
|
queryParams.add("throttle", Integer.toString(throttleInKB));
|
||||||
c.post("/storage_service/hinted_handoff", queryParams);
|
c.post("/storage_service/hinted_handoff", queryParams);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user