|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.ResourceConsumption
public class ResourceConsumption
The instances of this class represent an individual resource consumption in the system. The visibility of the class and its members are defined so the compiler does not need to generate access methods for the members thus allowing fast and prompt changes in its contents. Upon setting up the consumption, every instance is registered at the provider and the consumer resource spreaders. Once the consumption is completed these registrations should be dropped. WARNING this is an internal representation of the consumption. This class is not supposed to be used outside of the context of the ResourceModel.
Nested Class Summary | |
---|---|
static interface |
ResourceConsumption.ConsumptionEvent
This interface allows its implementors to get notified when a consumption completes. |
Field Summary | |
---|---|
private long |
completionDistance
|
private ResourceSpreader |
consumer
|
(package private) double |
consumerLimit
|
(package private) ResourceConsumption.ConsumptionEvent |
ev
The event to be fired when there is nothing left to process in this consumption. |
private double |
halfRealLimit
|
private double |
hardLimit
|
(package private) boolean |
inassginmentprocess
|
static Comparator<ResourceConsumption> |
limitComparator
|
(package private) double |
limithelper
|
private double |
processingLimit
|
private ResourceSpreader |
provider
|
(package private) double |
providerLimit
|
private double |
realLimit
|
private boolean |
registered
|
private double |
requestedLimit
|
private boolean |
resumable
|
private double |
toBeProcessed
The remaining unprocessed entities (e.g., remaining bytes of a transfer) |
(package private) boolean |
unassigned
|
private double |
underProcessing
The currently processing entities (e.g., a network buffer) |
static double |
unlimitedProcessing
|
Constructor Summary | |
---|---|
ResourceConsumption(double total,
double limit,
ResourceSpreader consumer,
ResourceSpreader provider,
ResourceConsumption.ConsumptionEvent e)
This constructor describes the basic properties of an individual resource consumption. |
Method Summary | |
---|---|
private void |
calcCompletionDistance()
|
void |
cancel()
|
(package private) double |
doConsumerProcessing(long ticksPassed)
|
(package private) double |
doProviderProcessing(long ticksPassed)
|
long |
getCompletionDistance()
|
ResourceSpreader |
getConsumer()
|
double |
getHardLimit()
|
double |
getProcessingLimit()
|
ResourceSpreader |
getProvider()
|
double |
getRealLimit()
|
double |
getToBeProcessed()
|
double |
getUnderProcessing()
|
double |
getUnProcessed()
|
boolean |
isRegistered()
|
boolean |
isResumable()
|
boolean |
registerConsumption()
|
void |
setConsumer(ResourceSpreader consumer)
|
(package private) double |
setProcessingLimit(double pl)
|
void |
setProvider(ResourceSpreader provider)
|
private void |
setRealLimit(double rL)
|
void |
suspend()
|
String |
toString()
|
private void |
updateHardLimit()
|
(package private) double |
updateRealLimit(boolean updateCD)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Comparator<ResourceConsumption> limitComparator
public static final double unlimitedProcessing
private double underProcessing
private double toBeProcessed
private double processingLimit
private double requestedLimit
private double hardLimit
private double realLimit
private double halfRealLimit
private long completionDistance
double providerLimit
double consumerLimit
double limithelper
boolean unassigned
boolean inassginmentprocess
final ResourceConsumption.ConsumptionEvent ev
private ResourceSpreader consumer
private ResourceSpreader provider
private boolean resumable
private boolean registered
Constructor Detail |
---|
public ResourceConsumption(double total, double limit, ResourceSpreader consumer, ResourceSpreader provider, ResourceConsumption.ConsumptionEvent e)
total
- The amount of processing to be done during the lifetime of the
just created objecte
- Specify here the event to be fired when the just created
object completes its transfers. With this event it is possible
to notify the entity who initiated the transfer.Method Detail |
---|
private void updateHardLimit()
public boolean registerConsumption()
public double getUnProcessed()
public void cancel()
public void suspend()
public void setProvider(ResourceSpreader provider)
public void setConsumer(ResourceSpreader consumer)
private void calcCompletionDistance()
double doProviderProcessing(long ticksPassed)
double doConsumerProcessing(long ticksPassed)
public double getToBeProcessed()
public double getUnderProcessing()
double setProcessingLimit(double pl)
public double getProcessingLimit()
public double getRealLimit()
public long getCompletionDistance()
public ResourceSpreader getConsumer()
public ResourceSpreader getProvider()
private void setRealLimit(double rL)
double updateRealLimit(boolean updateCD)
public String toString()
toString
in class Object
public boolean isRegistered()
public boolean isResumable()
public double getHardLimit()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |