com.bigdata.service.jini.master
Class TaskMaster.JobState

java.lang.Object
  extended by com.bigdata.service.jini.master.TaskMaster.JobState
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MappedTaskMaster.JobState, ThroughputMaster.JobState
Enclosing class:
TaskMaster<S extends TaskMaster.JobState,T extends Callable<U>,U>

public static class TaskMaster.JobState
extends Object
implements Serializable

State describing the job to be executed. The various properties are all defined by TaskMaster.ConfigurationOptions.

See Also:
Serialized Form

Field Summary
 ServiceMap aggregatorServiceMap
          The mapping of aggregators onto the IRemoteExecutors on which that aggregator will execute.
 ServicesTemplate aggregatorsTemplate
          The ServicesTemplate describing the types of services and the minimum #of services for aggregating asynchronous index writes performed by the clients.
 ServiceMap clientServiceMap
          The mapping of clients onto the IRemoteExecutors on which that client will execute.
 ServicesTemplate clientsTemplate
          The ServicesTemplate describing the types of services and the minimum #of services to which the clients will be distributed for remote execution.
 String component
          The name component in the jini Configuration whose values will be used to configure the TaskMaster.JobState.
 boolean forceOverflow
          true iff overflow will be forced on the data services after the client tasks are done.
protected  Map<Integer,Future<?>> futures
          A map giving the Future for each client.
 File indexDumpDir
          The directory into which scheduled dumps of the index partition metadata will be written by a DumpFederation.ScheduledDumpTask (optional).
 String indexDumpNamespace
          The namespace to be used for the scheduled dumps of the index partition metadata (optional).
 String jobName
          The job name.
 int naggregators
          The #of aggregator tasks.
 int nclients
          The #of client tasks.
 long servicesDiscoveryTimeout
           
 ServicesTemplate[] servicesTemplates
          An array of zero or more ServicesTemplate describing the types of services, and the minimum #of services of each type, that must be discovered before the job may begin.
 
Constructor Summary
protected TaskMaster.JobState(String component, net.jini.config.Configuration config)
           
 
Method Summary
 String getClientZPath(JiniFederation fed, int clientNum)
          Return the zpath to the node which corresponds to the specified client task.
 long getElapsedMillis()
          Elapsed run time for the job in milliseconds.
 String getJobClassZPath(JiniFederation fed)
          Return the zpath of the node for all jobs which are instances of the configured master's class.
 String getJobZPath(JiniFederation fed)
          Return the zpath to the znode which corresponds to the job which is being executed.
 String getLockNodeZPath(JiniFederation fed, int clientNum)
          Return the zpath of the locknode for the specified client task.
 boolean isResumedJob()
          Return true iff an existing job is being resumed.
 String toString()
           
protected  void toString(StringBuilder sb)
          Allows extension of toString()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

futures

protected transient Map<Integer,Future<?>> futures
A map giving the Future for each client. The keys of the map are the client numbers in [0:N-1].

See Also:
TaskMaster.startClients(), #awaitAll(Map), #cancelAll(Map, boolean)

component

public final String component
The name component in the jini Configuration whose values will be used to configure the TaskMaster.JobState. This defaults to the name of the concrete TaskMaster instance. You may override this value using -Dbigdata.component=foo on the command line. This makes it possible to have multiple parameterizations for the same master class in a single Configuration file.


jobName

public final String jobName
The job name.

See Also:
TaskMaster.ConfigurationOptions.JOB_NAME

nclients

public final int nclients
The #of client tasks.

See Also:
TaskMaster.ConfigurationOptions.NCLIENTS

clientsTemplate

public final ServicesTemplate clientsTemplate
The ServicesTemplate describing the types of services and the minimum #of services to which the clients will be distributed for remote execution.

See Also:
TaskMaster.ConfigurationOptions.CLIENTS_TEMPLATE

naggregators

public final int naggregators
The #of aggregator tasks.

See Also:
TaskMaster.ConfigurationOptions.NAGGREGATORS

aggregatorsTemplate

public final ServicesTemplate aggregatorsTemplate
The ServicesTemplate describing the types of services and the minimum #of services for aggregating asynchronous index writes performed by the clients.

See Also:
TaskMaster.ConfigurationOptions.AGGREGATORS_TEMPLATE

servicesTemplates

public final ServicesTemplate[] servicesTemplates
An array of zero or more ServicesTemplate describing the types of services, and the minimum #of services of each type, that must be discovered before the job may begin.

See Also:
TaskMaster.ConfigurationOptions.SERVICES_TEMPLATES

servicesDiscoveryTimeout

public final long servicesDiscoveryTimeout
See Also:
ConfigurationOptions#AWAIT_SERVICES_TIMEOUT}

forceOverflow

public final boolean forceOverflow
true iff overflow will be forced on the data services after the client tasks are done.

See Also:
TaskMaster.ConfigurationOptions.FORCE_OVERFLOW

indexDumpDir

public final File indexDumpDir
The directory into which scheduled dumps of the index partition metadata will be written by a DumpFederation.ScheduledDumpTask (optional).

See Also:
TaskMaster.ConfigurationOptions.INDEX_DUMP_DIR

indexDumpNamespace

public final String indexDumpNamespace
The namespace to be used for the scheduled dumps of the index partition metadata (optional).

See Also:
TaskMaster.ConfigurationOptions.INDEX_DUMP_NAMESPACE

clientServiceMap

public final ServiceMap clientServiceMap
The mapping of clients onto the IRemoteExecutors on which that client will execute.


aggregatorServiceMap

public final ServiceMap aggregatorServiceMap
The mapping of aggregators onto the IRemoteExecutors on which that aggregator will execute.

Constructor Detail

TaskMaster.JobState

protected TaskMaster.JobState(String component,
                              net.jini.config.Configuration config)
                       throws net.jini.config.ConfigurationException
Throws:
net.jini.config.ConfigurationException
Method Detail

isResumedJob

public boolean isResumedJob()
Return true iff an existing job is being resumed.


getElapsedMillis

public long getElapsedMillis()
Elapsed run time for the job in milliseconds. This is ZERO (0L) until the job starts. Once the job is done executing the elapsed time will no longer increase.


toString

protected void toString(StringBuilder sb)
Allows extension of toString()

Parameters:
sb -

toString

public String toString()
Overrides:
toString in class Object

getJobClassZPath

public final String getJobClassZPath(JiniFederation fed)
Return the zpath of the node for all jobs which are instances of the configured master's class.

See Also:
component

getJobZPath

public final String getJobZPath(JiniFederation fed)
Return the zpath to the znode which corresponds to the job which is being executed. The data for this znode is this TaskMaster.JobState.


getClientZPath

public final String getClientZPath(JiniFederation fed,
                                   int clientNum)
Return the zpath to the node which corresponds to the specified client task. This znode is a direct child of the znode for the job. The client is responsible for creating this zpath if they wish to store state in zookeeper. Any ZLocks used by the client and scoped to its work should be created as children of this zpath.

Parameters:
clientNum - The client number.
See Also:
TaskMaster.ConfigurationOptions.JOB_NAME

getLockNodeZPath

public final String getLockNodeZPath(JiniFederation fed,
                                     int clientNum)
Return the zpath of the locknode for the specified client task. Any tasks running with that clientNum MUST contend for a ZLock which permits it to run the task. This prevents concurrent execution of the task for the specified client in the event that more than one master is running for the same TaskMaster.JobState.

Parameters:
clientNum - The client number.


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