public UnsafeSorterSpillReader getReader(SerializerManager serializerManager) throws IOException { return new UnsafeSorterSpillReader(serializerManager, file, blockId); }
} else { assert(reader != null); if (!reader.hasNext()) { advanceToNextPage(); reader.loadNext(); } catch (IOException e) { try { reader.close(); } catch(IOException e2) { logger.error("Error while closing spill reader", e2); loc.with(reader.getBaseObject(), reader.getBaseOffset(), reader.getRecordLength()); return loc;
@Override public void loadNext() throws IOException { if (buffer.remaining() < 4 + 8) { fillBuffer(4 + 8); } recordLength = buffer.getInt(); keyPrefix = buffer.getLong(); if (recordLength > 0) { if (buffer.remaining() < recordLength) { if (buffer.capacity() > 4 + 8 + recordLength) { allocateBuffer(4 + 8 + recordLength); } fillBuffer(recordLength); } } baseOffset = bufferAddr; numRecordsRemaining--; if (numRecordsRemaining == 0) { close(); } }
@Override public void loadNext() throws IOException { // Kill the task in case it has been marked as killed. This logic is from // InterruptibleIterator, but we inline it here instead of wrapping the iterator in order // to avoid performance overhead. This check is added here in `loadNext()` instead of in // `hasNext()` because it's technically possible for the caller to be relying on // `getNumRecords()` instead of `hasNext()` to know when to stop. if (taskContext != null) { taskContext.killTaskIfInterrupted(); } recordLength = din.readInt(); keyPrefix = din.readLong(); if (recordLength > arr.length) { arr = new byte[recordLength]; baseObject = arr; } ByteStreams.readFully(in, arr, 0, recordLength); numRecordsRemaining--; if (numRecordsRemaining == 0) { close(); } }
} else { assert(reader != null); if (!reader.hasNext()) { advanceToNextPage(); reader.loadNext(); } catch (IOException e) { try { reader.close(); } catch(IOException e2) { logger.error("Error while closing spill reader", e2); loc.with(reader.getBaseObject(), reader.getBaseOffset(), reader.getRecordLength()); return loc;
@Override public void loadNext() throws IOException { // Kill the task in case it has been marked as killed. This logic is from // InterruptibleIterator, but we inline it here instead of wrapping the iterator in order // to avoid performance overhead. This check is added here in `loadNext()` instead of in // `hasNext()` because it's technically possible for the caller to be relying on // `getNumRecords()` instead of `hasNext()` to know when to stop. if (taskContext != null) { taskContext.killTaskIfInterrupted(); } recordLength = din.readInt(); keyPrefix = din.readLong(); if (recordLength > arr.length) { arr = new byte[recordLength]; baseObject = arr; } ByteStreams.readFully(in, arr, 0, recordLength); numRecordsRemaining--; if (numRecordsRemaining == 0) { close(); } }
} else { assert(reader != null); if (!reader.hasNext()) { advanceToNextPage(); reader.loadNext(); } catch (IOException e) { try { reader.close(); } catch(IOException e2) { logger.error("Error while closing spill reader", e2); loc.with(reader.getBaseObject(), reader.getBaseOffset(), reader.getRecordLength()); return loc;
public UnsafeSorterSpillReader getReader(SerializerManager serializerManager) throws IOException { return new UnsafeSorterSpillReader(serializerManager, file, blockId); }
@Override public void loadNext() throws IOException { // Kill the task in case it has been marked as killed. This logic is from // InterruptibleIterator, but we inline it here instead of wrapping the iterator in order // to avoid performance overhead. This check is added here in `loadNext()` instead of in // `hasNext()` because it's technically possible for the caller to be relying on // `getNumRecords()` instead of `hasNext()` to know when to stop. if (taskContext != null) { taskContext.killTaskIfInterrupted(); } recordLength = din.readInt(); keyPrefix = din.readLong(); if (recordLength > arr.length) { arr = new byte[recordLength]; baseObject = arr; } ByteStreams.readFully(in, arr, 0, recordLength); numRecordsRemaining--; if (numRecordsRemaining == 0) { close(); } }
} else { assert (reader != null); if (!reader.hasNext()) { advanceToNextPage(); reader.loadNext(); } catch (IOException e) { try { reader.close(); } catch (IOException e2) { logger.error("Error while closing spill reader", e2); loc.with(reader.getBaseObject(), reader.getBaseOffset(), reader.getRecordLength()); return loc;
public UnsafeSorterSpillReader getReader(SerializerManager serializerManager) throws IOException { return new UnsafeSorterSpillReader(serializerManager, file, blockId); } }
public UnsafeSorterSpillReader getReader() throws IOException { return new UnsafeSorterSpillReader(filePath); } }