hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel
Class MaxMinConsumer

java.lang.Object
  extended by hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.ResourceSpreader
      extended by hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.MaxMinFairSpreader
          extended by hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.MaxMinConsumer
Direct Known Subclasses:
VirtualMachine

public class MaxMinConsumer
extends MaxMinFairSpreader

This class is part of the unified resource consumption model of DISSECT-CF. This class provides consumer (e.g., the beneficiary of the consumption of the resources of a provider) specific behavior for the MaxMinFairness resource spreading technique. This is a generic consumer. The implementation does not assume any particular use (e.g. network/cpu). It can even be used to model usual resource bottlenecks in computing environments (e.g. memory bandwidth, GPU).

Author:
"Gabor Kecskemeti, Distributed and Parallel Systems Group, University of Innsbruck (c) 2013"

Nested Class Summary
 
Nested classes/interfaces inherited from class hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.ResourceSpreader
ResourceSpreader.FreqSyncer
 
Field Summary
 
Fields inherited from class hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.ResourceSpreader
hashCounter, lastNotifTime, negligableProcessing, perTickProcessingPower, toBeAdded, toBeRemoved, underProcessing, underProcessingLen
 
Constructor Summary
MaxMinConsumer(double initialProcessing)
          Constructs a generic Max Min fairness based resource consumer.
 
Method Summary
protected  ResourceSpreader getCounterPart(ResourceConsumption con)
          Determines what is the provider this consumer is connected with via the resource consumption specified.
protected  ResourceSpreader getSamePart(ResourceConsumption con)
          Determines what is the consumer referred by the resource consumption specified.
protected  boolean isConsumer()
          Tells the world that this particular resource spreader is a consumer.
protected  double processSingleConsumption(ResourceConsumption con, long ticksPassed)
          Uses the resource consumption's consumer related processing operation to actually use the results of a resource consumption (e.g.
 String toString()
          provides some textual representation of this consumer, good for debugging and tracing
protected  void updateConsumptionLimit(ResourceConsumption con, double limit)
          Translates the consumption limit update request to actually changing a field in the resource consumption that is related to consumers.
 
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.MaxMinFairSpreader
singleGroupwiseFreqUpdater
 
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.ResourceSpreader
cancelConsumption, getCurrentPowerBehavior, getHashandIncCounter, getPerTickProcessingPower, getSyncer, getTotalProcessed, hashCode, isAcceptableConsumption, registerConsumption, removeTheseConsumptions, setCurrentPowerBehavior, setPerTickProcessingPower, subscribePowerBehaviorChangeEvents, unsubscribePowerBehaviorChangeEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MaxMinConsumer

public MaxMinConsumer(double initialProcessing)
Constructs a generic Max Min fairness based resource consumer.

Parameters:
initialProcessing - determines the amount of resources this consumer could utilize in a single tick
Method Detail

updateConsumptionLimit

protected void updateConsumptionLimit(ResourceConsumption con,
                                      double limit)
Translates the consumption limit update request to actually changing a field in the resource consumption that is related to consumers. The limit set here is expected to reflect the processing this consumer could utilize in the particular time instance with regards to the particular resource consumption.

Specified by:
updateConsumptionLimit in class MaxMinFairSpreader
Parameters:
con - the resource consumption object to be updated with the limit value
limit - the limit value to be propagated to the resource consumption object's relevant (i.e. provider/consumer specific) field

getCounterPart

protected ResourceSpreader getCounterPart(ResourceConsumption con)
Determines what is the provider this consumer is connected with via the resource consumption specified.

Specified by:
getCounterPart in class ResourceSpreader
Parameters:
con - The consumption object for which we would like to know the other party that participates in the processing with us.
Returns:
the other resource spreader that does the processing with us

getSamePart

protected ResourceSpreader getSamePart(ResourceConsumption con)
Determines what is the consumer referred by the resource consumption specified.

Specified by:
getSamePart in class ResourceSpreader
Parameters:
con - The consumption object on which this call will operate
Returns:
the resource spreader set to be in the same role (provider/consumer) as this resource spreader object (i.e., the spreader on which the function was calleD)

processSingleConsumption

protected double processSingleConsumption(ResourceConsumption con,
                                          long ticksPassed)
Uses the resource consumption's consumer related processing operation to actually use the results of a resource consumption (e.g. in case of a network transfer this means the consumer actually receives the data that so far just traveled through the network. In case of a virtual machine this could mean that the virtual CPU of the VM actually executes some instructions)

Specified by:
processSingleConsumption in class ResourceSpreader
Parameters:
con - the resource consumption to be realigned
ticksPassed - the time passed since the last processing request
Returns:
Its absolute value represents the amount of actually processed resources. If negative then the 'con' has completed its processing.

isConsumer

protected boolean isConsumer()
Tells the world that this particular resource spreader is a consumer.

Specified by:
isConsumer in class ResourceSpreader
Returns:
true if this resource spreader is a consumer, false otherwise

toString

public String toString()
provides some textual representation of this consumer, good for debugging and tracing

Overrides:
toString in class ResourceSpreader


Copyright © 2012–2015 University of Innsbruck & MTA SZTAKI. All rights reserved.