More information: http://www.cs.berkeley.edu/~mdw/proj/seda/

seda.sandStorm.core
Class MulticlassRateLimitingPredicate

java.lang.Object
  |
  +--seda.sandStorm.core.MulticlassRateLimitingPredicate
All Implemented Interfaces:
EnqueuePredicateIF

public class MulticlassRateLimitingPredicate
extends java.lang.Object
implements EnqueuePredicateIF

This enqueue predicate implements multiclass input rate policing.


Constructor Summary
MulticlassRateLimitingPredicate(SinkIF sink, int numclasses, double targetRate, int depth)
          Create a new RateLimitingPredicate for the given sink, targetRate, and token bucket depth.
 
Method Summary
 boolean accept(QueueElementIF qel)
          Returns true if the given element can be accepted into the queue.
 int getBucketSize(int theclass)
          Return the number of tokens currently in the bucket.
 int getDepth(int theclass)
          Return the current depth.
 double getTargetRate(int theclass)
          Return the current rate limit.
 void setDepth(int theclass, int depth)
          Set the bucket depth.
 void setTargetRate(int theclass, double targetRate)
          Set the rate limit.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MulticlassRateLimitingPredicate

public MulticlassRateLimitingPredicate(SinkIF sink,
                                       int numclasses,
                                       double targetRate,
                                       int depth)
Create a new RateLimitingPredicate for the given sink, targetRate, and token bucket depth. A rate of -1.0 indicates no rate limit.
Method Detail

accept

public boolean accept(QueueElementIF qel)
Returns true if the given element can be accepted into the queue.
Specified by:
accept in interface EnqueuePredicateIF
Following copied from interface: seda.sandStorm.api.EnqueuePredicateIF
Parameters:
element - The QueueElementIF to enqueue
Returns:
True if the sink accepts the element; false otherwise.

getTargetRate

public double getTargetRate(int theclass)
Return the current rate limit.

getDepth

public int getDepth(int theclass)
Return the current depth.

getBucketSize

public int getBucketSize(int theclass)
Return the number of tokens currently in the bucket.

setTargetRate

public void setTargetRate(int theclass,
                          double targetRate)
Set the rate limit. A limit of -1.0 indicates no rate limit.

setDepth

public void setDepth(int theclass,
                     int depth)
Set the bucket depth.

More information: http://www.cs.berkeley.edu/~mdw/proj/seda/