Class ThrottledInputStream

java.lang.Object
java.io.InputStream
org.apache.hadoop.hbase.io.hadoopbackport.ThrottledInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

@Private public class ThrottledInputStream extends InputStream
The ThrottleInputStream provides bandwidth throttling on a specified InputStream. It is implemented as a wrapper on top of another InputStream instance. The throttling works by examining the number of bytes read from the underlying InputStream from the beginning, and sleep()ing for a time interval if the byte-transfer is found exceed the specified tolerable maximum. (Thus, while the read-rate might exceed the maximum for a given short interval, the average tends towards the specified maximum, overall.)