I have a function which deletes some nodes from Cassandra DB as follow:
public void deleteNodeDataFromSensordata2(String nodeId, long startTime, long endTime) {
logger.info("Star : delete Sensordata2 of node [" + nodeId + "] " + "start [" + startTime + "] " + "end ["
+ endTime + "] data");
try {
BoundStatement stmt = sensordata2NodeDataDelete.bind();
stmt.setList(DAYS, getDaysAsList(startTime, endTime));
stmt.setString(NODEID, nodeId);
session.execute(stmt);
} catch (Exception e) {
logger.error("Error from cassandra", e);
}
logger.info("End : delete of [" + nodeId + "] Sensordata2 data");
}
the delete query would be as follow:
sensordata2NodeDataDelete = session.prepare(
"DELETE FROM "
+ "SENSOR_DATA_2 "
+ "WHERE NODEID = :NODEID AND YYYYMMDD IN :DAYS");
I want to get assured all above data is deleted after the execution of the next command. Does the above code give such reliability?