java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.fs.CanUnbuffer, org.apache.hadoop.fs.PositionedReadable, org.apache.hadoop.fs.Seekable, org.apache.hadoop.fs.statistics.IOStatisticsSource, org.apache.hadoop.fs.StreamCapabilitiespublic 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 | Description |
|---|---|---|
static int |
FOOTER_SIZE |
|
static int |
MAX_OPTIMIZED_READ_ATTEMPTS |
| Constructor | Description |
|---|---|
AbfsInputStream(AbfsClient client,
org.apache.hadoop.fs.FileSystem.Statistics statistics,
java.lang.String path,
long contentLength,
AbfsInputStreamContext abfsInputStreamContext,
java.lang.String eTag,
TracingContext tracingContext) |
| Modifier and Type | Method | 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() |
|
java.lang.String |
getPath() |
|
long |
getPos() |
Return the current offset from the start of the file
|
int |
getReadAheadQueueDepth() |
|
int |
getReadAheadRange() |
|
java.lang.String |
getStreamID() |
|
AbfsInputStreamStatistics |
getStreamStatistics() |
Getter for AbfsInputStreamStatistics.
|
TracingContext |
getTracingContext() |
|
boolean |
hasCapability(java.lang.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) |
|
java.lang.String |
toString() |
Get the statistics of the stream.
|
void |
unbuffer() |
readFully, readFully, validatePositionedReadArgsnullInputStream, read, readAllBytes, readNBytes, readNBytes, transferTopublic static final int FOOTER_SIZE
public static final int MAX_OPTIMIZED_READ_ATTEMPTS
public AbfsInputStream(AbfsClient client, org.apache.hadoop.fs.FileSystem.Statistics statistics, java.lang.String path, long contentLength, AbfsInputStreamContext abfsInputStreamContext, java.lang.String eTag, TracingContext tracingContext)
public java.lang.String getPath()
public int read(long position,
byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in interface org.apache.hadoop.fs.PositionedReadableread in class org.apache.hadoop.fs.FSInputStreamjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic void seek(long n)
throws java.io.IOException
seek in interface org.apache.hadoop.fs.Seekableseek in class org.apache.hadoop.fs.FSInputStreamn - position to seek tojava.io.IOException - if there is an errorjava.io.EOFException - if attempting to seek past end of filepublic long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOExceptionpublic int available()
throws java.io.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 java.io.InputStreamjava.io.IOExceptionpublic long length()
throws java.io.IOException
java.io.IOException - if the stream is closedpublic long getPos()
throws java.io.IOException
getPos in interface org.apache.hadoop.fs.SeekablegetPos in class org.apache.hadoop.fs.FSInputStreamjava.io.IOException - throws IOException if there is an errorpublic TracingContext getTracingContext()
public boolean seekToNewSource(long l)
throws java.io.IOException
seekToNewSource in interface org.apache.hadoop.fs.SeekableseekToNewSource in class org.apache.hadoop.fs.FSInputStreamjava.io.IOException - throws IOException if there is an errorpublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in class java.io.InputStreamjava.io.IOExceptionpublic void mark(int readlimit)
UnsupportedOperationExceptionmark in class java.io.InputStreamreadlimit - ignoredpublic void reset()
throws java.io.IOException
UnsupportedOperationExceptionreset in class java.io.InputStreamjava.io.IOExceptionpublic boolean markSupported()
ADLFileInputStream. Always returns false.markSupported in class java.io.InputStreamfalsepublic void unbuffer()
unbuffer in interface org.apache.hadoop.fs.CanUnbufferpublic boolean hasCapability(java.lang.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 java.lang.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 java.lang.String toString()
toString in class org.apache.hadoop.fs.FSInputStreamCopyright © 2008–2025 Apache Software Foundation. All rights reserved.