use of com.alibaba.jstorm.batch.util.BatchStatus in project jstorm by alibaba.
the class BatchSpoutMsgId method mkInstance.
public static BatchSpoutMsgId mkInstance() {
BatchId batchId = BatchId.mkInstance();
BatchStatus batchStatus = BatchStatus.COMPUTING;
return new BatchSpoutMsgId(batchId, batchStatus);
}
use of com.alibaba.jstorm.batch.util.BatchStatus in project jstorm by alibaba.
the class BatchSpoutTrigger method handleFail.
protected void handleFail(BatchSpoutMsgId msgId) {
LOG.info("Failed batch " + msgId);
BatchStatus status = msgId.getBatchStatus();
BatchStatus newStatus = status.error();
if (newStatus == BatchStatus.ERROR) {
// create new status
mkMsgId(msgId);
} else {
msgId.setBatchStatus(newStatus);
batchQueue.offer(msgId);
}
}
use of com.alibaba.jstorm.batch.util.BatchStatus in project jstorm by alibaba.
the class BatchSpoutTrigger method forward.
protected void forward(BatchSpoutMsgId msgId) {
BatchStatus status = msgId.getBatchStatus();
BatchStatus newStatus = status.forward();
if (newStatus == null) {
// create new status
mkMsgId(msgId);
LOG.info("Finish old batch " + msgId);
} else {
msgId.setBatchStatus(newStatus);
batchQueue.offer(msgId);
LOG.info("Forward batch " + msgId);
}
}
Aggregations