public abstract class SchedulerConnection
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private ScriptingAdaptor |
adaptor |
protected XenonEngine |
engine |
private java.lang.String |
id |
private static org.slf4j.Logger |
LOGGER |
private long |
pollDelay |
private XenonProperties |
properties |
private static int |
schedulerID |
private FileSystem |
subFileSystem |
private Scheduler |
subScheduler |
Modifier | Constructor and Description |
---|---|
protected |
SchedulerConnection(ScriptingAdaptor adaptor,
java.lang.String scheme,
java.lang.String location,
Credential credential,
XenonProperties properties,
XenonEngine engine,
long pollDelay) |
Modifier and Type | Method and Description |
---|---|
abstract JobStatus |
cancelJob(Job job) |
protected void |
checkQueueNames(java.lang.String[] givenQueueNames)
Checks if the queue names given are valid, and throw an exception otherwise.
|
protected void |
checkWorkingDirectory(java.lang.String workingDirectory)
check if the given working directory exists.
|
void |
close() |
abstract java.lang.String |
getDefaultQueueName() |
protected Path |
getFsEntryPath() |
java.lang.String |
getID() |
abstract Job[] |
getJobs(java.lang.String... queueNames) |
abstract JobStatus |
getJobStatus(Job job) |
abstract JobStatus[] |
getJobStatuses(Job... jobs) |
protected static int |
getNextSchedulerID() |
XenonProperties |
getProperties() |
abstract java.lang.String[] |
getQueueNames() |
abstract QueueStatus |
getQueueStatus(java.lang.String queueName) |
abstract QueueStatus[] |
getQueueStatuses(java.lang.String... queueNames) |
abstract Scheduler |
getScheduler()
As the SchedulerImplementation contains the list of queues, the subclass is responsible of implementing this function
|
abstract Streams |
getStreams(Job job) |
protected static java.lang.String |
identifiersAsCSList(Job[] jobs) |
java.lang.String |
runCheckedCommand(java.lang.String stdin,
java.lang.String executable,
java.lang.String... arguments)
Run a command.
|
RemoteCommandRunner |
runCommand(java.lang.String stdin,
java.lang.String executable,
java.lang.String... arguments)
Run a command on the remote scheduler machine.
|
Job |
startInteractiveCommand(java.lang.String executable,
java.lang.String... arguments)
Start an interactive command on the remote machine (usually via ssh).
|
abstract Job |
submitJob(JobDescription description) |
protected static boolean |
supportsScheme(java.lang.String scheme,
java.lang.String[] supportedSchemes) |
protected static void |
verifyJobDescription(JobDescription description,
java.lang.String adaptorName)
Do some checks on a job description.
|
protected static void |
verifyJobInfo(java.util.Map<java.lang.String,java.lang.String> jobInfo,
Job job,
java.lang.String adaptorName,
java.lang.String jobIDField,
java.lang.String... additionalFields)
Check if the info map for a job exists, contains the expected job ID, and contains the given additional fields
|
protected static void |
verifyJobOptions(java.util.Map<java.lang.String,java.lang.String> options,
java.lang.String[] validOptions,
java.lang.String adaptorName) |
JobStatus |
waitUntilDone(Job job,
long timeout) |
JobStatus |
waitUntilRunning(Job job,
long timeout) |
private static final org.slf4j.Logger LOGGER
private static int schedulerID
private final ScriptingAdaptor adaptor
private final java.lang.String id
protected final XenonEngine engine
private final Scheduler subScheduler
private final FileSystem subFileSystem
private final XenonProperties properties
private final long pollDelay
protected SchedulerConnection(ScriptingAdaptor adaptor, java.lang.String scheme, java.lang.String location, Credential credential, XenonProperties properties, XenonEngine engine, long pollDelay) throws XenonException
XenonException
protected static int getNextSchedulerID()
protected static boolean supportsScheme(java.lang.String scheme, java.lang.String[] supportedSchemes)
protected static void verifyJobDescription(JobDescription description, java.lang.String adaptorName) throws XenonException
description
- the job description to checkadaptorName
- the name of the adaptor. Used when an exception is thrownIncompleteJobDescriptionException
- if the description is missing a mandatory value.InvalidJobDescriptionException
- if the description contains illegal values.XenonException
protected static void verifyJobOptions(java.util.Map<java.lang.String,java.lang.String> options, java.lang.String[] validOptions, java.lang.String adaptorName) throws InvalidJobDescriptionException
InvalidJobDescriptionException
protected static void verifyJobInfo(java.util.Map<java.lang.String,java.lang.String> jobInfo, Job job, java.lang.String adaptorName, java.lang.String jobIDField, java.lang.String... additionalFields) throws XenonException
jobInfo
- the map the job info should be .job
- the job to check the presence for.adaptorName
- name of the current adaptor for error reporting.jobIDField
- the field which contains the job id.additionalFields
- any additional fields to check the presence of.XenonException
- if any fields are missing or incorrectprotected static java.lang.String identifiersAsCSList(Job[] jobs)
protected Path getFsEntryPath()
public XenonProperties getProperties()
public java.lang.String getID()
public RemoteCommandRunner runCommand(java.lang.String stdin, java.lang.String executable, java.lang.String... arguments) throws XenonException
XenonException
public java.lang.String runCheckedCommand(java.lang.String stdin, java.lang.String executable, java.lang.String... arguments) throws XenonException
XenonException
public Job startInteractiveCommand(java.lang.String executable, java.lang.String... arguments) throws XenonException
XenonException
protected void checkQueueNames(java.lang.String[] givenQueueNames) throws NoSuchQueueException
NoSuchQueueException
public JobStatus waitUntilDone(Job job, long timeout) throws XenonException
XenonException
public JobStatus waitUntilRunning(Job job, long timeout) throws XenonException
XenonException
protected void checkWorkingDirectory(java.lang.String workingDirectory) throws XenonException
workingDirectory
- the working directory (either absolute or relative) as given by the user.XenonException
public void close() throws XenonException
XenonException
public abstract Scheduler getScheduler()
public abstract java.lang.String[] getQueueNames()
public abstract java.lang.String getDefaultQueueName()
public abstract QueueStatus getQueueStatus(java.lang.String queueName) throws XenonException
XenonException
public abstract QueueStatus[] getQueueStatuses(java.lang.String... queueNames) throws XenonException
XenonException
public abstract Job[] getJobs(java.lang.String... queueNames) throws XenonException
XenonException
public abstract Job submitJob(JobDescription description) throws XenonException
XenonException
public abstract JobStatus cancelJob(Job job) throws XenonException
XenonException
public abstract JobStatus getJobStatus(Job job) throws XenonException
XenonException
public abstract JobStatus[] getJobStatuses(Job... jobs) throws XenonException
XenonException
public abstract Streams getStreams(Job job) throws XenonException
XenonException