@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (numBlocksRemaining <= 0) { reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in the next lines if (current != null) { sendReadRequest(current); } // get the next segment numBlocksRemaining--; return reader.getNextReturnedBlock(); }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (numBlocksRemaining <= 0) { reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in the next lines if (current != null) { sendReadRequest(current); } // get the next segment numBlocksRemaining--; return reader.getNextReturnedBlock(); }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (this.numBlocksRemaining <= 0) { this.reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in // the next lines if (current != null) { sendReadRequest(current); } // get the next segment this.numBlocksRemaining--; return this.reader.getNextReturnedBlock(); }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (this.numBlocksRemaining <= 0) { this.reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in // the next lines if (current != null) { sendReadRequest(current); } // get the next segment this.numBlocksRemaining--; return this.reader.getNextReturnedBlock(); }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (numBlocksRemaining <= 0) { reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in the next lines if (current != null) { sendReadRequest(current); } // get the next segment numBlocksRemaining--; return reader.getNextReturnedBlock(); }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (this.numBlocksRemaining <= 0) { this.reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in // the next lines if (current != null) { sendReadRequest(current); } // check if next segment is the first block isFirstBlock = (current == null); // get the next segment this.numBlocksRemaining--; return this.reader.getNextReturnedBlock(); }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (numBlocksRemaining <= 0) { reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in the next lines if (current != null) { sendReadRequest(current); } // get the next segment numBlocksRemaining--; return reader.getNextReturnedBlock(); }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (numBlocksRemaining <= 0) { reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in the next lines if (current != null) { sendReadRequest(current); } // get the next segment numBlocksRemaining--; return reader.getNextReturnedBlock(); }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (this.numBlocksRemaining <= 0) { this.reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in // the next lines if (current != null) { sendReadRequest(current); } // get the next segment this.numBlocksRemaining--; return this.reader.getNextReturnedBlock(); }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (numBlocksRemaining <= 0) { reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in the next lines if (current != null) { sendReadRequest(current); } // get the next segment numBlocksRemaining--; return reader.getNextReturnedBlock(); }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (numBlocksRemaining <= 0) { reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in the next lines if (current != null) { sendReadRequest(current); } // get the next segment numBlocksRemaining--; return reader.getNextReturnedBlock(); }
@Override protected MemorySegment nextSegment(MemorySegment current) throws IOException { // check for end-of-stream if (numBlocksRemaining <= 0) { reader.close(); throw new EOFException(); } // send a request first. if we have only a single segment, this same segment will be the one obtained in the next lines if (current != null) { sendReadRequest(current); } // get the next segment numBlocksRemaining--; return reader.getNextReturnedBlock(); }
final MemorySegment seg = this.reader.getNextReturnedBlock();
final MemorySegment seg = this.reader.getNextReturnedBlock();
final MemorySegment seg = this.reader.getNextReturnedBlock();
final MemorySegment seg = this.reader.getNextReturnedBlock();
public void seek(long position) throws IOException { final int block = MathUtils.checkedDownCast(position / segmentSize); final int positionInBlock = (int) (position % segmentSize); if (position < 0 || block >= numBlocksTotal || (block == numBlocksTotal - 1 && positionInBlock > sizeOfLastBlock)) { throw new IllegalArgumentException("Position is out of range"); } clear(); if (reader != null) { reader.close(); } reader = ioManager.createBlockChannelReader(channelId); if (block > 0) { reader.seekToPosition(((long) block) * segmentSize); } this.numBlocksRemaining = this.numBlocksTotal - block; this.numRequestsRemaining = numBlocksRemaining; for (int i = 0; i < memory.size(); i++) { sendReadRequest(memory.get(i)); } numBlocksRemaining--; seekInput(reader.getNextReturnedBlock(), positionInBlock, numBlocksRemaining == 0 ? sizeOfLastBlock : segmentSize); }
public void seek(long position) throws IOException { final int block = MathUtils.checkedDownCast(position / segmentSize); final int positionInBlock = (int) (position % segmentSize); if (position < 0 || block >= numBlocksTotal || (block == numBlocksTotal - 1 && positionInBlock > sizeOfLastBlock)) { throw new IllegalArgumentException("Position is out of range"); } clear(); if (reader != null) { reader.close(); } reader = ioManager.createBlockChannelReader(channelId); if (block > 0) { reader.seekToPosition(((long) block) * segmentSize); } this.numBlocksRemaining = this.numBlocksTotal - block; this.numRequestsRemaining = numBlocksRemaining; for (int i = 0; i < memory.size(); i++) { sendReadRequest(memory.get(i)); } numBlocksRemaining--; seekInput(reader.getNextReturnedBlock(), positionInBlock, numBlocksRemaining == 0 ? sizeOfLastBlock : segmentSize); }
public void seek(long position) throws IOException { final int block = MathUtils.checkedDownCast(position / segmentSize); final int positionInBlock = (int) (position % segmentSize); if (position < 0 || block >= numBlocksTotal || (block == numBlocksTotal - 1 && positionInBlock > sizeOfLastBlock)) { throw new IllegalArgumentException("Position is out of range"); } clear(); if (reader != null) { reader.close(); } reader = ioManager.createBlockChannelReader(channelId); if (block > 0) { reader.seekToPosition(((long) block) * segmentSize); } this.numBlocksRemaining = this.numBlocksTotal - block; this.numRequestsRemaining = numBlocksRemaining; for (int i = 0; i < memory.size(); i++) { sendReadRequest(memory.get(i)); } numBlocksRemaining--; seekInput(reader.getNextReturnedBlock(), positionInBlock, numBlocksRemaining == 0 ? sizeOfLastBlock : segmentSize); }
public void seek(long position) throws IOException { final int block = MathUtils.checkedDownCast(position / segmentSize); final int positionInBlock = (int) (position % segmentSize); if (position < 0 || block >= numBlocksTotal || (block == numBlocksTotal - 1 && positionInBlock > sizeOfLastBlock)) { throw new IllegalArgumentException("Position is out of range"); } clear(); if (reader != null) { reader.close(); } reader = ioManager.createBlockChannelReader(channelId); if (block > 0) { reader.seekToPosition(((long) block) * segmentSize); } this.numBlocksRemaining = this.numBlocksTotal - block; this.numRequestsRemaining = numBlocksRemaining; for (int i = 0; i < memory.size(); i++) { sendReadRequest(memory.get(i)); } numBlocksRemaining--; seekInput(reader.getNextReturnedBlock(), positionInBlock, numBlocksRemaining == 0 ? sizeOfLastBlock : segmentSize); }