@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // use the buffer to send the next request if (requestsRemaining > 0) { requestsRemaining--; spilledBufferSource.readBlock(current); } else { emptyBufferTarget.add(current); } // get the next buffer either from the return queue, or the full buffer source if (spilledBuffersRemaining > 0) { spilledBuffersRemaining--; try { return spilledBufferSource.getReturnQueue().take(); } catch (InterruptedException e) { throw new RuntimeException("Read End was interrupted while waiting for spilled buffer.", e); } } else if (fullBufferSource.size() > 0) { return fullBufferSource.removeFirst(); } else { clear(); // delete the channel, if we had one if (spilledBufferSource != null) { spilledBufferSource.closeAndDelete(); } throw new EOFException(); } }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // use the buffer to send the next request if (requestsRemaining > 0) { requestsRemaining--; spilledBufferSource.readBlock(current); } else { emptyBufferTarget.add(current); } // get the next buffer either from the return queue, or the full buffer source if (spilledBuffersRemaining > 0) { spilledBuffersRemaining--; try { return spilledBufferSource.getReturnQueue().take(); } catch (InterruptedException e) { throw new RuntimeException("Read End was interrupted while waiting for spilled buffer.", e); } } else if (fullBufferSource.size() > 0) { return fullBufferSource.removeFirst(); } else { clear(); // delete the channel, if we had one if (spilledBufferSource != null) { spilledBufferSource.closeAndDelete(); } throw new EOFException(); } }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // use the buffer to send the next request if (requestsRemaining > 0) { requestsRemaining--; spilledBufferSource.readBlock(current); } else { emptyBufferTarget.add(current); } // get the next buffer either from the return queue, or the full buffer source if (spilledBuffersRemaining > 0) { spilledBuffersRemaining--; try { return spilledBufferSource.getReturnQueue().take(); } catch (InterruptedException e) { throw new RuntimeException("Read End was interrupted while waiting for spilled buffer.", e); } } else if (fullBufferSource.size() > 0) { return fullBufferSource.removeFirst(); } else { clear(); // delete the channel, if we had one if (spilledBufferSource != null) { spilledBufferSource.closeAndDelete(); } throw new EOFException(); } }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // use the buffer to send the next request if (requestsRemaining > 0) { requestsRemaining--; spilledBufferSource.readBlock(current); } else { emptyBufferTarget.add(current); } // get the next buffer either from the return queue, or the full buffer source if (spilledBuffersRemaining > 0) { spilledBuffersRemaining--; try { return spilledBufferSource.getReturnQueue().take(); } catch (InterruptedException e) { throw new RuntimeException("Read End was interrupted while waiting for spilled buffer.", e); } } else if (fullBufferSource.size() > 0) { return fullBufferSource.removeFirst(); } else { clear(); // delete the channel, if we had one if (spilledBufferSource != null) { spilledBufferSource.closeAndDelete(); } throw new EOFException(); } }
final LinkedBlockingQueue<MemorySegment> queue = this.reader.getReturnQueue(); this.reader.close();
final LinkedBlockingQueue<MemorySegment> queue = this.reader.getReturnQueue(); this.reader.close();
final LinkedBlockingQueue<MemorySegment> queue = this.reader.getReturnQueue(); this.reader.close();
final LinkedBlockingQueue<MemorySegment> queue = this.reader.getReturnQueue(); this.reader.close();
firstSeg = reader.getReturnQueue().take();
firstSeg = reader.getReturnQueue().take();
firstSeg = reader.getReturnQueue().take();
firstSeg = reader.getReturnQueue().take();