public class Job extends Element
Constructor and Description |
---|
Job() |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel()
Cancels this job.
|
java.lang.String |
getApplicationName()
Gets the name of the streams processing application that this job is
running
|
java.lang.String |
getHealth()
Gets the health indicator for this job
|
java.lang.String |
getId()
Gets the id of this job
|
java.lang.String |
getJobGroup()
Gets the group this job belongs to
|
java.lang.String |
getName()
Gets the name of this job
|
java.util.List<Operator> |
getOperators()
Gets a list of
operators for this job |
java.util.List<ProcessingElement> |
getPes()
Gets a list of
processing elements for this job |
java.util.List<ResourceAllocation> |
getResourceAllocations()
Gets a list of
resource allocations for this job. |
java.lang.String |
getResourceType()
Identifies the REST resource type
|
java.lang.String |
getStartedBy()
Identifies the user ID that started this job
|
java.lang.String |
getStatus()
Describes the status of this job
|
java.util.List<JobSubmitParameters> |
getSubmitParameters()
Gets the list of
parameters that were
submitted to this job |
long |
getSubmitTime()
Gets the Epoch time when this job was submitted
|
java.io.File |
retrieveLogTrace(java.io.File directory)
Retrieves the application log and trace files of the job
and saves them as a compressed tar file.
|
void |
waitForHealthy(long timeout,
java.util.concurrent.TimeUnit unit)
Wait for this job to become healthy.
|
getStreamsConnection, refresh, toString
public java.util.List<Operator> getOperators() throws java.io.IOException
operators
for this jobIBM Streams Operators
java.io.IOException
public boolean cancel() throws java.lang.Exception, java.io.IOException
java.io.IOException
java.lang.Exception
public java.lang.String getApplicationName()
public java.lang.String getHealth()
public java.lang.String getId()
public java.lang.String getJobGroup()
public java.lang.String getName()
public java.util.List<ProcessingElement> getPes() throws java.io.IOException
processing elements
for this jobProcessing Elements
java.io.IOException
public java.util.List<ResourceAllocation> getResourceAllocations() throws java.io.IOException
resource allocations
for this job.resource allocations
java.io.IOException
public java.lang.String getResourceType()
public java.lang.String getStartedBy()
public java.lang.String getStatus()
public java.util.List<JobSubmitParameters> getSubmitParameters()
parameters
that were
submitted to this jobpublic long getSubmitTime()
public void waitForHealthy(long timeout, java.util.concurrent.TimeUnit unit) throws java.util.concurrent.TimeoutException, java.lang.InterruptedException, java.io.IOException
healthy
state
before stream processing is started. During this startup time processing
elements are started on resources and then connected. This method
allows code to wait for the job to become healthy before using
the REST api to monitor its elements.
Note that a job may subsequently become unhealthy after this call returns due to failures of processing or resources.
timeout
- Time to wait for the job to become healthy.unit
- Unit for timeout
.java.util.concurrent.TimeoutException
- Job did not become healthy in the time allowed.java.lang.InterruptedException
- Thread was interrupted.java.io.IOException
- Error communicating with Streams.public java.io.File retrieveLogTrace(java.io.File directory) throws java.io.IOException
job_<id>_<timestamp>.tar.gz
where id
is the
job identifier and timestamp
is the number of seconds since the Unix epoch,
for example job_355_1511995995.tar.gz
.directory
- a valid directory in which to save the archive.
Defaults to the current directory.null
if retrieving a job's
logs is not supported in the version of IBM Streams to which the job is submitted.java.io.IOException