|
Lightweight Bartering Grid | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlbg.peer.service.LivePeerHandle
public class LivePeerHandle
A peer handle grouping everything needed by other peers, resources and user
| Constructor Summary | |
|---|---|
LivePeerHandle(java.lang.String id,
java.lang.String hostname,
int peer_port,
int resource_port,
int user_port)
Create a handle to a peer |
|
| Method Summary | |
|---|---|
void |
addResource(ResourceHandle rh,
int power)
Register a resource as part of this Peer |
void |
cancelJob(int job_id)
Cancels a Job from the Peer |
void |
cancelLocalTaskOnSupplyingResource(java.lang.String supplier_id,
Task t)
Cancel a task from this Peer running on another Peer |
void |
cancelSupplyingTaskOnLocalResource(java.lang.String consumer_id,
Task t)
Cancel a task from another Peer running on this Peer |
int |
compareTo(PeerHandle other)
|
ConsumptionTaskID |
computeSupplyingTask(java.lang.String consumer_id,
Task t)
Compute a task. |
boolean |
equals(java.lang.Object obj)
|
void |
grantConsumption(java.lang.String supplier_id,
int granted_count)
Grant a consumption for a number of tasks |
int |
hashCode()
|
java.lang.String |
hostname()
|
java.lang.String |
id()
|
boolean |
isAlive()
Checks if this peer is alive (i.e. |
int |
peerPort()
|
void |
preemptLocalTaskOnLocalResource(Task t,
byte[] logs)
Cancels a task from this Peer running on this Resource |
void |
preemptSupplyingTaskOnLocalResource(java.lang.String consumer_id,
Task t,
byte[] logs)
Preempts a task from another Peer running on this Peer |
int |
queryJobStatus(int job_id)
Queries Job status from the Peer |
void |
removeResource(ResourceHandle rh)
Remove a resource from this Peer |
void |
requestSupplying(java.lang.String consumer_id,
int tasks_count)
Request this peer to supply power for a number of tasks |
int |
resourcePort()
|
int |
submitJob(UserHandle uh,
JobDescriptor jd)
Submit a job to peer |
java.lang.String |
toString()
|
void |
uploadBySupplyingCompletedTask(java.lang.String supplier_id,
Task t)
|
void |
uploadLocallyCompletedTask(Task t)
Upload a task completed by a resource to this Peer |
int |
userPort()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LivePeerHandle(java.lang.String id,
java.lang.String hostname,
int peer_port,
int resource_port,
int user_port)
throws GridException
id - Peer IDhostname - Peer hostnamepeer_port - Peer-to-Peer communication portresource_port - Resource-to-Peer communication portuser_port - User-to-Peer communication port
GridException| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(PeerHandle other)
compareTo in interface java.lang.Comparable<PeerHandle>public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String id()
id in interface PeerHandlepublic java.lang.String hostname()
hostname in interface PeerHandlepublic int peerPort()
peerPort in interface AbstractExternalPeerHandle
public void requestSupplying(java.lang.String consumer_id,
int tasks_count)
throws GridException
requestSupplying in interface AbstractExternalPeerHandleconsumer_id - The ID of the Peer that askstasks_count - The number of tasks consumers wished the Peer to
handle
GridException
public void grantConsumption(java.lang.String supplier_id,
int granted_count)
throws GridException
grantConsumption in interface AbstractExternalPeerHandlesupplier_id - The ID of the Peer that providesgranted_count - The number of tasks the provider agreed to run
GridException
public ConsumptionTaskID computeSupplyingTask(java.lang.String consumer_id,
Task t)
throws GridException
computeSupplyingTask in interface AbstractExternalPeerHandleconsumer_id - The task ownert - The task to run
GridException
public void preemptSupplyingTaskOnLocalResource(java.lang.String consumer_id,
Task t,
byte[] logs)
throws GridException
preemptSupplyingTaskOnLocalResource in interface AbstractInternalPeerHandleGridException
public void cancelSupplyingTaskOnLocalResource(java.lang.String consumer_id,
Task t)
throws GridException
cancelSupplyingTaskOnLocalResource in interface AbstractExternalPeerHandleGridException
public void cancelLocalTaskOnSupplyingResource(java.lang.String supplier_id,
Task t)
throws GridException
cancelLocalTaskOnSupplyingResource in interface AbstractExternalPeerHandleGridException
public void uploadBySupplyingCompletedTask(java.lang.String supplier_id,
Task t)
throws GridException
uploadBySupplyingCompletedTask in interface AbstractExternalPeerHandleGridExceptionpublic int resourcePort()
resourcePort in interface AbstractInternalPeerHandle
public void addResource(ResourceHandle rh,
int power)
throws GridException
addResource in interface AbstractInternalPeerHandlerh - A handle to the concerned resource
GridException
public void removeResource(ResourceHandle rh)
throws GridException
removeResource in interface AbstractInternalPeerHandlerh - A handle to the concerned resource
GridException
public void preemptLocalTaskOnLocalResource(Task t,
byte[] logs)
throws GridException
preemptLocalTaskOnLocalResource in interface AbstractInternalPeerHandlet - The task to cancel
GridException
public void uploadLocallyCompletedTask(Task t)
throws GridException
uploadLocallyCompletedTask in interface AbstractInternalPeerHandlet - The completed task
GridExceptionpublic int userPort()
userPort in interface AbstractUserPeerHandle
public int submitJob(UserHandle uh,
JobDescriptor jd)
throws GridException
submitJob in interface AbstractUserPeerHandleuh - A handle to contact the userjd - A description of the job to submit
GridException - if the submitting fails
public void cancelJob(int job_id)
throws GridException
cancelJob in interface AbstractUserPeerHandlejob_id - job id
GridException - if the cancellation fails
public int queryJobStatus(int job_id)
throws GridException
queryJobStatus in interface AbstractUserPeerHandlejob_id - job id
GridException - if the status querypublic boolean isAlive()
isAlive in interface AbstractExternalPeerHandle
|
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.