public class AbfsInputStream
extends org.apache.hadoop.fs.FSInputStream
implements org.apache.hadoop.fs.CanUnbuffer, org.apache.hadoop.fs.StreamCapabilities, org.apache.hadoop.fs.statistics.IOStatisticsSource
| Modifier and Type | Field and Description |
|---|---|
static int |
FOOTER_SIZE |
static int |
MAX_OPTIMIZED_READ_ATTEMPTS |
| Constructor and Description |
|---|
AbfsInputStream(AbfsClient client,
org.apache.hadoop.fs.FileSystem.Statistics statistics,
String path,
long contentLength,
AbfsInputStreamContext abfsInputStreamContext,
String eTag,
TracingContext tracingContext) |
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Return the size of the remaining available bytes
if the size is less than or equal to
Integer.MAX_VALUE,
otherwise, return Integer.MAX_VALUE. |
void |
close() |
int |
getBufferSize() |
long |
getBytesFromReadAhead()
Getter for bytes read from readAhead buffer that fills asynchronously.
|
long |
getBytesFromRemoteRead()
Getter for bytes read remotely from the data store.
|
protected int |
getFooterReadBufferSize() |
org.apache.hadoop.fs.statistics.IOStatistics |
getIOStatistics() |
String |
getPath() |
long |
getPos()
Return the current offset from the start of the file
|
int |
getReadAheadQueueDepth() |
int |
getReadAheadRange() |
String |
getStreamID() |
AbfsInputStreamStatistics |
getStreamStatistics()
Getter for AbfsInputStreamStatistics.
|
TracingContext |
getTracingContext() |
boolean |
hasCapability(String capability) |
boolean |
isReadAheadEnabled() |
long |
length()
Returns the length of the file that this stream refers to.
|
void |
mark(int readlimit)
Not supported by this stream.
|
boolean |
markSupported()
gets whether mark and reset are supported by
ADLFileInputStream. |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
int |
read(long position,
byte[] buffer,
int offset,
int length) |
void |
registerListener(Listener listener1) |
void |
reset()
Not supported by this stream.
|
void |
seek(long n)
Seek to given position in stream.
|
boolean |
seekToNewSource(long l)
Seeks a different copy of the data.
|
protected void |
setCachedSasToken(CachedSASToken cachedSasToken) |
boolean |
shouldAlwaysReadBufferSize() |
long |
skip(long n) |
String |
toString()
Get the statistics of the stream.
|
void |
unbuffer() |
readFully, readFully, validatePositionedReadArgsreadpublic static final int FOOTER_SIZE
public static final int MAX_OPTIMIZED_READ_ATTEMPTS
public AbfsInputStream(AbfsClient client, org.apache.hadoop.fs.FileSystem.Statistics statistics, String path, long contentLength, AbfsInputStreamContext abfsInputStreamContext, String eTag, TracingContext tracingContext)
public String getPath()
public int read(long position,
byte[] buffer,
int offset,
int length)
throws IOException
read in interface org.apache.hadoop.fs.PositionedReadableread in class org.apache.hadoop.fs.FSInputStreamIOExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic void seek(long n)
throws IOException
seek in interface org.apache.hadoop.fs.Seekableseek in class org.apache.hadoop.fs.FSInputStreamn - position to seek toIOException - if there is an errorEOFException - if attempting to seek past end of filepublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionpublic int available()
throws IOException
Integer.MAX_VALUE,
otherwise, return Integer.MAX_VALUE.
This is to match the behavior of DFSInputStream.available(),
which some clients may rely on (HBase write-ahead log reading in
particular).available in class InputStreamIOExceptionpublic long length()
throws IOException
IOException - if the stream is closedpublic long getPos()
throws IOException
getPos in interface org.apache.hadoop.fs.SeekablegetPos in class org.apache.hadoop.fs.FSInputStreamIOException - throws IOException if there is an errorpublic TracingContext getTracingContext()
public boolean seekToNewSource(long l)
throws IOException
seekToNewSource in interface org.apache.hadoop.fs.SeekableseekToNewSource in class org.apache.hadoop.fs.FSInputStreamIOException - throws IOException if there is an errorpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic void mark(int readlimit)
UnsupportedOperationExceptionmark in class InputStreamreadlimit - ignoredpublic void reset()
throws IOException
UnsupportedOperationExceptionreset in class InputStreamIOExceptionpublic boolean markSupported()
ADLFileInputStream. Always returns false.markSupported in class InputStreamfalsepublic void unbuffer()
unbuffer in interface org.apache.hadoop.fs.CanUnbufferpublic boolean hasCapability(String capability)
hasCapability in interface org.apache.hadoop.fs.StreamCapabilities@VisibleForTesting public boolean isReadAheadEnabled()
@VisibleForTesting public int getReadAheadRange()
@VisibleForTesting protected void setCachedSasToken(CachedSASToken cachedSasToken)
@VisibleForTesting public String getStreamID()
@VisibleForTesting public AbfsInputStreamStatistics getStreamStatistics()
@VisibleForTesting public void registerListener(Listener listener1)
@VisibleForTesting public long getBytesFromReadAhead()
@VisibleForTesting public long getBytesFromRemoteRead()
@VisibleForTesting public int getBufferSize()
@VisibleForTesting protected int getFooterReadBufferSize()
@VisibleForTesting public int getReadAheadQueueDepth()
@VisibleForTesting public boolean shouldAlwaysReadBufferSize()
public org.apache.hadoop.fs.statistics.IOStatistics getIOStatistics()
getIOStatistics in interface org.apache.hadoop.fs.statistics.IOStatisticsSourcepublic String toString()
toString in class org.apache.hadoop.fs.FSInputStreamCopyright © 2008–2024 Apache Software Foundation. All rights reserved.