|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object seda.sandStorm.core.RateLimitingPredicate
public class RateLimitingPredicate
This enqueue predicate implements input rate policing.
Field Summary | |
---|---|
private seda.util.StatsGatherer |
acceptArrivalStats
|
private static boolean |
DEBUG
|
private int |
depth
|
private seda.util.StatsGatherer |
interArrivalStats
|
private long |
lasttime
|
private long |
MIN_REGEN_TIME
|
private static boolean |
PROFILE
|
private double |
regenTimeMS
|
private double |
targetRate
|
private SinkIF |
thesink
|
private double |
tokenCount
|
Constructor Summary | |
---|---|
RateLimitingPredicate(SinkIF sink,
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()
Return the number of tokens currently in the bucket. |
int |
getDepth()
Return the current depth. |
double |
getTargetRate()
Return the current rate limit. |
void |
setDepth(int depth)
Set the bucket depth. |
void |
setTargetRate(double targetRate)
Set the rate limit. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final boolean DEBUG
private SinkIF thesink
private double targetRate
private int depth
private double tokenCount
private double regenTimeMS
private long lasttime
private long MIN_REGEN_TIME
private static final boolean PROFILE
private seda.util.StatsGatherer interArrivalStats
private seda.util.StatsGatherer acceptArrivalStats
Constructor Detail |
---|
public RateLimitingPredicate(SinkIF sink, double targetRate, int depth)
Method Detail |
---|
public boolean accept(QueueElementIF qel)
accept
in interface EnqueuePredicateIF
qel
- The QueueElementIF
to enqueue
public double getTargetRate()
public int getDepth()
public int getBucketSize()
public void setTargetRate(double targetRate)
public void setDepth(int depth)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |