I am using datastax driver to do cassandra writes asynchronously, would like to see if there is a way to retry writes on failure. It does not seem to contain the request in Throwable throwable during failure.
public void onQueryComplete(final ResultSetFuture rsf)
{
Futures.addCallback(rsf, new FutureCallback<ResultSet>()
{
@Override
public void onSuccess(ResultSet resultSet)
{
totalRecordsWritten.incrementAndGet();
jobContext.putLong("MDPREC_WRITE_CNT", totalRecordsWritten.get());
System.out.println("Ingestion succesful " + totalRecordsWritten.get());
Logging.log(Logging.INFO, "CassandraPersistence.java ingest() Ingestion succesful");
}
@Override public void onFailure(Throwable throwable)
{
jobContext.putInt("MDP_WRITE_FAILED", 1);
Logging.log(Logging.INFO,"CassandraPersistence.java ingest() Ingestion failed"); throw
new UnexpectedJobExecutionException("Exception while inserting data Job terminated"+throwable.getMessage());
}
});
}