|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthu.mta.sztaki.lpds.cloud.simulator.Timed
hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.ResourceSpreader.FreqSyncer
public static class ResourceSpreader.FreqSyncer
This class is the core part of the unified resource consumption model of DISSECT-CF. The main purpose of this class is to create and manage influence groups from resource spreaders that are connected with resource consumptions. Also the class is also expected to coordinate the processing of the resource consumptions within the entire influence group. Finally, the class is responsible to deliver the completion or failure events for the resource consumptions deregistered from the influence group's resource spreaders. The name FreqSyncer comes from the class's primary goal, identify the earliest time there is a change in the scheduling (e.g., because a new resource consumption is added to the group or because one of the consumptions complete), and then make sure that all spreaders in the influence group receive timing events at the same time instance.
Field Summary | |
---|---|
private ArrayList<ResourceSpreader> |
depGroupExtension
those resource spreaders that need to be added to the influence group at the particular time instance |
private int |
depgrouplen
The current length of the myDepGroup array. |
private int |
firstConsumerId
The index of the first consumer in the myDepGroup array. |
private ResourceSpreader[] |
myDepGroup
The influence group managed by this freqsyncer object. |
private boolean |
nudged
if there are some external activities that could lead to influence group changes this field will be turned to true the tick function then ensures it to return to false once it has completed its management operations on the influence groups |
private boolean |
regularFreqMode
if the freqsyncer identifies the need to fire events with 0 frequency then it turns this mode off. |
Constructor Summary | |
---|---|
private |
ResourceSpreader.FreqSyncer(ResourceSpreader[] myDepGroup,
int provcount,
int dglen)
The constructor to be used when a new influence group needs to be created because the original group got fragmented. |
private |
ResourceSpreader.FreqSyncer(ResourceSpreader provider,
ResourceSpreader consumer)
Constructor of a freqsyncer to be used when neither the provider nor the consumer of a resource consumption belongs to an already existing influence group. |
Method Summary | |
---|---|
private void |
addSingleToDG(ResourceSpreader rs)
Allows a single spreader object to be added to the influence group. |
private void |
addToGroup()
This function copies the contents of the depGroupExtension list to the array representing the influence group and ensures that all newly added members of the influence group know their group membership. |
private void |
buildDepGroup(ResourceSpreader startingItem)
Marks all resource spreaders in the currently decomposing influence group that the starting spreader has connections with. |
ResourceSpreader[] |
getClonedDepGroup()
This will always give a fresh copy of the depgroup which can be changed as the user desires. |
(package private) ResourceSpreader[] |
getDepGroup()
Only those should get the depgroup with this function who are not planning to change it's contents. |
int |
getDGLen()
queries the number of resource spreaders that are part of the influence group managed by this freqsyncer. |
int |
getFirstConsumerId()
query the index of the first consumer in the influence group's internal array representation |
private boolean |
isInDepGroup(ResourceSpreader lookfor)
Determines if the spreader in question is part of the current influence group or not |
boolean |
isRegularFreqMode()
Determines if the influence group is processing 0 ticks long consumptions. |
(package private) void |
nudge()
To be used to initiate out of order frequency updates. |
protected void |
outOfOrderProcessing(long currentTime)
Goes through the entire influence group and for each member it initiates its doProcessing function. |
void |
tick(long fires)
Implementation of Algorithm 1 from "DISSECT-CF: a simulator to foster energy-aware scheduling in infrastructure clouds" Manages the influence group's growth and decomposition. |
String |
toString()
provides a textual overview of the influence group with all its members. |
private void |
updateMyFreqNow()
Calls out to the low level scheduler of the group to assign processing limits for each consumption in the group and to identify the completion time of the earliest terminating consumption. |
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.Timed |
---|
calcTimeJump, compareTo, fire, getFireCount, getFrequency, getNextEvent, getNextFire, isSubscribed, jumpTime, nextEventDistance, resetTimed, setBackPreference, simulateUntil, simulateUntilLastEvent, skipEventsTill, subscribe, unsubscribe, updateFrequency |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private ResourceSpreader[] myDepGroup
private int depgrouplen
private int firstConsumerId
private final ArrayList<ResourceSpreader> depGroupExtension
private boolean nudged
private boolean regularFreqMode
Constructor Detail |
---|
private ResourceSpreader.FreqSyncer(ResourceSpreader provider, ResourceSpreader consumer)
provider
- the provider to be added to the initial influence groupconsumer
- the consumer to be added to the initial influence groupprivate ResourceSpreader.FreqSyncer(ResourceSpreader[] myDepGroup, int provcount, int dglen)
myDepGroup
- the group members to take part in the new influence groupprovcount
- the number of providers in the groupdglen
- the length of the influence groupMethod Detail |
---|
private void addSingleToDG(ResourceSpreader rs)
rs
- the spreader to be added to the influence groupprivate void addToGroup()
private boolean isInDepGroup(ResourceSpreader lookfor)
lookfor
- the spreader in question
void nudge()
ResourceSpreader[] getDepGroup()
public int getDGLen()
public ResourceSpreader[] getClonedDepGroup()
public String toString()
toString
in class Timed
public int getFirstConsumerId()
protected final void outOfOrderProcessing(long currentTime)
currentTime
- the time instance for which the processing should be donepublic void tick(long fires)
tick
in class Timed
fires
- The particular time instance when the function was called. The
time instance is passed so the tick functions will not need to
call getFireCount() if they need to operate on the actual
time.private void updateMyFreqNow()
public boolean isRegularFreqMode()
private void buildDepGroup(ResourceSpreader startingItem)
startingItem
- the starting item from which point the influence group
should be constructured.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |