@Override public boolean offer(T e) { boolean startNewQueue = this.currentQueue == null || this.currentQueue.isFlushed(); if (startNewQueue) { currentIndex++; if (currentIndex < queues.size()) { currentQueue = queues.get(currentIndex); } else { currentQueue = createSegmentQueue(currentIndex, thresholdBytes); queues.add(currentQueue); } } return this.currentQueue.offer(e); }
@Override public boolean offer(T e) { boolean startNewQueue = this.currentQueue == null || this.currentQueue.isFlushed(); if (startNewQueue) { currentIndex++; if (currentIndex < queues.size()) { currentQueue = queues.get(currentIndex); } else { currentQueue = createSegmentQueue(currentIndex, thresholdBytes); queues.add(currentQueue); } } return this.currentQueue.offer(e); }
@Override public boolean offer(T e) { boolean startNewQueue = this.currentQueue == null || this.currentQueue.isFlushed(); if (startNewQueue) { currentIndex++; if (currentIndex < queues.size()) { currentQueue = queues.get(currentIndex); } else { currentQueue = createSegmentQueue(currentIndex, thresholdBytes); queues.add(currentQueue); } } return this.currentQueue.offer(e); }