@InterfaceAudience.Private public class FSDataInputStreamWrapper extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.fs.Path |
readerPath |
| Constructor and Description |
|---|
FSDataInputStreamWrapper(org.apache.hadoop.fs.FileSystem fs,
FileLink link,
boolean dropBehind,
long readahead) |
FSDataInputStreamWrapper(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path) |
FSDataInputStreamWrapper(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
boolean dropBehind,
long readahead) |
FSDataInputStreamWrapper(org.apache.hadoop.fs.FSDataInputStream fsdis)
For use in tests.
|
FSDataInputStreamWrapper(org.apache.hadoop.fs.FSDataInputStream fsdis,
org.apache.hadoop.fs.FSDataInputStream noChecksum)
For use in tests.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checksumOk()
Report that checksum was ok, so we may ponder going back to HBase checksum.
|
void |
close()
CloseClose stream(s) if necessary.
|
org.apache.hadoop.fs.FSDataInputStream |
fallbackToFsChecksum(int offCount)
Read from non-checksum stream failed, fall back to FS checksum.
|
HFileSystem |
getHfs() |
static long |
getLocalBytesRead() |
org.apache.hadoop.fs.Path |
getReaderPath() |
static long |
getShortCircuitBytesRead() |
org.apache.hadoop.fs.FSDataInputStream |
getStream(boolean useHBaseChecksum)
Get the stream to use.
|
static long |
getTotalBytesRead() |
static long |
getZeroCopyBytesRead() |
void |
prepareForBlockReader(boolean forceNoHBaseChecksum)
Prepares the streams for block reader.
|
boolean |
shouldUseHBaseChecksum()
Returns Whether we are presently using HBase checksum.
|
void |
unbuffer()
This will free sockets and file descriptors held by the stream only when the stream implements
org.apache.hadoop.fs.CanUnbuffer.
|
public FSDataInputStreamWrapper(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
throws IOException
IOExceptionpublic FSDataInputStreamWrapper(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
boolean dropBehind,
long readahead)
throws IOException
IOExceptionpublic FSDataInputStreamWrapper(org.apache.hadoop.fs.FileSystem fs,
FileLink link,
boolean dropBehind,
long readahead)
throws IOException
IOExceptionpublic FSDataInputStreamWrapper(org.apache.hadoop.fs.FSDataInputStream fsdis)
public FSDataInputStreamWrapper(org.apache.hadoop.fs.FSDataInputStream fsdis,
org.apache.hadoop.fs.FSDataInputStream noChecksum)
public void prepareForBlockReader(boolean forceNoHBaseChecksum)
throws IOException
forceNoHBaseChecksum - Force not using HBase checksum.IOExceptionpublic boolean shouldUseHBaseChecksum()
public org.apache.hadoop.fs.FSDataInputStream getStream(boolean useHBaseChecksum)
useHBaseChecksum - must be the value that shouldUseHBaseChecksum has returned at some
point in the past, otherwise the result is undefined.public org.apache.hadoop.fs.FSDataInputStream fallbackToFsChecksum(int offCount)
throws IOException
offCount - For how many checksumOk calls to turn off the HBase checksum.IOExceptionpublic void checksumOk()
public static long getTotalBytesRead()
public static long getLocalBytesRead()
public static long getShortCircuitBytesRead()
public static long getZeroCopyBytesRead()
public void close()
close in interface Closeableclose in interface AutoCloseablepublic HFileSystem getHfs()
public void unbuffer()
public org.apache.hadoop.fs.Path getReaderPath()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.