Interface RateControlledEntity
- All Superinterfaces:
ControllerAllocationManagement
- All Known Implementing Classes:
MultiPeerDownloader2, MultiPeerUploader, RateControlledMultipleEntity, RateControlledSingleEntity, SinglePeerDownloader, SinglePeerUploader
Interface designation for rate-limited entities controlled by a handler.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intGuaranteed scheduling of processing ops, with preference over normal-priority entities.static final intUses fair round-robin scheduling of processing ops.Fields inherited from interface ControllerAllocationManagement
UNALLOCATED_PARTITION -
Method Summary
Modifier and TypeMethodDescriptionbooleancanProcess(EventWaiter waiter) longdoProcessing(EventWaiter waiter, int max_bytes_permitted) Attempt to do a processing operation.longintgetConnectionCount(EventWaiter waiter) If there are no connections then the waiter will be kicked when a connection arrivesintIs ready for a processing op.intGet this entity's priority level.booleanstats functionsintgetReadyConnectionCount(EventWaiter waiter) The waiter is kicked if the ready condition changes
-
Field Details
-
PRIORITY_NORMAL
static final int PRIORITY_NORMALUses fair round-robin scheduling of processing ops.- See Also:
-
PRIORITY_HIGH
static final int PRIORITY_HIGHGuaranteed scheduling of processing ops, with preference over normal-priority entities.- See Also:
-
-
Method Details
-
getPartitionID
int getPartitionID()Is ready for a processing op.- Returns:
- true if it can process >0 bytes, false if not ready
-
canProcess
-
doProcessing
Attempt to do a processing operation.- Returns:
- true if >0 bytes were processed (success), false if 0 bytes were processed (failure)
-
getPriority
int getPriority()Get this entity's priority level.- Returns:
- priority
-
getPriorityBoost
boolean getPriorityBoost()stats functions- Returns:
-
getBytesReadyToWrite
long getBytesReadyToWrite() -
getConnectionCount
If there are no connections then the waiter will be kicked when a connection arrives- Parameters:
waiter-- Returns:
-
getReadyConnectionCount
The waiter is kicked if the ready condition changes- Parameters:
waiter-- Returns:
-
getRateHandler
RateHandler getRateHandler() -
getString
String getString()
-