org.apache.hadoop.hbase.stargate.util
Class TokenBucket

java.lang.Object
  extended by org.apache.hadoop.hbase.stargate.util.TokenBucket

public class TokenBucket
extends Object


Constructor Summary
TokenBucket(int rate, int size)
          Constructor
 
Method Summary
 int available()
           
 void remove(int t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenBucket

public TokenBucket(int rate,
                   int size)
Constructor

Parameters:
rate - limit in units per second
size - maximum burst in units per second
Method Detail

available

public int available()
Returns:
the number of remaining tokens in the bucket

remove

public void remove(int t)
Parameters:
t - the number of tokens to consume from the bucket


Copyright © 2010 The Apache Software Foundation