java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.fs.ByteBufferPositionedReadable, org.apache.hadoop.fs.ByteBufferReadable, org.apache.hadoop.fs.CanSetDropBehind, org.apache.hadoop.fs.CanSetReadahead, org.apache.hadoop.fs.CanUnbuffer, org.apache.hadoop.fs.HasEnhancedByteBufferAccess, org.apache.hadoop.fs.PositionedReadable, org.apache.hadoop.fs.Seekable, org.apache.hadoop.fs.StreamCapabilities@Private public class DFSStripedInputStream extends DFSInputStream
| Modifier and Type | Field | Description |
|---|---|---|
protected java.nio.ByteBuffer |
parityBuf |
blockEnd, cachingStrategy, closed, currentLocatedBlock, dfsClient, failures, infoLock, locatedBlocks, pos, readStatistics, src, tcpReadsDisabledForTesting, verifyChecksum| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Close it down!
|
protected void |
closeCurrentBlockReaders() |
Extend the super method with the logic of switching between cells.
|
protected void |
closeReader(org.apache.hadoop.hdfs.StripeReader.BlockReaderInfo readerInfo) |
|
protected void |
fetchBlockByteRange(LocatedBlock block,
long start,
long end,
java.nio.ByteBuffer buf,
DFSUtilClient.CorruptedBlocks corruptedBlocks) |
Real implementation of pread.
|
protected org.apache.hadoop.io.ByteBufferPool |
getBufferPool() |
|
protected java.nio.ByteBuffer |
getCurStripeBuf() |
|
protected java.nio.ByteBuffer |
getParityBuffer() |
|
protected java.util.concurrent.ThreadPoolExecutor |
getStripedReadsThreadPool() |
|
java.nio.ByteBuffer |
read(org.apache.hadoop.io.ByteBufferPool bufferPool,
int maxLength,
java.util.EnumSet<org.apache.hadoop.fs.ReadOption> opts) |
May need online read recovery, zero-copy read doesn't make
sense, so don't support it.
|
protected int |
readWithStrategy(org.apache.hadoop.hdfs.ReaderStrategy strategy) |
|
protected LocatedBlock |
refreshLocatedBlock(LocatedBlock block) |
The super method
DFSInputStream.refreshLocatedBlock(org.apache.hadoop.hdfs.protocol.LocatedBlock) refreshes
cached LocatedBlock by executing DFSInputStream.getBlockAt(long) again. |
void |
releaseBuffer(java.nio.ByteBuffer buffer) |
|
protected void |
reportLostBlock(LocatedBlock lostBlock,
java.util.Collection<DatanodeInfo> ignoredNodes) |
Warn the user of a lost block
|
void |
seek(long targetPos) |
Seek to a new arbitrary location.
|
boolean |
seekToNewSource(long targetPos) |
Seek to given position on a node other than the current node.
|
void |
unbuffer() |
addToLocalDeadNodes, available, clearReadStatistics, fetchBlockAt, getAllBlocks, getBestNodeDNAddrPair, getBlockAt, getBlockReader, getCurrentBlock, getCurrentBlockLocationsLength, getCurrentDatanode, getDFSClient, getFileEncryptionInfo, getFileLength, getHedgedReadOpsLoopNumForTesting, getLocalDeadNodes, getLocatedBlocks, getPos, getReadStatistics, getSrc, hasCapability, mark, markSupported, maybeRegisterBlockRefresh, read, read, read, read, read, readFully, removeFromLocalDeadNodes, reportCheckSumFailure, reset, setDropBehind, setReadahead, skip, tokenRefetchNeededreadFully, readFully, toString, validatePositionedReadArgsnullInputStream, read, readAllBytes, readNBytes, readNBytes, transferToprotected java.nio.ByteBuffer getParityBuffer()
protected java.nio.ByteBuffer getCurStripeBuf()
protected org.apache.hadoop.io.ByteBufferPool getBufferPool()
protected java.util.concurrent.ThreadPoolExecutor getStripedReadsThreadPool()
public void close()
throws java.io.IOException
DFSInputStreamclose in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in class DFSInputStreamjava.io.IOExceptionprotected void closeCurrentBlockReaders()
closeCurrentBlockReaders in class DFSInputStreamprotected void closeReader(org.apache.hadoop.hdfs.StripeReader.BlockReaderInfo readerInfo)
public void seek(long targetPos)
throws java.io.IOException
seek in interface org.apache.hadoop.fs.Seekableseek in class DFSInputStreamjava.io.IOExceptionpublic boolean seekToNewSource(long targetPos)
throws java.io.IOException
DFSInputStreamseekToNewSource in interface org.apache.hadoop.fs.SeekableseekToNewSource in class DFSInputStreamjava.io.IOExceptionprotected int readWithStrategy(org.apache.hadoop.hdfs.ReaderStrategy strategy)
throws java.io.IOException
readWithStrategy in class DFSInputStreamjava.io.IOExceptionprotected LocatedBlock refreshLocatedBlock(LocatedBlock block) throws java.io.IOException
DFSInputStream.refreshLocatedBlock(org.apache.hadoop.hdfs.protocol.LocatedBlock) refreshes
cached LocatedBlock by executing DFSInputStream.getBlockAt(long) again.
This method extends the logic by first remembering the index of the
internal block, and re-parsing the refreshed block group with the same
index.refreshLocatedBlock in class DFSInputStreamblock - The currently cached block locationsjava.io.IOExceptionprotected void fetchBlockByteRange(LocatedBlock block, long start, long end, java.nio.ByteBuffer buf, DFSUtilClient.CorruptedBlocks corruptedBlocks) throws java.io.IOException
fetchBlockByteRange in class DFSInputStreamjava.io.IOExceptionprotected void reportLostBlock(LocatedBlock lostBlock, java.util.Collection<DatanodeInfo> ignoredNodes)
DFSInputStreamreportLostBlock in class DFSInputStreampublic java.nio.ByteBuffer read(org.apache.hadoop.io.ByteBufferPool bufferPool,
int maxLength,
java.util.EnumSet<org.apache.hadoop.fs.ReadOption> opts)
throws java.io.IOException,
java.lang.UnsupportedOperationException
read in interface org.apache.hadoop.fs.HasEnhancedByteBufferAccessread in class DFSInputStreamjava.io.IOExceptionjava.lang.UnsupportedOperationExceptionpublic void releaseBuffer(java.nio.ByteBuffer buffer)
releaseBuffer in interface org.apache.hadoop.fs.HasEnhancedByteBufferAccessreleaseBuffer in class DFSInputStreampublic void unbuffer()
unbuffer in interface org.apache.hadoop.fs.CanUnbufferunbuffer in class DFSInputStreamCopyright © 2008–2025 Apache Software Foundation. All rights reserved.