/** * Atomically increment the sequence by one. * * @return The value after the increment */ public long incrementAndGet() { return addAndGet(1L); }
/** * Atomically increment the sequence by one. * * @return The value after the increment */ public long incrementAndGet() { return addAndGet(1L); }
/** * Atomically increment the sequence by one. * * @return The value after the increment */ public long incrementAndGet() { return addAndGet(1L); }
/** * Atomically increment the sequence by one. * * @return The value after the increment */ public long incrementAndGet() { return addAndGet(1L); }
/** * Atomically increment the sequence by one. * * @return The value after the increment */ public long incrementAndGet() { return addAndGet(1L); }
@Override public int drainTo(Collection<? super T> collection, int maxElements) { long pos = consumedSeq.get() + 1; if (pos + maxElements - 1 > knownPublishedSeq) { updatePublishedSequence(); } int c = 0; try { while (pos <= knownPublishedSeq && c <= maxElements) { Event<T> eventHolder = ringBuffer.get(pos); collection.add(eventHolder.removeValue()); c++; pos++; } } finally { if (c > 0) { consumedSeq.addAndGet(c); } } return c; }