Class RateLimitedInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.apache.accumulo.core.file.streams.RateLimitedInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.fs.Seekable
public class RateLimitedInputStream extends FilterInputStream implements org.apache.hadoop.fs.Seekable
A decorator for anInputStreamwhich limits the rate at which reads are performed.
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description RateLimitedInputStream(StreamType stream, RateLimiter rateLimiter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetPos()intread()intread(byte[] buffer, int offset, int length)voidseek(long pos)booleanseekToNewSource(long targetPos)-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
RateLimitedInputStream
public RateLimitedInputStream(StreamType stream, RateLimiter rateLimiter)
-
-
Method Detail
-
read
public int read() throws IOException- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
public int read(byte[] buffer, int offset, int length) throws IOException- Overrides:
readin classFilterInputStream- Throws:
IOException
-
seek
public void seek(long pos) throws IOException- Specified by:
seekin interfaceorg.apache.hadoop.fs.Seekable- Throws:
IOException
-
getPos
public long getPos() throws IOException- Specified by:
getPosin interfaceorg.apache.hadoop.fs.Seekable- Throws:
IOException
-
seekToNewSource
public boolean seekToNewSource(long targetPos) throws IOException- Specified by:
seekToNewSourcein interfaceorg.apache.hadoop.fs.Seekable- Throws:
IOException
-
-