private static class FileLink.FileLinkInputStream extends InputStream implements org.apache.hadoop.fs.Seekable, org.apache.hadoop.fs.PositionedReadable
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 |
---|
FileLink.FileLinkInputStream(org.apache.hadoop.fs.FileSystem fs,
FileLink 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) |
long |
skip(long n) |
private org.apache.hadoop.fs.FSDataInputStream |
tryOpen()
Try to open the file from one of the available locations.
|
private org.apache.hadoop.fs.FSDataInputStream in
private org.apache.hadoop.fs.Path currentPath
private long pos
private final FileLink fileLink
private final int bufferSize
private final org.apache.hadoop.fs.FileSystem fs
public FileLink.FileLinkInputStream(org.apache.hadoop.fs.FileSystem fs, FileLink fileLink) throws IOException
IOException
public FileLink.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
private org.apache.hadoop.fs.FSDataInputStream tryOpen() throws IOException
IOException
- on unexpected error, or file not found.Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.