com.bigdata.service.mapred
Class JobState<M>

java.lang.Object
  extended by com.bigdata.service.mapred.JobState<M>

public class JobState<M>
extends Object

Job state that is relevant to this service.

Version:
$Id: JobState.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Field Summary
 Map<UUID,Future<Object>> futures
          The running tasks for this job.
 BlockingQueue<Outcome> outcomes
          The Outcomes for the completed tasks.
 
Constructor Summary
JobState(UUID uuid, M metadata, IBigdataClient client)
           
 
Method Summary
 boolean cancel(UUID task)
          Cancel the task if it is running.
 void cancelAll()
          Cancel all running tasks for this job.
 UUID getUUID()
          The job identifier.
 String status()
          A human readable summary of the JobState.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

futures

public Map<UUID,Future<Object>> futures
The running tasks for this job. The key is the task UUID. The value is the Future for that task. FIXME reduce visibility - exposed for some unit tests.


outcomes

public BlockingQueue<Outcome> outcomes
The Outcomes for the completed tasks. Outcomes are placed into this queue by the AbstractJobAndTaskService.AbstractTaskWorker. FIXME reduce visibility - exposed for some unit tests.

Constructor Detail

JobState

public JobState(UUID uuid,
                M metadata,
                IBigdataClient client)
Method Detail

getUUID

public UUID getUUID()
The job identifier.


cancelAll

public void cancelAll()
Cancel all running tasks for this job.

Note: The job MUST be cancelled first since otherwise tasks could continue to be queued while this method is running.

Note: Outcomes are discarded when the job is cancelled.


cancel

public boolean cancel(UUID task)
Cancel the task if it is running.

Parameters:
task - The task identifier.
Returns:
true if the job was cancelled.

status

public String status()
A human readable summary of the JobState.



Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.