Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

move ack loop out of finally block so tuples are acked only when cass…

…andra write is successful

add fail loop to catch block to tuples are failed quickly when writes fail.
  • Loading branch information...
commit 0f05cd6301c54748fa1b325d72f7b788687bef0c 1 parent a2ed91e
@ptgoetz authored
View
8 src/main/java/backtype/storm/contrib/cassandra/bolt/DefaultBatchingCassandraBolt.java
@@ -63,13 +63,17 @@ public void executeBatch(List<Tuple> inputs) {
tuplesToAck.add(input);
}
mutator.execute();
+ if (this.ackStrategy == AckStrategy.ACK_ON_WRITE) {
+ for (Tuple tupleToAck : tuplesToAck) {
+ this.collector.ack(tupleToAck);
+ }
+ }
} catch (Throwable e) {
LOG.warn("Unable to write batch.", e);
- } finally {
if (this.ackStrategy == AckStrategy.ACK_ON_WRITE) {
for (Tuple tupleToAck : tuplesToAck) {
- this.collector.ack(tupleToAck);
+ this.collector.fail(tupleToAck);
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.