java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.fs.Seekablepublic class ThrottledInputStream
extends java.io.InputStream
implements org.apache.hadoop.fs.Seekable
| Constructor | Description |
|---|---|
ThrottledInputStream(java.io.InputStream rawStream) |
|
ThrottledInputStream(java.io.InputStream rawStream,
float maxBytesPerSec) |
| Modifier and Type | Method | 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) |
|
java.lang.String |
toString() |
public ThrottledInputStream(java.io.InputStream rawStream)
public ThrottledInputStream(java.io.InputStream rawStream,
float maxBytesPerSec)
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 int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b)
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 long getTotalBytesRead()
public long getBytesPerSec()
public long getTotalSleepTime()
public java.lang.String toString()
toString in class java.lang.Objectpublic void seek(long pos)
throws java.io.IOException
seek in interface org.apache.hadoop.fs.Seekablejava.io.IOExceptionpublic long getPos()
throws java.io.IOException
getPos in interface org.apache.hadoop.fs.Seekablejava.io.IOExceptionpublic boolean seekToNewSource(long targetPos)
throws java.io.IOException
seekToNewSource in interface org.apache.hadoop.fs.Seekablejava.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.