org.apache.hadoop.hbase.stargate.util
Class TokenBucket
java.lang.Object
org.apache.hadoop.hbase.stargate.util.TokenBucket
public class TokenBucket
- extends Object
Constructor Summary |
TokenBucket(int rate,
int size)
Constructor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TokenBucket
public TokenBucket(int rate,
int size)
- Constructor
- Parameters:
rate
- limit in units per secondsize
- maximum burst in units per second
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