public class PartitionedFileReader extends Object implements AutoCloseable
PartitionedFile
.Constructor and Description |
---|
PartitionedFileReader(PartitionedFile partitionedFile,
int targetSubpartition) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
hasRemaining() |
Buffer |
readBuffer(MemorySegment target,
BufferRecycler recycler)
Reads a buffer from the
PartitionedFile and moves the read position forward. |
public PartitionedFileReader(PartitionedFile partitionedFile, int targetSubpartition) throws IOException
IOException
@Nullable public Buffer readBuffer(MemorySegment target, BufferRecycler recycler) throws IOException
PartitionedFile
and moves the read position forward.
Note: The caller is responsible for recycling the target buffer if any exception occurs.
IOException
@VisibleForTesting public boolean hasRemaining() throws IOException
IOException
public void close() throws IOException
close
in interface AutoCloseable
IOException
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.