|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ourgrid.peer.manager.EBPeerManager
public class EBPeerManager
The EBPeerManager
is responsible to manage the peer resources
(Gums). It is important to distribute the gums to the correct request and
keep the grid machines distributed steadily.
Field Summary | |
---|---|
protected AllocationManager |
allocationManager
|
protected EBCommunityObtainerFacade |
ebCommunityObtainer
|
protected EBGumManagerImpl |
ebGumManager
|
protected RequestManager |
requestManager
|
Constructor Summary | |
---|---|
|
EBPeerManager(GumpClientThreadManager consumerThreadManager,
ObjectID remoteAccessID,
ObjectID brokerAccessID,
UIManager uiManager)
Default constructor. |
protected |
EBPeerManager(RequestManager reqManager,
AllocationManager allocationManager,
GumpClientThreadManager consumerThreadManager,
UIManager uiManager)
This constructor should be directly used only by tests. |
Method Summary | |
---|---|
void |
adviceFailureDetector(GumID gumID)
|
protected void |
computeCommunityRedistribution(java.util.List<DistributionHelpEntry> redistributionList,
int numberOfGumsInUseByCommunity)
Calculates the new distribution of local gums allocated to the community according to Network of Favors balances. |
void |
config(EBCommunityObtainerFacade communityObtainerFacade,
EBGumManagerImpl gumManager)
Configure internal modules. |
void |
consumerIsDead(ObjectID consumerID)
|
void |
disposeGum(long requestID,
GumID gumID)
|
void |
finishRequestGums(long requestID)
|
void |
gumWasLost(GumID gumID)
|
void |
hereIsGum(EBGum receivedGum,
ObjectID gumOwnerObjectID,
long requestID)
|
void |
hereIsLocalGum(EBGum ebGum,
GumSpec gumSpec)
When a machine is set at EBGumManagerImpl at it state is
up, a hereIsLocalGuM is received at this entity. |
void |
lostGum(GumID gumID,
long requestID)
|
void |
pauseRequestGums(long requestID)
|
protected void |
preemptGum(GumID gumID)
Preempts a grid machine, that is, deallocate the grid machine from a request. |
protected void |
redistributeLocalGumsForLocalRequests(long newRequestId)
|
protected void |
redistributeLocalGumsForRemoteRequests(long newRequestId)
|
void |
requestGums(RequestSpec requestSpec)
|
protected void |
respondRequest(long newRequestId)
Tries to serve a request with local deallocated gums. |
void |
resumeRequestGums(long requestID)
|
void |
unwantedGum(long requestID,
GumID gumID)
Notifies the request that the given gum is not wanted. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected RequestManager requestManager
protected AllocationManager allocationManager
protected EBGumManagerImpl ebGumManager
protected EBCommunityObtainerFacade ebCommunityObtainer
Constructor Detail |
---|
public EBPeerManager(GumpClientThreadManager consumerThreadManager, ObjectID remoteAccessID, ObjectID brokerAccessID, UIManager uiManager)
consumerThreadManager
- a thread manager to control the operations
done in separate threads (for example: delivering a machine to to
a remote consumer)remoteAccessID
- the identification of the remote object used by
remote peer to access this peerbrokerAccessID
- the identification of the remote object used by
local brokers to access this peerprotected EBPeerManager(RequestManager reqManager, AllocationManager allocationManager, GumpClientThreadManager consumerThreadManager, UIManager uiManager)
reqManager
- RequestManager
created by the testallocationManager
- AllocationManager
created by the
testconsumerThreadManager
- GumpClientThreadManager
created by the testMethod Detail |
---|
public void config(EBCommunityObtainerFacade communityObtainerFacade, EBGumManagerImpl gumManager)
public void requestGums(RequestSpec requestSpec) throws RequestAlreadyExistsException
requestGums
in interface EBGump
RequestAlreadyExistsException
Gump.requestGums(RequestSpec)
protected void redistributeLocalGumsForLocalRequests(long newRequestId) throws RequestDoesNotExistException
RequestDoesNotExistException
protected void redistributeLocalGumsForRemoteRequests(long newRequestId) throws RequestDoesNotExistException
RequestDoesNotExistException
protected void computeCommunityRedistribution(java.util.List<DistributionHelpEntry> redistributionList, int numberOfGumsInUseByCommunity)
redistributionList
- a list containing information about consumers.
It will be modified by this method.numberOfGumsInUseByCommunity
- the total number of gums currently
allocated to the communityprotected void respondRequest(long newRequestId) throws RequestDoesNotExistException
newRequestId
- the request to be served
RequestDoesNotExistException
public void finishRequestGums(long requestID)
finishRequestGums
in interface EBGump
Gump.finishRequestGums(long)
public void disposeGum(long requestID, GumID gumID)
disposeGum
in interface EBGump
Gump.disposeGum(long, GumID)
public void lostGum(GumID gumID, long requestID)
public void adviceFailureDetector(GumID gumID)
public void gumWasLost(GumID gumID)
public void hereIsGum(EBGum receivedGum, ObjectID gumOwnerObjectID, long requestID)
hereIsGum
in interface EBGumpClient
GumpClient.hereIsGum(GumResponseEntry)
public void hereIsLocalGum(EBGum ebGum, GumSpec gumSpec)
EBGumManagerImpl
at it state is
up, a hereIsLocalGuM is received at this entity.
public void pauseRequestGums(long requestID)
pauseRequestGums
in interface EBGump
Gump.pauseRequestGums(long)
public void resumeRequestGums(long requestID)
resumeRequestGums
in interface EBGump
Gump.resumeRequestGums(long)
protected void preemptGum(GumID gumID)
gumID
- the identification of the grid machine to be preemptedpublic void consumerIsDead(ObjectID consumerID)
public void unwantedGum(long requestID, GumID gumID)
unwantedGum
in interface EBGump
requestID
- ID of the request to notify.gumID
- ID of the gum that is not wanted.Gump.unwantedGum(long, GumID)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |