class Config
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
Config.ExecInfo |
| Modifier and Type | Field and Description |
|---|---|
private static java.util.SortedSet<java.lang.String> |
allJobs
All jobs mentioned in the job list file.
|
private static int |
betweenInvokes
Sleep time, in milliseconds, between the two new process/thread invokes.
|
(package private) static java.lang.String |
cfgDir
The configuration directory.
|
private static java.io.File |
cfgRoot
Configuration directory.
|
private static java.io.File |
dumpFile
The File of the dump file.
|
private static java.lang.String |
dumpFileName
The file flags the important parameters and stage variables should be
dumped.
|
private static boolean |
enableDebug
Specify if we want to dump debug details into the master log file.
|
private static java.util.Map<java.lang.String,Config.ExecInfo> |
exeSpec |
private static java.util.ArrayList<java.lang.String> |
ignoredErrors
This is the vector of error strings that should be ignored.
|
private static java.lang.String |
ignoreFileName
The file lists error string from executable child jobs that should be
ignored.
|
private static java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> |
jobInfo
Job information.
|
private static java.lang.String |
jobListFileName
The configuration file listing specifying all jobs.
|
private static java.lang.String |
jobRankFileName
The configuration file specifying the ranks of jobs.
|
private static java.util.SortedSet<java.lang.String> |
jobsToRun
This lists all jobs to be run (under the top job).
|
private static java.util.HashMap<java.lang.String,java.lang.String> |
jobTypes
Job type look up hash table.
|
private static java.io.File |
killFile
The File of the kill file.
|
private static java.lang.String |
killFileName
The file flags the jobman program should stop running.
|
private static java.nio.channels.FileChannel |
lockChan
The file handle to the lock file.
|
private static java.lang.String |
lockFilePath
The path (absolute or relative to the jobman root directory) to the lock
file.
|
private static int |
numParallel
The maximum number of exec jobs running, i.e., the maximum number of
parallel running processes invoked by jobman.
|
private static java.lang.String |
optDynamicFileName
The optional configuration file specifying parameters that can be re-read
when jobman is running.
|
private static java.lang.String |
optStaticFileName
The optional configuration file specifying parameters that will not be read
after jobman starts.
|
private static java.io.File |
pauseFile
The File to the pause file.
|
private static java.lang.String |
pauseFileName
The file flags that the jobman running should pause.
|
private static java.nio.channels.FileLock |
projLock
The file lock for this jobman program run.
|
private static int |
queueLen
The max queue length for each job to be placed before execution.
|
private static java.io.File |
refreshFile
The File of the refresh file.
|
private static java.lang.String |
refreshFileName
The file flags that the dynamic parameters should be re-read.
|
(package private) static java.util.TreeSet<java.lang.String> |
reserved
Reserved keywords not to be used as a task name.
|
private static boolean |
resumeLast
Indicates if the program should start from what was left in the previous
run.
|
private static java.lang.String |
root
The absolute path to the home directory of jobman.
|
private static int |
sleepTime
Sleep time, in milliseconds, between two cycles of job status updates.
|
private static java.util.Map<java.lang.String,java.lang.Object[]> |
statMap
Map from each job name to a pair of its specific success string and Boolean
if error should be checked.
|
private static java.lang.String |
successString
The default string indicating that a terminal job has finished
successfully.
|
private static java.lang.String |
timeFormat
The date time format used in log file.
|
private static java.lang.String |
topJobName
The name of the top most job.
|
private static java.lang.String |
toStopString
The string indicating that the job requests all its sibling jobs should be
skipped.
|
| Modifier | Constructor and Description |
|---|---|
private |
Config()
All members are static.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) static java.lang.String |
debugDump()
Dump all configuration parameters used in the jobman program.
|
private static void |
dynamicConfig()
reload all the key-value settings that are dynamically configurable.
|
private static java.lang.String |
errInCfg(java.lang.String fileName,
java.lang.String l)
Formate error message.
|
(package private) static int |
getBetweenInvokes()
Get the sleep time, in milliseconds, between two invocations of new
processes or threads.
|
private static java.util.ArrayList<java.lang.String> |
getDescendants(java.lang.String jobName)
Get all descendants of a job.
|
(package private) static boolean |
getEnableDebug() |
(package private) static boolean |
getExeCatchStdErr(java.lang.String job) |
(package private) static boolean |
getExeCatchStdOut(java.lang.String job) |
(package private) static boolean |
getExecCheckErr(java.lang.String job) |
(package private) static boolean |
getExecCheckLog(java.lang.String job) |
(package private) static int |
getExecParallels(java.lang.String job) |
(package private) static int |
getExecRank(java.lang.String job) |
(package private) static java.lang.String |
getExecSuccess(java.lang.String job) |
(package private) static java.util.ArrayList<java.lang.String> |
getIgnoredErrors()
Get list of error messages that should be ignored.
|
(package private) static java.util.ArrayList<java.lang.String> |
getJobInfo(java.lang.String name)
Get information on a job.
|
(package private) static java.lang.String |
getJobType(java.lang.String name)
Get the type of a given job.
|
(package private) static int |
getNumParallel()
Get the max number of processes to be run in parallel.
|
(package private) static int |
getQueueLen()
Get the max number of jobs to be placed in the queue.
|
(package private) static boolean |
getResumeLast()
Get if jobman should start from where last run ended.
|
(package private) static java.lang.String |
getRoot()
Get jobman home directory.
|
(package private) static java.lang.String |
getSuccessString(java.lang.String taskName)
Get the string indicating a job has been completed successfully.
|
(package private) static java.lang.String |
getTimeFormat()
Get the date time format used in the master log file.
|
(package private) static java.lang.String |
getToStopString()
Get the string indicating a job has been completed successfully and request
skip all its sibling jobs.
|
(package private) static void |
init(java.lang.String rootPath,
java.lang.String topName)
Initialize the configuration system.
|
private static boolean |
isParent(java.lang.String jobName)
Check if a job is a parent or terminal job.
|
private static void |
oneLineFromJobList(java.lang.String l)
Process one line in the job list file.
|
private static java.util.Properties |
readConfigFile(java.lang.String fileName)
Read files consisting of lines of key-value pairs.
|
private static void |
readIgnored()
Read error messages that should be ignored.
|
private static java.util.ArrayList<java.lang.String> |
readJobFile(java.lang.String fileName)
Read a configuration file and insert the lines (excluding comments) into
the passed in vector.
|
private static void |
readJobList()
Read the job list file.
|
private static void |
readLeafList()
Read the job rank file and stored the job ranking into Schedule class
variables.
|
(package private) static void |
refresh()
Process the configuration files.
|
(package private) static void |
release()
Release the lock file held by the jobman program.
|
private static void |
reloadSettings()
Reload all dynamically configurable settings.
|
private static void |
staticConfig()
Load the static configurations from the file.
|
private static java.util.ArrayList<java.lang.String> |
substitute(java.util.ArrayList<java.lang.String> lines,
java.util.Map<java.lang.String,java.lang.String> variables) |
private static void |
validate()
Validate the job configurations.
|
static final java.util.TreeSet<java.lang.String> reserved
static final java.lang.String cfgDir
private static final java.lang.String jobListFileName
private static final java.lang.String jobRankFileName
private static final java.lang.String optDynamicFileName
private static final java.lang.String optStaticFileName
private static final java.lang.String pauseFileName
private static final java.lang.String refreshFileName
private static final java.lang.String killFileName
private static final java.lang.String dumpFileName
private static final java.lang.String ignoreFileName
private static java.lang.String root
private static java.io.File cfgRoot
configprivate static java.io.File pauseFile
pauseprivate static java.io.File refreshFile
refreshprivate static java.io.File killFile
killprivate static java.io.File dumpFile
dumpprivate static java.nio.channels.FileChannel lockChan
lopaprivate static java.nio.channels.FileLock projLock
chanprivate static java.lang.String successString
private static final java.util.Map<java.lang.String,java.lang.Object[]> statMap
private static java.lang.String toStopString
private static java.lang.String timeFormat
private static final java.util.ArrayList<java.lang.String> ignoredErrors
ignoreprivate static java.lang.String lockFilePath
private static boolean resumeLast
private static int numParallel
private static int sleepTime
private static int betweenInvokes
private static boolean enableDebug
private static int queueLen
private static final java.util.HashMap<java.lang.String,java.lang.String> jobTypes
private static final java.util.SortedSet<java.lang.String> allJobs
private static final java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> jobInfo
private static java.lang.String topJobName
private static final java.util.SortedSet<java.lang.String> jobsToRun
private static final java.util.Map<java.lang.String,Config.ExecInfo> exeSpec
private Config()
static void init(java.lang.String rootPath,
java.lang.String topName)
throws java.lang.Exception
rootPath - The home directory of the program.topName - The top most job to be run.java.lang.Exceptionprivate static void reloadSettings()
throws java.lang.Exception
java.lang.Exceptionstatic void release()
static void refresh()
throws java.lang.Exception
java.lang.Exceptionprivate static java.util.Properties readConfigFile(java.lang.String fileName)
throws java.lang.Exception
fileName - The name of the file in the "cfg" directory.java.lang.Exceptionprivate static void staticConfig()
throws java.lang.Exception
java.lang.Exceptionprivate static void dynamicConfig()
throws java.lang.Exception
java.lang.Exceptionstatic java.lang.String getSuccessString(java.lang.String taskName)
static java.lang.String getToStopString()
static java.lang.String getTimeFormat()
static int getNumParallel()
static int getQueueLen()
static int getBetweenInvokes()
static java.util.ArrayList<java.lang.String> getIgnoredErrors()
static boolean getEnableDebug()
static boolean getResumeLast()
private static void readIgnored()
throws java.lang.Exception
java.lang.Exceptionprivate static java.util.ArrayList<java.lang.String> readJobFile(java.lang.String fileName)
throws java.lang.Exception
fileName - The name of the configuration file.java.lang.Exceptionprivate static java.util.ArrayList<java.lang.String> substitute(java.util.ArrayList<java.lang.String> lines,
java.util.Map<java.lang.String,java.lang.String> variables)
private static void readLeafList()
throws java.lang.Exception
# job rank parallels check_log check_error success job_a 10 2 true true Job completed job_b -5 5 true false This is done job_c 2 0 false true default job_d 4Each line is an executable job specific setting. Higher rank has higher priority. A negative parallels mean no limit on parallel processes to run. The zero parallels means following the default parallel setting. If check_log is true, then log file will not be generated.
java.lang.Exceptionstatic int getExecRank(java.lang.String job)
static int getExecParallels(java.lang.String job)
static boolean getExecCheckLog(java.lang.String job)
static boolean getExecCheckErr(java.lang.String job)
static boolean getExeCatchStdOut(java.lang.String job)
static boolean getExeCatchStdErr(java.lang.String job)
static java.lang.String getExecSuccess(java.lang.String job)
private static void readJobList()
throws java.lang.Exception
java.lang.Exceptionprivate static void oneLineFromJobList(java.lang.String l)
throws java.lang.Exception
java.lang.Exceptionprivate static java.lang.String errInCfg(java.lang.String fileName,
java.lang.String l)
fileName - The source file name.l - The error line.static java.lang.String getJobType(java.lang.String name)
name - The name of the job.static java.util.ArrayList<java.lang.String> getJobInfo(java.lang.String name)
name - The name of a job.static java.lang.String getRoot()
static java.lang.String debugDump()
private static java.util.ArrayList<java.lang.String> getDescendants(java.lang.String jobName)
jobName - The name of a job.private static boolean isParent(java.lang.String jobName)
jobName - The name of a job.private static void validate()
Copyright © 2006-2015 Heng Sun.