public class NullRmStatePersistence extends Object implements IRmPersistence
IRmPersistence.RmLoad, IRmPersistence.RmNodes, IRmPersistence.RmShares| Modifier and Type | Method and Description |
|---|---|
void |
addAssignment(String id,
DuccId jobid,
IDbShare shareid,
int quantum,
String type)
Assign a share to this machine.
|
void |
addJob(IDbJob j)
A new job arrives (or is recovered after restart).
|
void |
clear()
When RM performs its configuration it must call this to clear the db of existing
nodes.
|
void |
close()
Shutdown the connection to the DB;
|
void |
createMachine(String id,
Map<IRmPersistence.RmNodes,Object> props)
Write full information about a mach9ne into the DB.
|
void |
deleteJob(IDbJob j)
A job has left the system forever.
|
Map<String,Map<String,Object>> |
getAllMachines()
Fetch all machines in the database.
|
Map<String,Map<String,Object>> |
getAllShares()
Fetch all shares in the database.
|
List<Map<String,Object>> |
getLoad()
Fetch all the load records.
|
Properties |
getMachine(String id)
Fetch a machine by its id.
|
void |
init(DuccLogger logger)
Establish a logger and anything else the persistence may need.
|
void |
removeAssignment(String id,
DuccId jobid,
IDbShare shareid)
Remove a share from the machine.
|
void |
setEvicted(String node,
DuccId shareId,
DuccId jobId,
boolean val)
Update a share definition to show it is evicted aka preempted by RM.
|
void |
setFixed(String node,
DuccId shareId,
DuccId jobId,
boolean val)
Update a share definition to show it is non-preemptable.
|
void |
setNodeProperties(String id,
Object... props)
Set multiple properties in one swell foop.
|
void |
setNodeProperty(String id,
IRmPersistence.RmNodes key,
Object value)
Set a property on an object.
|
void |
setPurged(String node,
DuccId shareId,
DuccId jobId,
boolean val)
Update a share definition to show it is non-preemptable.
|
void |
updateDemand(IDbJob j)
How many shares to I want from the scheduler?
|
void |
updateShare(String node,
DuccId shareid,
DuccId jobid,
long investment,
String state,
long init_time,
long pid)
Update current information about the share from the current OR publication.
|
public void init(DuccLogger logger) throws Exception
IRmPersistenceinit in interface IRmPersistencelogger - This is the logger to be used. It is usually
the same logger as the client of persistence, e.g.
org.apache.uima.ducc.rm. The implementor is required
to adjust itself to use this logger to insure
messages are logged into the right log.Exceptionpublic void clear()
IRmPersistenceclear in interface IRmPersistencepublic void close()
IRmPersistenceclose in interface IRmPersistencepublic void setNodeProperty(String id, IRmPersistence.RmNodes key, Object value)
IRmPersistencesetNodeProperty in interface IRmPersistenceid - This is the primary key and is usually the name of a host.key - This is the property key.value - This is the value to set.public void setNodeProperties(String id, Object... props)
IRmPersistencesetNodeProperties in interface IRmPersistenceid - This is the primary key, the machine name;props - These are the props, must be presented in the form of (String, Object) ...public void createMachine(String id, Map<IRmPersistence.RmNodes,Object> props)
IRmPersistencecreateMachine in interface IRmPersistenceid - This is the primary key and is usually the name of a host.props - This is the full set of properties to be set.public void addAssignment(String id, DuccId jobid, IDbShare shareid, int quantum, String type)
IRmPersistenceaddAssignment in interface IRmPersistenceid - The node namejobid - The duccid of the job owning the new shoarequantum - The scheduling quantum in GB used for this share.public void removeAssignment(String id, DuccId jobid, IDbShare shareid)
IRmPersistenceremoveAssignment in interface IRmPersistenceid - The node namejobid - The duccid of the job owning the new shoarepublic void setEvicted(String node, DuccId shareId, DuccId jobId, boolean val)
IRmPersistencesetEvicted in interface IRmPersistencenode - The node where the share resides.shareId - The (RM-assigned) DuccId of the share.jobId - The OR-assigned DuccId of the job.val - True if it is evicted. Once evicted it can not be un-evicted so RM never sets this false.
NOTE: The triple (node, shareid, jobid) form the primary key to find the share in the DBpublic void setFixed(String node, DuccId shareId, DuccId jobId, boolean val)
IRmPersistencesetFixed in interface IRmPersistencenode - The node where the share resides.shareId - The (RM-assigned) DuccId of the share.jobId - The OR-assigned DuccId of the job.val - True if it is non-preemptable, false otherwise.
NOTE: The triple (node, shareid, jobid) form the primary key to find the share in the DBpublic void setPurged(String node, DuccId shareId, DuccId jobId, boolean val)
IRmPersistencesetPurged in interface IRmPersistencenode - The node where the share resides.shareId - The (RM-assigned) DuccId of the share.jobId - The OR-assigned DuccId of the job.val - True if it is non-preemptable. RM will never set this false.
NOTE: The triple (node, shareid, jobid) form the primary key to find the share in the DBpublic void updateShare(String node, DuccId shareid, DuccId jobid, long investment, String state, long init_time, long pid)
IRmPersistenceupdateShare in interface IRmPersistencenode - The node where the share resides.investment - The "investment", i.e. amount of CPU expended by the process in the share so far.state - The OR-assigned state of the process in the share.init_time - The time the process spent in its initialization phase.pid - The *ix process id of the process in the share.
NOTE: The triple (node, shareid, jobid) form the primary key to find the share in the DBpublic Properties getMachine(String id)
IRmPersistencegetMachine in interface IRmPersistenceid - This is the name of a specific machine and must exactly
match the name of a machine in the DB.public Map<String,Map<String,Object>> getAllMachines()
IRmPersistencegetAllMachines in interface IRmPersistencepublic Map<String,Map<String,Object>> getAllShares()
IRmPersistencegetAllShares in interface IRmPersistencepublic List<Map<String,Object>> getLoad()
IRmPersistencegetLoad in interface IRmPersistencepublic void addJob(IDbJob j)
IRmPersistenceaddJob in interface IRmPersistencepublic void deleteJob(IDbJob j)
IRmPersistencedeleteJob in interface IRmPersistencepublic void updateDemand(IDbJob j)
IRmPersistenceupdateDemand in interface IRmPersistenceCopyright © 2012–2017 The Apache Software Foundation. All rights reserved.