private static class FileLink.FileLinkInputStream extends InputStream implements org.apache.hadoop.fs.Seekable, org.apache.hadoop.fs.PositionedReadable, org.apache.hadoop.fs.CanSetDropBehind, org.apache.hadoop.fs.CanSetReadahead, org.apache.hadoop.fs.CanUnbuffer
Modifier and Type | Field and Description |
---|---|
private int |
bufferSize |
private org.apache.hadoop.fs.Path |
currentPath |
private FileLink |
fileLink |
private org.apache.hadoop.fs.FileSystem |
fs |
private org.apache.hadoop.fs.FSDataInputStream |
in |
private long |
pos |
Constructor and Description |
---|
FileLinkInputStream(org.apache.hadoop.fs.FileSystem fs,
FileLink fileLink) |
FileLinkInputStream(org.apache.hadoop.fs.FileSystem fs,
FileLink fileLink,
int bufferSize) |
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close() |
long |
getPos() |
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
int |
read(long position,
byte[] buffer,
int offset,
int length) |
void |
readFully(long position,
byte[] buffer) |
void |
readFully(long position,
byte[] buffer,
int offset,
int length) |
void |
reset() |
void |
seek(long pos) |
boolean |
seekToNewSource(long targetPos) |
void |
setDropBehind(Boolean dropCache) |
void |
setReadahead(Long readahead) |
long |
skip(long n) |
private org.apache.hadoop.fs.FSDataInputStream |
tryOpen()
Try to open the file from one of the available locations.
|
void |
unbuffer() |
private org.apache.hadoop.fs.FSDataInputStream in
private org.apache.hadoop.fs.Path currentPath
private long pos
private final int bufferSize
private final org.apache.hadoop.fs.FileSystem fs
public FileLinkInputStream(org.apache.hadoop.fs.FileSystem fs, FileLink fileLink) throws IOException
IOException
public FileLinkInputStream(org.apache.hadoop.fs.FileSystem fs, FileLink fileLink, int bufferSize) throws IOException
IOException
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] b) throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public int read(long position, byte[] buffer, int offset, int length) throws IOException
read
in interface org.apache.hadoop.fs.PositionedReadable
IOException
public void readFully(long position, byte[] buffer) throws IOException
readFully
in interface org.apache.hadoop.fs.PositionedReadable
IOException
public void readFully(long position, byte[] buffer, int offset, int length) throws IOException
readFully
in interface org.apache.hadoop.fs.PositionedReadable
IOException
public long skip(long n) throws IOException
skip
in class InputStream
IOException
public int available() throws IOException
available
in class InputStream
IOException
public void seek(long pos) throws IOException
seek
in interface org.apache.hadoop.fs.Seekable
IOException
public long getPos() throws IOException
getPos
in interface org.apache.hadoop.fs.Seekable
IOException
public boolean seekToNewSource(long targetPos) throws IOException
seekToNewSource
in interface org.apache.hadoop.fs.Seekable
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public void mark(int readlimit)
mark
in class InputStream
public void reset() throws IOException
reset
in class InputStream
IOException
public boolean markSupported()
markSupported
in class InputStream
public void unbuffer()
unbuffer
in interface org.apache.hadoop.fs.CanUnbuffer
private org.apache.hadoop.fs.FSDataInputStream tryOpen() throws IOException
IOException
- on unexpected error, or file not found.public void setReadahead(Long readahead) throws IOException, UnsupportedOperationException
setReadahead
in interface org.apache.hadoop.fs.CanSetReadahead
IOException
UnsupportedOperationException
public void setDropBehind(Boolean dropCache) throws IOException, UnsupportedOperationException
setDropBehind
in interface org.apache.hadoop.fs.CanSetDropBehind
IOException
UnsupportedOperationException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.