List<ISpoutPartition> myPartitions = new ArrayList();
for(int i=_index; i < partitions.size(); i+=_numTasks) {
ISpoutPartition p = partitions.get(i);
String id = p.getId();
myPartitions.add(p);
_partitionStates.put(id, new EmitterPartitionState(new RotatingTransactionalState(_state, id), p));
}
_emitter.refreshPartitions(myPartitions);
_savedCoordinatorMeta = coordinatorMeta;
}
for(EmitterPartitionState s: _partitionStates.values()) {
RotatingTransactionalState state = s.rotatingState;
final ISpoutPartition partition = s.partition;
Object meta = state.getStateOrCreate(tx.getTransactionId(),
new RotatingTransactionalState.StateInitializer() {
@Override
public Object init(long txid, Object lastState) {
return _emitter.emitPartitionBatchNew(tx, collector, partition, lastState);
}