Let me know if I posted anything incorrectly, here. (Note: KairosDB is on top of Cassandra. Uses Hector).
I'm using the KairosDB Java Client to dump large amounts of sample data into the datastore. I currently dumped 6 million in, and am now attempting to delete all of it with the method as follows:
public static void purgeData(String metricsType, HttpClient c, int num, TimeUnit units){
try {
System.out.println("Beginning method");
c = new HttpClient("http://localhost:8080/api/v1/datapoints/delete");
QueryBuilder builder = QueryBuilder.getInstance();
System.out.println("Preparing to delete info");
builder.setStart(20, TimeUnit.MONTHS).setEnd(1, TimeUnit.SECONDS).addMetric(metricsType);
System.out.println("Attempted to delete info");
QueryResponse response = c.query(builder);
//System.out.println("JSON: " + response.getJson());
} catch (Exception e) {
System.out.println("Adding data points produced an error");
e.printStackTrace();
}
}
Note that I removed the time interval parameters simply to try and delete all of the data at once.
When executing this method, no points are seemingly deleted. I opted to curl the query with the JSON form of the data and received a HectorException stating "all host pools marked down. Retry burden pushed out to client".
My personal conclusion is that 6 million is too many to delete at once. I was thinking about deleting pieces at a time, but I don't know how to restrict how many rows I delete from the KDB Java client-side. I know that KairosDB is used in production. How do people effectively delete large amounts of data with the Java Client?
Thanks very much for your time!