org.apache.hadoop.tools.util
Class ThrottledInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.apache.hadoop.tools.util.ThrottledInputStream
All Implemented Interfaces:
Closeable

public class ThrottledInputStream
extends InputStream


Constructor Summary
ThrottledInputStream(InputStream rawStream)
           
ThrottledInputStream(InputStream rawStream, long maxBytesPerSec)
           
 
Method Summary
 void close()
           
 long getBytesPerSec()
           
 long getTotalBytesRead()
           
 long getTotalSleepTime()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 String toString()
           
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThrottledInputStream

public ThrottledInputStream(InputStream rawStream)

ThrottledInputStream

public ThrottledInputStream(InputStream rawStream,
                            long maxBytesPerSec)
Method Detail

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

getTotalBytesRead

public long getTotalBytesRead()

getBytesPerSec

public long getBytesPerSec()

getTotalSleepTime

public long getTotalSleepTime()

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014 InMobi. All rights reserved.