|
Lightweight Bartering Grid | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlbg.peer.core.rms.ResourceManager
public class ResourceManager
Constructor Summary | |
---|---|
ResourceManager(Peer managed_peer,
boolean data_present_enabled,
boolean data_replication_enabled,
float idle_replication_ratio,
boolean psufferage_enabled)
|
Method Summary | |
---|---|
void |
addResource(ResourceHandle rh,
int power)
|
int |
countBusyLocalResources()
|
int |
countBusyResources()
|
int |
countBusySupplyingResources()
|
int |
countIdleResources()
|
int |
countTotalResources()
|
ConsumptionDataTracker |
dataTracker()
|
long |
freeBusyLocalResource(Task t)
Clears the state of the target Resource. |
long |
freeBusySupplyingResource(Task t)
Clears the state of the target Resource. |
double |
getCachedUtilizationValue()
Returns the most cached value of Peer utilization, i.e. |
Task |
getRunningTask(ResourceHandle rh)
Returns the Task running on target Busy Resource. |
WorkingSet |
getWorkingSetOfIdleResource(ResourceHandle rh)
Returns the WorkingSet of the target Resource, if target Resource is idle. |
boolean |
hasBusyLocalResource()
|
boolean |
hasBusySupplyingResource()
|
boolean |
hasIdleResource()
|
ResourceHandle |
locateResource(ResourceState state,
Task t)
Locates a Resource currentlty in target state with maximum Storage Affinity with target Task. |
double |
meanNominalResourcePower()
|
long |
preemptBusyLocalResource(Task t)
Clears the state of the target Resource. |
long |
preemptBusySupplyingResource(Task t)
Clears the state of the target Resource. |
long |
preemptBusySupplyingResource(Task t,
ResourceHandle rh)
Clears the state of the target Resource. |
void |
removeResource(ResourceHandle rh)
Removes a Resource from the Peer. |
void |
replicateSupplyingData()
Replicates Supplying data to Resources. |
boolean |
runLocalTask(ResourceHandle rh,
Task t)
Runs target Task on target Resource. |
boolean |
runSupplyingTask(ResourceHandle rh,
Task t)
Runs target Task on target Resource. |
java.lang.String |
toString()
|
void |
updateUtilizationValue()
|
double |
utilization()
Returns the Peer utilization, i.e. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ResourceManager(Peer managed_peer, boolean data_present_enabled, boolean data_replication_enabled, float idle_replication_ratio, boolean psufferage_enabled) throws GridException
GridException
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public double meanNominalResourcePower()
public void addResource(ResourceHandle rh, int power) throws GridException
GridException
public void removeResource(ResourceHandle rh) throws GridException
GridException
public int countTotalResources()
public int countIdleResources()
public int countBusyResources()
public int countBusyLocalResources()
public int countBusySupplyingResources()
public boolean hasIdleResource()
public boolean hasBusyLocalResource() throws GridException
GridException
public boolean hasBusySupplyingResource() throws GridException
GridException
public double utilization() throws GridException
GridException
- if Resource usage data is corruptedpublic double getCachedUtilizationValue()
public void updateUtilizationValue() throws GridException
GridException
public ConsumptionDataTracker dataTracker()
public ResourceHandle locateResource(ResourceState state, Task t) throws GridException
state
- target statet
- target Task
GridException
public boolean runLocalTask(ResourceHandle rh, Task t) throws GridException
rh
- target Resourcet
- target Task
GridException
public boolean runSupplyingTask(ResourceHandle rh, Task t) throws GridException
rh
- target Resourcet
- target Task
GridException
public long freeBusyLocalResource(Task t) throws GridException
It is expected that the Resource is idle and has already completed the target Task, because freeResource() will not perform Task completion on the Resource.
t
- target Local Task
GridException
- if a parameter is illegalpublic long freeBusySupplyingResource(Task t) throws GridException
It is expected that the Resource is idle and has already completed the target Task, because freeResource() will not perform Task completion on the Resource.
t
- target Supplying Task
GridException
- if a parameter is illegalpublic long preemptBusyLocalResource(Task t) throws GridException
It is expected that the Resource is busy and the target Task has not been cancelled yet, because preemptResource() will perform Task cancellation on the Resource.
t
- target Task
GridException
- if a parameter is illegalpublic long preemptBusySupplyingResource(Task t) throws GridException
It is expected that the Resource is busy and the target Task has not been cancelled yet, because clearResource() will perform Task cancellation on the Resource.
t
- target Supplying Task
GridException
- if a parameter is illegalpublic long preemptBusySupplyingResource(Task t, ResourceHandle rh) throws GridException
It is expected that the Resource is busy and the target Task has not been cancelled yet, because clearResource() will perform Task cancellation on the Resource.
t
- target Supplying Taskrh
- target ResourceHandle
GridException
- if a parameter is illegalpublic Task getRunningTask(ResourceHandle rh) throws GridException
rh
- target Busy Resource
GridException
public WorkingSet getWorkingSetOfIdleResource(ResourceHandle rh) throws GridException
Note: does not assume that Resource is idle, but rather returns a WorkingSet only when it is idle.
GridException
public void replicateSupplyingData() throws GridException
Note: only a subset of idle Resources is targeted by the replication process.
GridException
|
Lightweight Bartering Grid | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.