java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.fs.PositionedReadable, org.apache.hadoop.fs.Seekable@Private
@Evolving
public final class AdlFsInputStream
extends org.apache.hadoop.fs.FSInputStream
ADLFileInputStream implementation.| Constructor | Description |
|---|---|
AdlFsInputStream(com.microsoft.azure.datalake.store.ADLFileInputStream inputStream,
org.apache.hadoop.fs.FileSystem.Statistics statistics,
org.apache.hadoop.conf.Configuration conf) |
| Modifier and Type | Method | Description |
|---|---|---|
int |
available() |
This method returns the remaining bytes in the stream, rather than the
expected Java
interpretation of
InputStream.available(), which expects
the
number of remaining
bytes in the local buffer. |
void |
close() |
|
long |
getPos() |
Return the current offset from the start of the file.
|
int |
read() |
|
int |
read(byte[] buffer,
int offset,
int length) |
|
int |
read(long position,
byte[] buffer,
int offset,
int length) |
|
void |
seek(long pos) |
|
boolean |
seekToNewSource(long l) |
|
long |
skip(long pos) |
readFully, readFully, toString, validatePositionedReadArgsmark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, transferTopublic AdlFsInputStream(com.microsoft.azure.datalake.store.ADLFileInputStream inputStream,
org.apache.hadoop.fs.FileSystem.Statistics statistics,
org.apache.hadoop.conf.Configuration conf)
throws java.io.IOException
java.io.IOExceptionpublic void seek(long pos)
throws java.io.IOException
seek in interface org.apache.hadoop.fs.Seekableseek in class org.apache.hadoop.fs.FSInputStreamjava.io.IOExceptionpublic long getPos()
throws java.io.IOException
getPos in interface org.apache.hadoop.fs.SeekablegetPos in class org.apache.hadoop.fs.FSInputStreamjava.io.IOExceptionpublic boolean seekToNewSource(long l)
throws java.io.IOException
seekToNewSource in interface org.apache.hadoop.fs.SeekableseekToNewSource 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(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(byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int available()
throws java.io.IOException
InputStream.available(), which expects
the
number of remaining
bytes in the local buffer. Moreover, it caps the value returned to a
maximum of Integer.MAX_VALUE.
These changed behaviors are to ensure compatibility with the
expectations of HBase WAL reader,
which depends on available() returning the number of bytes in stream.
Given all other FileSystems in the hadoop ecosystem (especially HDFS) do
this, it is possible other
apps other than HBase would also pick up expectation of this behavior
based on HDFS implementation.
Therefore keeping this quirky behavior here, to ensure compatibility.available in class java.io.InputStreamjava.io.IOException - If fails to get the position or file length from SDK.public void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in class java.io.InputStreamjava.io.IOExceptionpublic long skip(long pos)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.