lbg.peer.service
Class LivePeerService
java.lang.Object
lbg.peer.service.LivePeerService
- All Implemented Interfaces:
- AbstractExternalPeerHandle, AbstractInternalPeerHandle, AbstractUserPeerHandle, PeerService
public class LivePeerService
- extends java.lang.Object
- implements PeerService
PeerService, Live implementation.
Most of the code is a direct adaptation of SimulatedPeerService
- Author:
- Cyril Briquet, Xavier Dalem
Method Summary |
void |
addResource(ResourceHandle rh,
int power)
|
void |
cancelJob(int job_id)
|
void |
cancelLocalTaskOnSupplyingResource(java.lang.String supplier_id,
Task t)
|
void |
cancelSupplyingTaskOnLocalResource(java.lang.String consumer_id,
Task t)
|
ConsumptionTaskID |
computeSupplyingTask(java.lang.String consumer_id,
Task t)
|
PeerHandle |
createHandle()
Creates a LivePeerHandle |
void |
grantConsumption(java.lang.String supplier_id,
int granted_count)
|
java.lang.String |
hostname()
|
java.lang.String |
id()
|
boolean |
isAlive()
|
int |
peerPort()
|
void |
preemptLocalTaskOnLocalResource(Task t,
byte[] logs)
|
void |
preemptSupplyingTaskOnLocalResource(java.lang.String consumer_id,
Task t,
byte[] logs)
|
int |
queryJobStatus(int job_id)
|
void |
removeResource(ResourceHandle rh)
|
void |
requestSupplying(java.lang.String consumer_id,
int tasks_count)
|
int |
resourcePort()
|
int |
submitJob(UserHandle uh,
JobDescriptor jd)
|
java.lang.String |
toString()
|
void |
uploadBySupplyingCompletedTask(java.lang.String supplier_id,
Task t)
|
void |
uploadLocallyCompletedTask(Task t)
|
int |
userPort()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
LivePeerService
protected LivePeerService(Peer owner_peer)
throws GridException
- Throws:
GridException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
createHandle
public PeerHandle createHandle()
throws GridException
- Creates a LivePeerHandle
- Specified by:
createHandle
in interface PeerService
- Throws:
GridException
id
public java.lang.String id()
hostname
public java.lang.String hostname()
peerPort
public int peerPort()
- Specified by:
peerPort
in interface AbstractExternalPeerHandle
requestSupplying
public void requestSupplying(java.lang.String consumer_id,
int tasks_count)
throws GridException
- Specified by:
requestSupplying
in interface AbstractExternalPeerHandle
- Throws:
GridException
grantConsumption
public void grantConsumption(java.lang.String supplier_id,
int granted_count)
throws GridException
- Specified by:
grantConsumption
in interface AbstractExternalPeerHandle
- Throws:
GridException
computeSupplyingTask
public ConsumptionTaskID computeSupplyingTask(java.lang.String consumer_id,
Task t)
throws GridException
- Specified by:
computeSupplyingTask
in interface AbstractExternalPeerHandle
- Throws:
GridException
cancelSupplyingTaskOnLocalResource
public void cancelSupplyingTaskOnLocalResource(java.lang.String consumer_id,
Task t)
throws GridException
- Specified by:
cancelSupplyingTaskOnLocalResource
in interface AbstractExternalPeerHandle
- Throws:
GridException
preemptSupplyingTaskOnLocalResource
public void preemptSupplyingTaskOnLocalResource(java.lang.String consumer_id,
Task t,
byte[] logs)
throws GridException
- Specified by:
preemptSupplyingTaskOnLocalResource
in interface AbstractInternalPeerHandle
- Throws:
GridException
cancelLocalTaskOnSupplyingResource
public void cancelLocalTaskOnSupplyingResource(java.lang.String supplier_id,
Task t)
throws GridException
- Specified by:
cancelLocalTaskOnSupplyingResource
in interface AbstractExternalPeerHandle
- Throws:
GridException
uploadBySupplyingCompletedTask
public void uploadBySupplyingCompletedTask(java.lang.String supplier_id,
Task t)
throws GridException
- Specified by:
uploadBySupplyingCompletedTask
in interface AbstractExternalPeerHandle
- Throws:
GridException
isAlive
public boolean isAlive()
- Specified by:
isAlive
in interface AbstractExternalPeerHandle
resourcePort
public int resourcePort()
- Specified by:
resourcePort
in interface AbstractInternalPeerHandle
addResource
public void addResource(ResourceHandle rh,
int power)
throws GridException
- Specified by:
addResource
in interface AbstractInternalPeerHandle
- Throws:
GridException
removeResource
public void removeResource(ResourceHandle rh)
throws GridException
- Specified by:
removeResource
in interface AbstractInternalPeerHandle
- Throws:
GridException
preemptLocalTaskOnLocalResource
public void preemptLocalTaskOnLocalResource(Task t,
byte[] logs)
throws GridException
- Specified by:
preemptLocalTaskOnLocalResource
in interface AbstractInternalPeerHandle
- Throws:
GridException
uploadLocallyCompletedTask
public void uploadLocallyCompletedTask(Task t)
throws GridException
- Specified by:
uploadLocallyCompletedTask
in interface AbstractInternalPeerHandle
- Throws:
GridException
userPort
public int userPort()
- Specified by:
userPort
in interface AbstractUserPeerHandle
submitJob
public int submitJob(UserHandle uh,
JobDescriptor jd)
throws GridException
- Specified by:
submitJob
in interface AbstractUserPeerHandle
- Throws:
GridException
cancelJob
public void cancelJob(int job_id)
throws GridException
- Specified by:
cancelJob
in interface AbstractUserPeerHandle
- Throws:
GridException
queryJobStatus
public int queryJobStatus(int job_id)
throws GridException
- Specified by:
queryJobStatus
in interface AbstractUserPeerHandle
- Throws:
GridException
Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.