Search in sources :

Example 1 with ICollectorCallback

use of backtype.storm.task.ICollectorCallback in project jstorm by alibaba.

the class TransactionSpoutOutputCollector method emit.

@Override
public List<Integer> emit(String streamId, List<Object> tuple, Object messageId, ICollectorCallback callback) {
    try {
        //waitActive();
        lock.readLock().lock();
        List<Object> tupleWithId = new ArrayList<Object>();
        tupleWithId.add(new BatchGroupId(groupId, currBatchId));
        tupleWithId.addAll(tuple);
        delegate.emit(streamId, tupleWithId, null, (callback != null) ? callback : new CollectorCallback());
    //currBatchInfo.endPos = messageId;
    } finally {
        lock.readLock().unlock();
    }
    return null;
}
Also used : ICollectorCallback(backtype.storm.task.ICollectorCallback) BatchGroupId(com.alibaba.jstorm.transactional.BatchGroupId) ArrayList(java.util.ArrayList)

Example 2 with ICollectorCallback

use of backtype.storm.task.ICollectorCallback in project jstorm by alibaba.

the class TransactionSpoutOutputCollector method emitDirect.

@Override
public void emitDirect(int taskId, String streamId, List<Object> tuple, Object messageId, ICollectorCallback callback) {
    try {
        //waitActive();
        lock.readLock().lock();
        List<Object> tupleWithId = new ArrayList<Object>();
        tupleWithId.add(new BatchGroupId(groupId, currBatchId));
        tupleWithId.addAll(tuple);
        delegate.emitDirect(taskId, streamId, tupleWithId, null, (callback != null) ? callback : new CollectorCallback());
    //currBatchInfo.endPos = messageId;
    } finally {
        lock.readLock().unlock();
    }
}
Also used : ICollectorCallback(backtype.storm.task.ICollectorCallback) BatchGroupId(com.alibaba.jstorm.transactional.BatchGroupId) ArrayList(java.util.ArrayList)

Aggregations

ICollectorCallback (backtype.storm.task.ICollectorCallback)2 BatchGroupId (com.alibaba.jstorm.transactional.BatchGroupId)2 ArrayList (java.util.ArrayList)2