Search in sources :

Example 1 with CountValue

use of com.alibaba.jstorm.transactional.bolt.TransactionBolt.CountValue in project jstorm by alibaba.

the class TransactionOutputCollector method flushBarrier.

public void flushBarrier() {
    // flush pending message in outputCollector
    flush();
    // Emit and flush barrier message to all downstream tasks
    for (Entry<Integer, CountValue> entry : currBatchTracker.sendMsgCount.entrySet()) {
        int taskId = entry.getKey();
        CountValue count = entry.getValue();
        BatchSnapshot snapshot = new BatchSnapshot(currBatchTracker.getBatchGroupId(), count.count);
        emitDirectByDelegate(taskId, TransactionCommon.BARRIER_STREAM_ID, null, new Values(new BatchGroupId(currBatchTracker.getBatchGroupId()), snapshot), null);
        count.count = 0;
    }
    flush();
}
Also used : BatchGroupId(com.alibaba.jstorm.transactional.BatchGroupId) CountValue(com.alibaba.jstorm.transactional.bolt.TransactionBolt.CountValue) Values(backtype.storm.tuple.Values) BatchSnapshot(com.alibaba.jstorm.transactional.BatchSnapshot)

Aggregations

Values (backtype.storm.tuple.Values)1 BatchGroupId (com.alibaba.jstorm.transactional.BatchGroupId)1 BatchSnapshot (com.alibaba.jstorm.transactional.BatchSnapshot)1 CountValue (com.alibaba.jstorm.transactional.bolt.TransactionBolt.CountValue)1