public BatchDescriptor next(BatchDescriptor batchDescriptor) { if (null == gatingSequences) { throw new NullReferenceException("gatingSequences must be set before claiming sequences"); } long sequence = claimStrategy.incrementAndGet(batchDescriptor.getSize(), gatingSequences); batchDescriptor.setEnd(sequence); return batchDescriptor; }
public void publish(BatchDescriptor batchDescriptor) { publish(batchDescriptor.getEnd(), batchDescriptor.getSize()); }