public class ThrottledInputStream extends InputStream implements org.apache.hadoop.fs.Seekable
| Constructor and Description |
|---|
ThrottledInputStream(InputStream rawStream) |
ThrottledInputStream(InputStream rawStream,
float maxBytesPerSec) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
getBytesPerSec()
Getter for the read-rate from this stream, since creation.
|
long |
getPos() |
long |
getTotalBytesRead()
Getter for the number of bytes read from this stream, since creation.
|
long |
getTotalSleepTime()
Getter the total time spent in sleep.
|
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
seek(long pos) |
boolean |
seekToNewSource(long targetPos) |
String |
toString() |
available, mark, markSupported, reset, skippublic ThrottledInputStream(InputStream rawStream)
public ThrottledInputStream(InputStream rawStream, float maxBytesPerSec)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic long getTotalBytesRead()
public long getBytesPerSec()
public long getTotalSleepTime()
public void seek(long pos)
throws IOException
seek in interface org.apache.hadoop.fs.SeekableIOExceptionpublic long getPos()
throws IOException
getPos in interface org.apache.hadoop.fs.SeekableIOExceptionpublic boolean seekToNewSource(long targetPos)
throws IOException
seekToNewSource in interface org.apache.hadoop.fs.SeekableIOExceptionCopyright © 2008–2020 Apache Software Foundation. All rights reserved.