|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.parabon.client.TaskSpec
public class TaskSpec
TaskSpec encapsulates all information needed to create
a task and define its initial state: its initial parameters,
task-level elements, a list of required elements, and its runnable
class. After defining a complete TaskSpec, it can be
passed to Job.addTask() to define a new task and
obtain a TaskProxy through which the task can be
monitored and controlled.
Job,
TaskProxy| Nested Class Summary | |
|---|---|
static class |
TaskSpec.ExternalPackage
|
static class |
TaskSpec.NetworkTypeConstraint
|
static class |
TaskSpec.SchedulingConstraints
|
| Constructor Summary | |
|---|---|
TaskSpec(Job job,
java.lang.String taskID)
|
|
TaskSpec(Job job,
java.lang.String taskID,
TaskSpec other)
|
|
TaskSpec(TaskSpec other)
|
|
| Method Summary | |
|---|---|
java.net.URI |
addElement(com.parabon.io.DataWrapper contents)
Create a task-level element which can be referred to only in this task. |
java.net.URI |
addElement(java.io.File contents)
Create a task-level element which can be referred to only in this task. |
java.net.URI |
addElement(java.lang.String identifier,
com.parabon.io.DataWrapper contents)
Create a task-level element which can be referred to only in this task. |
java.net.URI |
addElement(java.lang.String identifier,
java.io.File contents)
Create a task-level element which can be referred to only in this task. |
java.net.URI |
addElementBundle(com.parabon.io.DataWrapper contents)
Create a task-level element bundle containing elements which can be referred to only in this task. |
java.net.URI |
addElementBundle(java.io.File contents)
Create a task-level element bundle containing elements which can be referred to only in this task. |
java.net.URI |
addElementBundle(java.lang.String identifier,
com.parabon.io.DataWrapper contents)
Create a task-level element bundle containing elements which can be referred to only in this task. |
java.net.URI |
addElementBundle(java.lang.String identifier,
java.io.File contents)
Create a task-level element bundle containing elements which can be referred to only in this task. |
void |
addRequiredElement(java.net.URI uri)
Specify that the element referenced by this URI is required in the execution of this particular task. |
void |
addRequiredElement(java.net.URI uri,
java.util.Map<java.lang.String,java.lang.String> metadata)
Specify that the element referenced by this URI is required in the execution of this particular task. |
void |
addRequiredElementAsClasspathJar(java.net.URI uri)
Specify that the element referenced by this URI is required in the execution of this particular task. |
void |
addRequiredElementAsClasspathJar(java.net.URI uri,
java.util.Map<java.lang.String,java.lang.String> metadata)
Specify that the element referenced by this URI is required in the execution of this particular task. |
void |
addRequiredElementAsNativeLibrary(java.net.URI uri)
Specify that the element referenced by this URI is required in the execution of this particular task. |
void |
addRequiredElementAsNativeLibrary(java.net.URI uri,
java.util.Map<java.lang.String,java.lang.String> metadata)
Specify that the element referenced by this URI is required in the execution of this particular task. |
void |
addRequiredElementBundle(java.net.URI bundleURI,
com.parabon.io.DataWrapper localBundle,
java.util.Map<java.lang.String,java.lang.String> metadata)
|
void |
addRequiredElementBundle(java.net.URI bundleURI,
com.parabon.frontier.schemas.client.ElementBundle manifest,
java.util.Map<java.lang.String,java.lang.String> metadata)
|
void |
addRequiredElementBundle(java.net.URI bundleURI,
java.io.File localBundle,
java.util.Map<java.lang.String,java.lang.String> metadata)
|
protected com.parabon.io.DataWrapper |
getElement(java.net.URI uri)
|
com.parabon.client.ElementContainer |
getElementContainer()
|
java.util.Set<java.net.URI> |
getElementURIs()
Get a read-only Set containing the URIs of elements
in this task. |
Job |
getJob()
|
com.parabon.io.DataWrapper |
getParams()
Get the parameter data for this task. |
java.util.Map<java.lang.String,java.lang.String> |
getRequiredElementMetadata(java.net.URI uri)
|
java.util.Set<java.net.URI> |
getRequiredElementURIs()
Get a read-only Set containing the URIs of elements
currently marked as required for this task. |
java.lang.String |
getRunnableClass()
Get the task's primary (entry-point) runnable class name. |
java.util.Map<java.lang.String,java.lang.String> |
getRuntimeParams()
|
TaskSpec.SchedulingConstraints |
getSchedulingConstraints()
Retrieve the set of scheduling constraints which specify the required characteristics of a compute node on which this task may be scheduled and executed. |
java.lang.String |
getTaskID()
|
java.net.URI |
getVisualizationURI()
|
protected boolean |
isBundle(java.net.URI uri)
|
void |
removeRequiredElement(java.net.URI uri)
|
void |
removeRuntimeParam(java.lang.String key)
|
protected com.parabon.io.DataWrapper |
resolveElement(java.net.URI uri)
|
protected void |
set(TaskSpec o)
Set the current TaskSpec to be identical to that provided. |
void |
setParams(com.parabon.io.DataWrapper params)
Set task parameters. |
void |
setParams(java.io.File params)
Set task parameters. |
void |
setRequireNativeAccess(boolean requireNativeAccess)
This task requries native code execution access from the engine runtime. |
void |
setRequireNetworkAccess(boolean requireNetworkAccess)
This task requries network access from the engine runtime. |
void |
setRunnableClass(java.lang.Class<? extends Task> c)
Specify the task's primary (entry-point) runnable class. |
void |
setRunnableClass(java.lang.String s)
Specify the task's primary (entry-point) runnable class. |
void |
setRuntimeParam(java.lang.String key,
java.lang.String value)
|
void |
setSchedulingConstraints(TaskSpec.SchedulingConstraints schedulingConstraints)
Replace the current set of scheduling constraints with those provided. |
void |
setVisualizationURI(java.net.URI visualizationURI)
Provide a URI at which a web-based visualization may be found for displaying information about a task on an engine during (or before or after) execution. |
protected void |
validateTaskID(java.lang.String tid)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TaskSpec(Job job,
java.lang.String taskID)
public TaskSpec(Job job,
java.lang.String taskID,
TaskSpec other)
public TaskSpec(TaskSpec other)
| Method Detail |
|---|
public com.parabon.client.ElementContainer getElementContainer()
protected void validateTaskID(java.lang.String tid)
protected void set(TaskSpec o)
TaskSpec to be identical to that provided.
public Job getJob()
public java.lang.String getTaskID()
public java.util.Map<java.lang.String,java.lang.String> getRuntimeParams()
public void setRuntimeParam(java.lang.String key,
java.lang.String value)
public void removeRuntimeParam(java.lang.String key)
public void setRunnableClass(java.lang.Class<? extends Task> c)
com.parabon.runtime.Task interface.
public void setRunnableClass(java.lang.String s)
com.parabon.runtime.Task interface. This should be
the fully-qualified classname as provided by
Class.getName().
Classpublic java.lang.String getRunnableClass()
public void setParams(java.io.File params)
throws java.io.FileNotFoundException,
java.io.IOException
params - a file containing the task's parameter data. The file provided
should not be changed or removed after this method is called until
the task has been either completed (when running in local or
simulator mode) or fully submitted to the server (when running in
remote mode) as determined by the associated
TaskProxy.start() method having returned; removing
it or changing its contents size during this time will result in
undefined behaviour.
java.io.FileNotFoundException
java.io.IOException
public void setParams(com.parabon.io.DataWrapper params)
throws com.parabon.io.DataWrapper.UnlinkedException
params - a DataWrapper containing the task's parameter data.
The referenced data sent should not be changed after this method
is called; doing so will result in undefined behaviour.
com.parabon.io.DataWrapper.UnlinkedExceptionpublic com.parabon.io.DataWrapper getParams()
Note that the returned DataWrapper will remain valid until
this TaskSpec has been destroyed or until the parameters
have been changed; DataWrapper.link() must be used to
guarantee accessability beyond this point.
public java.net.URI addElement(com.parabon.io.DataWrapper contents)
contents - the data to be associated with the new element
public java.net.URI addElement(java.lang.String identifier,
com.parabon.io.DataWrapper contents)
identifier - the globally unique identifier to be associated with the new
element, formed using the provided string. Should be unique within
this task; if a data element with this identifier already exists on the
server, behavior will be undefined.contents - the data to be associated with the new element
public java.net.URI addElement(java.io.File contents)
throws java.io.FileNotFoundException,
java.io.IOException
contents - a file containing the contents to be associated with the new
element, which is guaranteed to not be modified or removed during
the lifetime of the associated RemoteSessionManager
(that is, until destroy() has successfully
completed)
java.io.FileNotFoundException
java.io.IOException
public java.net.URI addElement(java.lang.String identifier,
java.io.File contents)
throws java.io.FileNotFoundException,
java.io.IOException
identifier - the globally unique identifier to be associated with the new
element, formed using the provided string. Should be unique within
this task; if a data element with this identifier already exists on the
server, behavior will be undefined.contents - a file containing the contents to be associated with the new
element, which is guaranteed to not be modified or removed during
the lifetime of the associated RemoteSessionManager
(that is, until destroy() has successfully
completed)
java.io.FileNotFoundException
java.io.IOExceptionpublic java.net.URI addElementBundle(com.parabon.io.DataWrapper contents)
contents - the data to be associated with the new elements. The data must
be in Parabon Element Bundle format, including a valid
bundle manifest.
public java.net.URI addElementBundle(java.lang.String identifier,
com.parabon.io.DataWrapper contents)
identifier - the globally unique identifier to be associated with the new
element, formed using the provided string. Should be unique within
this task; if a data element with this identifier already exists on the
server, behavior will be undefined.contents - the data to be associated with the new elements. The data must
be in Parabon Element Bundle format, including a valid
bundle manifest.
public java.net.URI addElementBundle(java.io.File contents)
throws java.io.FileNotFoundException,
java.io.IOException
contents - a file containing the contents to be associated with the new
elements, which is guaranteed to not be modified or removed during
the lifetime of the associated RemoteSessionManager
(that is, until destroy() has successfully
completed). The data must be in Parabon Element Bundle format,
including a valid bundle manifest.
java.io.FileNotFoundException
java.io.IOException
public java.net.URI addElementBundle(java.lang.String identifier,
java.io.File contents)
throws java.io.FileNotFoundException,
java.io.IOException
identifier - the globally unique identifier to be associated with the new
element, formed using the provided string. Should be unique within
this task; if a data element with this identifier already exists on the
server, behavior will be undefined.contents - a file containing the contents to be associated with the new
elements, which is guaranteed to not be modified or removed during
the lifetime of the associated RemoteSessionManager
(that is, until destroy() has successfully
completed). The data must be in Parabon Element Bundle format,
including a valid bundle manifest.
java.io.FileNotFoundException
java.io.IOException
protected com.parabon.io.DataWrapper getElement(java.net.URI uri)
throws NoSuchElementException
NoSuchElementException
protected com.parabon.io.DataWrapper resolveElement(java.net.URI uri)
throws NoSuchElementException
NoSuchElementException
protected boolean isBundle(java.net.URI uri)
throws NoSuchElementException
NoSuchElementExceptionpublic java.util.Set<java.net.URI> getElementURIs()
Set containing the URIs of elements
in this task.
public void addRequiredElement(java.net.URI uri,
java.util.Map<java.lang.String,java.lang.String> metadata)
TaskSpec) are not implicitly required,
so a call to addRequiredElement is still needed.
public void addRequiredElement(java.net.URI uri)
TaskSpec) are not implicitly required,
so a call to addRequiredElement is still needed.
public void addRequiredElementAsClasspathJar(java.net.URI uri)
TaskSpec) are not implicitly required,
so a call to addRequiredElement* is still needed.
public void addRequiredElementBundle(java.net.URI bundleURI,
java.io.File localBundle,
java.util.Map<java.lang.String,java.lang.String> metadata)
throws java.io.IOException
java.io.IOException
public void addRequiredElementBundle(java.net.URI bundleURI,
com.parabon.io.DataWrapper localBundle,
java.util.Map<java.lang.String,java.lang.String> metadata)
throws java.io.IOException
java.io.IOException
public void addRequiredElementBundle(java.net.URI bundleURI,
com.parabon.frontier.schemas.client.ElementBundle manifest,
java.util.Map<java.lang.String,java.lang.String> metadata)
throws java.io.IOException
java.io.IOException
public void addRequiredElementAsClasspathJar(java.net.URI uri,
java.util.Map<java.lang.String,java.lang.String> metadata)
TaskSpec) are not implicitly required,
so a call to addRequiredElement* is still needed.
public void addRequiredElementAsNativeLibrary(java.net.URI uri)
TaskSpec) are not implicitly required,
so a call to addRequiredElement* is still needed.
public void addRequiredElementAsNativeLibrary(java.net.URI uri,
java.util.Map<java.lang.String,java.lang.String> metadata)
TaskSpec) are not implicitly required,
so a call to addRequiredElement* is still needed.
public void removeRequiredElement(java.net.URI uri)
public java.util.Set<java.net.URI> getRequiredElementURIs()
Set containing the URIs of elements
currently marked as required for this task.
public java.util.Map<java.lang.String,java.lang.String> getRequiredElementMetadata(java.net.URI uri)
public void setSchedulingConstraints(TaskSpec.SchedulingConstraints schedulingConstraints)
SchedulingConstraints
instance will be copied; the provided SchedulingConstraints
instance may be freely modified after this method returns without affecting
the contents of this TaskSpec.
public TaskSpec.SchedulingConstraints getSchedulingConstraints()
SchedulingConstraints may
be modified freely (as long as the associated TaskSpec may be
legally modified), and these modifications will directly modify the
associated TaskSpec.
public void setVisualizationURI(java.net.URI visualizationURI)
public java.net.URI getVisualizationURI()
public void setRequireNetworkAccess(boolean requireNetworkAccess)
public void setRequireNativeAccess(boolean requireNativeAccess)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||