public class JobDatabase extends Object
Modifier and Type | Field and Description |
---|---|
protected jdbm.PrimaryHashMap<String,AwaitedJob> |
awaitedJobs
A map of jobs that have been launched and which results are awaited each
time a new job is sent to the scheduler for computation, it will be added
to this map, as an entry of (JobId, AwaitedJob), where JobId is given as
a string.
|
protected static String |
DEFAULT_STATUS_FILENAME
Default name of the file used to persist the list of jobs
|
protected jdbm.RecordManager |
recMan
Object handling the AwaitedJobsFile connection
|
protected static String |
sessionName |
static String |
STATUS_RECORD_NAME
Name of the jobs backup table being recorded
|
static File |
statusFile
File which persists the list of
AwaitedJob |
protected static String |
TMPDIR |
Constructor and Description |
---|
JobDatabase() |
Modifier and Type | Method and Description |
---|---|
void |
cleanDataBase() |
void |
close() |
void |
commit() |
void |
discardAllJobs()
This call "reset" the current proxy by removing all knowledge of awaited jobs
|
void |
discardJob(String jobID)
Removes the given job of the awaited job list (should rarely be used)
|
AwaitedJob |
getAwaitedJob(String id) |
Set<String> |
getAwaitedJobsIds() |
void |
loadJobs()
load the awaited jobs from the status file
if a InvalidClassException occur, we clean the database
|
void |
putAwaitedJob(String id,
AwaitedJob awaitedJob) |
AwaitedJob |
removeAwaitedJob(String id) |
void |
setSessionName(String name)
Sets the name of this recording session.
|
void |
setTaskTransferring(String id,
String taskName,
boolean transferring)
Sets the given task to transferring status.
|
protected static final String TMPDIR
protected static final String DEFAULT_STATUS_FILENAME
protected static String sessionName
public static File statusFile
AwaitedJob
public static final String STATUS_RECORD_NAME
protected jdbm.RecordManager recMan
protected jdbm.PrimaryHashMap<String,AwaitedJob> awaitedJobs
public void cleanDataBase()
public void commit() throws IOException
IOException
public void discardAllJobs()
public void discardJob(String jobID)
public AwaitedJob getAwaitedJob(String id)
public void loadJobs()
public void putAwaitedJob(String id, AwaitedJob awaitedJob)
public AwaitedJob removeAwaitedJob(String id)
public void setSessionName(String name)
name
- alphanumerical wordpublic void setTaskTransferring(String id, String taskName, boolean transferring)
id
- jobIDtaskName
- task nametransferring
- public void close()