Search in sources :

Example 1 with IPrepareCommit

use of com.alibaba.jstorm.batch.IPrepareCommit in project jstorm by alibaba.

the class CoordinatedBolt method handlePrepareCommit.

public void handlePrepareCommit(Tuple tuple) {
    basicCollector.setContext(tuple);
    try {
        BatchId id = (BatchId) tuple.getValue(0);
        ((IPrepareCommit) delegate).prepareCommit(id, basicCollector);
        collector.ack(tuple);
    } catch (FailedException e) {
        if (e instanceof ReportedFailedException) {
            collector.reportError(e);
        }
        collector.fail(tuple);
    }
}
Also used : IPrepareCommit(com.alibaba.jstorm.batch.IPrepareCommit) ReportedFailedException(backtype.storm.topology.ReportedFailedException) FailedException(backtype.storm.topology.FailedException) ReportedFailedException(backtype.storm.topology.ReportedFailedException) BatchId(com.alibaba.jstorm.batch.BatchId)

Aggregations

FailedException (backtype.storm.topology.FailedException)1 ReportedFailedException (backtype.storm.topology.ReportedFailedException)1 BatchId (com.alibaba.jstorm.batch.BatchId)1 IPrepareCommit (com.alibaba.jstorm.batch.IPrepareCommit)1