public interface IRmPersistence
| Modifier and Type | Interface and Description |
|---|---|
static class |
IRmPersistence.RmLoad
This table lists jobs in the system.
|
static class |
IRmPersistence.RmNodes |
static class |
IRmPersistence.RmShares |
| Modifier and Type | Method and Description |
|---|---|
void |
addAssignment(String id,
DuccId jobid,
IDbShare share,
int quantum,
String jobtype)
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 share)
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... properties)
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.
|
void init(DuccLogger logger) throws Exception
logger - 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.Exceptionvoid clear()
throws Exception
Exceptionvoid setNodeProperties(String id, Object... properties) throws Exception
id - This is the primary key, the machine name;properties - These are the props, must be presented in the form of (String, Object) ...Exceptionvoid setNodeProperty(String id, IRmPersistence.RmNodes key, Object value) throws Exception
id - 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.Exception. - Anything that goes wrong throws. Usually the
throw will originate in the DB because of some DB issue. An
exception causes the action to be rolled back.Exceptionvoid createMachine(String id, Map<IRmPersistence.RmNodes,Object> props) throws Exception
id - This is the primary key and is usually the name of a host.props - This is the full set of properties to be set.Exception. - Anything that goes wrong throws. Usually the
throw will originate in the DB because of some DB issue. An
exception causes the action to be rolled back.Exceptionvoid addAssignment(String id, DuccId jobid, IDbShare share, int quantum, String jobtype) throws Exception
id - The node namejobid - The duccid of the job owning the new shoareshareid - The DuccId of the new share.quantum - The scheduling quantum in GB used for this share.Exceptionvoid removeAssignment(String id, DuccId jobid, IDbShare share) throws Exception
id - The node namejobid - The duccid of the job owning the new shoareshareid - The DuccId of the new share.Exceptionvoid setFixed(String node, DuccId shareId, DuccId jobId, boolean val) throws Exception
node - 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 DBExceptionvoid setPurged(String node, DuccId shareId, DuccId jobId, boolean val) throws Exception
node - 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 DBExceptionvoid setEvicted(String node, DuccId shareId, DuccId jobId, boolean val) throws Exception
node - 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 DBExceptionvoid updateShare(String node, DuccId shareid, DuccId jobid, long investment, String state, long init_time, long pid) throws Exception
node - The node where the share resides.shareId - The (RM-assigned) DuccId of the share.jobId - The OR-assigned DuccId of the job.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 DBExceptionProperties getMachine(String id) throws Exception
id - This is the name of a specific machine and must exactly
match the name of a machine in the DB.Exception. - Anything that goes wrong throws. Usually the
throw will originate in the DB because of some DB issue.ExceptionMap<String,Map<String,Object>> getAllMachines() throws Exception
Exception. - Anything that goes wrong throws. Usually the
throw will originate in the DB because of some DB issue.ExceptionMap<String,Map<String,Object>> getAllShares() throws Exception
Exception. - Anything that goes wrong throws. Usually the
throw will originate in the DB because of some DB issue.ExceptionList<Map<String,Object>> getLoad() throws Exception
Exception. - Anything that goes wrong throws. Usually the
throw will originate in the DB because of some DB issue.Exceptionvoid addJob(IDbJob j) throws Exception
Exceptionvoid deleteJob(IDbJob j) throws Exception
Exceptionvoid updateDemand(IDbJob j) throws Exception
Exceptionvoid close()
Copyright © 2012–2017 The Apache Software Foundation. All rights reserved.