@GET
@Path("/scrub")
public Response scrub(@QueryParam(REST_HEADER_KEYSPACES) String keyspaces, @QueryParam(REST_HEADER_CFS) String cfnames) throws IOException, ExecutionException, InterruptedException,
ConfigurationException
{
JMXNodeTool nodetool = null;
try {
nodetool = JMXNodeTool.instance(config);
} catch (JMXConnectionException e) {
return Response.status(503).entity("JMXConnectionException")
.build();
}
String[] cfs = null;
if (StringUtils.isNotBlank(cfnames))
cfs = cfnames.split(",");
if (cfs == null)
nodetool.scrub(keyspaces);
else
nodetool.scrub(keyspaces, cfs);
return Response.ok(REST_SUCCESS, MediaType.APPLICATION_JSON).build();
}