com.sun.slamd.job
Class OptimizingJob

java.lang.Object
  extended by com.sun.slamd.job.OptimizingJob
All Implemented Interfaces:
java.lang.Comparable

public class OptimizingJob
extends java.lang.Object
implements java.lang.Comparable

This class defines an optimizing job, which is a special kind of job that has the ability to execute the same job multiple times varying only the number of threads per client in an attempt to automatically determine the highest or lowest value for a particular statistic.

Author:
Neil A. Wilson

Field Summary
static java.lang.String ELEMENT_ACTUAL_START_TIME
          The name of the encoded element that holds the actual start time.
static java.lang.String ELEMENT_ACTUAL_STOP_TIME
          The name of the encoded element that holds the actual stop time.
static java.lang.String ELEMENT_COLLECTION_INTERVAL
          The name of the encoded element that holds the collection interval.
static java.lang.String ELEMENT_DELAY_BETWEEN_ITERATIONS
          The name of the encoded element that holds the delay between iterations.
static java.lang.String ELEMENT_DEPENDENCIES
          The name of the encoded element that holds the dependencies.
static java.lang.String ELEMENT_DESCRIPTION
          The name of the encoded element that holds the job description.
static java.lang.String ELEMENT_DISPLAY_IN_READ_ONLY
          The name of the encoded element that indicates whether the job should be displayed in restricted read-only mode.
static java.lang.String ELEMENT_DURATION
          The name of the encoded element that holds the scheduled duration.
static java.lang.String ELEMENT_FOLDER_NAME
          The name of the encoded element that holds the job folder name.
static java.lang.String ELEMENT_INCLUDE_THREADS_IN_DESCRIPTION
          The name of the encoded element that indicates whether to include the number of threads in the job descriptions.
static java.lang.String ELEMENT_ITERATION_IDS
          The name of the encoded element that holds the job IDs of the standard iterations.
static java.lang.String ELEMENT_JOB_CLASS
          The name of the encoded element that holds the job class name.
static java.lang.String ELEMENT_JOB_GROUP
          The name of the encoded element that holds the job group name.
static java.lang.String ELEMENT_JOB_STATE
          The name of the encoded element that holds the job state.
static java.lang.String ELEMENT_MAX_NONIMPROVING
          The name of the encoded element that holds the maximum allowed nonimproving iterations.
static java.lang.String ELEMENT_MAX_THREADS
          The name of the encoded element that holds the maximum number of threads to use.
static java.lang.String ELEMENT_MIN_THREADS
          The name of the encoded element that holds the minimum number of threads to use.
static java.lang.String ELEMENT_MONITOR_CLIENTS
          The name of the encoded element that holds the requested monitor clients.
static java.lang.String ELEMENT_MONITOR_CLIENTS_IF_AVAILABLE
          The name of the encoded element that indicates whether to monitor clients if they are also running resource monitor clients.
static java.lang.String ELEMENT_NOTIFY_ADDRESSES
          The name of the encoded element that holds the addresses of the users to notify when the optimizing job is done running.
static java.lang.String ELEMENT_NUM_CLIENTS
          The name of the encoded element that holds the number of clients.
static java.lang.String ELEMENT_OPTIMIZATION_ALGORITHM
          The name of the encoded element that holds the information about the optimization algorithm.
static java.lang.String ELEMENT_OPTIMIZING_JOB_ID
          The name of the encoded element that holds the optimizing job ID.
static java.lang.String ELEMENT_PARAMETERS
          The name of the encoded element that holds the job parameters.
static java.lang.String ELEMENT_PAUSE_REQUESTED
          The name of th eencoded element that indicates whether the optimizing job should make the next iteration disabled when it is scheduled.
static java.lang.String ELEMENT_REQUESTED_CLIENTS
          The name of the encoded element that holds the requested clients.
static java.lang.String ELEMENT_RERUN_BEST_ITERATION
          The name of the encoded element that indicates whether to rerun the best iteration.
static java.lang.String ELEMENT_RERUN_DURATION
          The name of the encoded element that holds the scheduled duration for the rerun iteration.
static java.lang.String ELEMENT_RERUN_ID
          The name of the encoded element that holds the job IDs of the rerun iteration.
static java.lang.String ELEMENT_START_TIME
          The name of the encoded element that holds the scheduled start time.
static java.lang.String ELEMENT_STOP_REASON
          The name of the encoded element that holds the stop reason.
static java.lang.String ELEMENT_THREAD_INCREMENT
          The name of the encoded element that holds the thread increment.
static java.lang.String ELEMENT_THREAD_STARTUP_DELAY
          The name of the encoded element that holds the thread startup delay.
 
Constructor Summary
OptimizingJob(SLAMDServer slamdServer, java.lang.String optimizingJobID, OptimizationAlgorithm optimizationAlgorithm, JobClass jobClass, java.lang.String folderName, java.lang.String description, boolean includeThreadsInDescription, java.util.Date startTime, int duration, int delayBetweenIterations, int numClients, java.lang.String[] requestedClients, java.lang.String[] monitorClients, boolean monitorClientsIfAvailable, int minThreads, int maxThreads, int threadIncrement, int collectionInterval, int maxNonImproving, java.lang.String[] notifyAddresses, boolean reRunBestIteration, int reRunDuration, ParameterList parameters, boolean displayInReadOnlyMode)
          Creates a new instance of an optimizing job based on the provided information.
OptimizingJob(SLAMDServer slamdServer, java.lang.String optimizingJobID, OptimizationAlgorithm optimizationAlgorithm, Job baseJob, java.lang.String folderName, java.lang.String description, boolean includeThreadsInDescription, java.util.Date startTime, int duration, int delayBetweenIterations, int numClients, java.lang.String[] requestedClients, java.lang.String[] monitorClients, boolean monitorClientsIfAvailable, int minThreads, int maxThreads, int threadIncrement, int collectionInterval, int maxNonImproving, java.lang.String[] notifyAddresses, boolean reRunBestIteration, int reRunDuration, boolean displayInReadOnlyMode)
          Creates a new instance of an optimizing job based on the provided information.
 
Method Summary
 void cancel()
          Handles the work of cancelling this optimizing job.
 void cancelPause()
          Indicates that this optimizing job does not need to be paused before the next iteration.
 int compareTo(java.lang.Object o)
          Compares this optimizing job with the provided object to determine the relative order of the two in a sorted list.
static OptimizingJob decode(SLAMDServer slamdServer, byte[] encodedOptimizingJob)
          Decodes the provided byte array as an optimizing job.
static OptimizingJob decodeSummary(SLAMDServer slamdServer, byte[] encodedOptimizingJob)
          Decodes the provided byte array as an optimizing job, but only including summary information.
 boolean displayInReadOnlyMode()
          Indicates whether this optimizing job should be displayed in restricted read-only mode.
 boolean doneRunning()
          Indicates whether the optimization process has completed (i.e., no additional iterations will be performed, for whatever reason).
 byte[] encode()
          Encodes information about this optimizing job to a byte array suitable for storage in the configuration database.
 java.util.Date getActualStartTime()
          Retrieves the time at which the first iteration of this job actually started running.
 java.util.Date getActualStopTime()
          Retrieves the time at which the last iteration of this job actually completed running.
 Job[] getAssociatedJobs()
          Retrieves the set of jobs scheduled as iterations of this optimizing job.
 int getCollectionInterval()
          Retrieves the statistics collection interval that should be used for each iteration of this optimizing job.
 int getDelayBetweenIterations()
          Retrieves the length of time in seconds that should be scheduled between iterations of this optimizing job.
 java.lang.String[] getDependencies()
          Retrieves the set of dependencies associated with this optimizing job.
 java.lang.String getDescription()
          Retrieves the base description for this optimizing job.
 int getDuration()
          Retrieves the maximum length of time that any iteration of this optimizing job should be allowed to run.
 java.lang.String getFolderName()
          Retrieves the name of the job folder in which this optimizing job is located.
 JobClass getJobClass()
          Retrieves the job class associated with this optimizing job.
 java.lang.String getJobClassDescription()
          Retrieves the description for the job class associated with this optimizing job.
 java.lang.String getJobClassName()
          Retrieves the name of the job class associated with this optimizing job.
 java.lang.String getJobGroup()
          Retrieves the name of the job group with which this optimizing job is associated.
 java.lang.String getJobName()
          Retrieves the job name for the job class associated with this optimizing job.
 int getJobState()
          Retrieves the current state of this optimizing job.
 java.lang.String getJobStateString()
          Retrieves the string representation of the current state for this optimizing job.
 int getMaxNonImproving()
          Retrieves the maximum number of consecutive non-improving iterations that will be allowed before the job is determined to have found the optimum value.
 int getMaxThreads()
          Retrieves the maximum number of threads that should be used in an iteration of this optimizing job.
 int getMinThreads()
          Retrieves the minimum number of threads that should be used in an iteration of this optimizing job.
 java.lang.String[] getNotifyAddresses()
          Retrieves the e-mail address(es) of the user(s) that should be notified whenever the optimization process has completed.
 int getNumClients()
          Retrieves the number of clients that should be used to run each iteration of this optimizing job.
 Job getOptimalIteration()
          Retrieves the job that was the optimal iteration for this optimizing job.
 java.lang.String getOptimalJobID()
          Retrieves the job ID of the optimal iteration.
 int getOptimalThreadCount()
          Retrieves the optimal thread count that has been identified.
 double getOptimalValue()
          Retrieves the optimal value that has been identified.
 OptimizationAlgorithm getOptimizationAlgorithm()
          Retrieves the optimization algorithm associated with this optimizing job.
 ParameterList getOptimizationParameters()
          Retrieves the set of parameters associated with the optimization algorithm.
 ParameterList getOptimizationParameterStubs()
          Retrieves the set of parameter stubs associated with the optimization algorithm.
 java.lang.String getOptimizingJobID()
          Retrieves the unique ID associated with this optimizing job.
 ParameterList getParameters()
          Retrieves the parameter list associated with this optimizing job.
 ParameterList getParameterStubs()
          Retrieves the set of parameter stubs associated with this optimizing job.
 java.lang.String[] getRequestedClients()
          Retrieves the set of clients that have been requested to run each iteration of this optimizing job.
 int getReRunDuration()
          Retrieves the duration that should be used when re-running the best iteration of the optimizing job.
 Job getReRunIteration()
          Retrieves the job iteration that was a re-run of the best iteration for this optimizing job.
 java.lang.String[] getResourceMonitorClients()
          Retrieves the set of resource monitor clients that have been requested for this optimizing job.
 java.util.Date getStartTime()
          Retrieves the time at which the first iteration of this optimizing job should start running.
 java.lang.String getStopReason()
          Retrieves the reason that the job stopped running.
 int getThreadIncrement()
          Retrieves the increment that should be used when increasing the number of threads used between iterations of this optimizing job.
 int getThreadStartupDelay()
          Retrieves the thread startup delay for iterations of this optimizing job.
 boolean hasStats()
          Indicates whether at least some statistical information is available for this optimizing job.
 boolean includeThreadsInDescription()
          Indicates whether the number of threads should be included in the description for each iteration of this optimizing job.
 void jobIterationComplete(Job jobIteration)
          Indicates that one iteration of this optimizing job is complete and that any appropriate action should be taken.
 boolean monitorClientsIfAvailable()
          Indicates whether an attempt will be made to use resource monitor clients on the same systems as the clients used to run this job.
 void pauseBeforeNextIteration()
          Requests that this optimizing job be paused before its next iteration.
 boolean pauseRequested()
          Indicates whether a request has been submitted to pause this optimizing job.
 boolean reRunBestIteration()
          Indicates whether the best iteration should be re-run once the job has completed.
 void schedule()
          Causes the first iteration of this optimizing job to be scheduled for execution in the SLAMD server.
 void scheduleReRunOfBestIteration()
          This schedules a second run of the iteration that yielded the best result.
 void sendJobCompleteNotification()
          Sends an e-mail message to any configured recipients indicating that the optimization process has completed.
 void setActualStartTime(java.util.Date actualStartTime)
          Specifies the time at which the first iteration of this job actually started running.
 void setActualStopTime(java.util.Date actualStopTime)
          Specifies the time at which the last iteration of this job actually completed running.
 void setAssociatedJobs(Job[] associatedJobs)
          Specifies the set of jobs scheduled as iterations of this optimizing job.
 void setDependencies(java.lang.String[] dependencies)
          Specifies the set of dependencies for this optimizing job.
 void setDisplayInReadOnlyMode(boolean displayInReadOnlyMode)
          Specifies whether this optimizing job should be displayed in restricted read-only mode.
 void setFolderName(java.lang.String folderName)
          Specifies the name of the job folder in which this optimizing job is located.
 void setJobGroup(java.lang.String jobGroup)
          Specifies the name of the job group with which this optimizing job is associated.
 void setJobState(int jobState)
          Specifies the current state of this optimizing job.
 void setMonitorClientsIfAvailable(boolean monitorClientsIfAvailable)
          Specifies whether an attempt should be made to use resource monitor clients on the same systems as the clients used to run this job.
 void setOptimalIteration(Job optimalIteration)
          Specifies the optimal iteration for this optimizing job.
 void setReRunIteration(Job reRunIteration)
          Specifies the job that is a re-run of the best iteration of this optimizing job.
 void setStopReason(java.lang.String stopReason)
          Specifies the reason that the job stopped running.
 void setThreadStartupDelay(int threadStartupDelay)
          Specifies the thread startup delay for iterations of this optimizing job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENT_OPTIMIZING_JOB_ID

public static final java.lang.String ELEMENT_OPTIMIZING_JOB_ID
The name of the encoded element that holds the optimizing job ID.

See Also:
Constant Field Values

ELEMENT_ITERATION_IDS

public static final java.lang.String ELEMENT_ITERATION_IDS
The name of the encoded element that holds the job IDs of the standard iterations.

See Also:
Constant Field Values

ELEMENT_RERUN_ID

public static final java.lang.String ELEMENT_RERUN_ID
The name of the encoded element that holds the job IDs of the rerun iteration.

See Also:
Constant Field Values

ELEMENT_JOB_CLASS

public static final java.lang.String ELEMENT_JOB_CLASS
The name of the encoded element that holds the job class name.

See Also:
Constant Field Values

ELEMENT_JOB_GROUP

public static final java.lang.String ELEMENT_JOB_GROUP
The name of the encoded element that holds the job group name.

See Also:
Constant Field Values

ELEMENT_JOB_STATE

public static final java.lang.String ELEMENT_JOB_STATE
The name of the encoded element that holds the job state.

See Also:
Constant Field Values

ELEMENT_DESCRIPTION

public static final java.lang.String ELEMENT_DESCRIPTION
The name of the encoded element that holds the job description.

See Also:
Constant Field Values

ELEMENT_INCLUDE_THREADS_IN_DESCRIPTION

public static final java.lang.String ELEMENT_INCLUDE_THREADS_IN_DESCRIPTION
The name of the encoded element that indicates whether to include the number of threads in the job descriptions.

See Also:
Constant Field Values

ELEMENT_DISPLAY_IN_READ_ONLY

public static final java.lang.String ELEMENT_DISPLAY_IN_READ_ONLY
The name of the encoded element that indicates whether the job should be displayed in restricted read-only mode.

See Also:
Constant Field Values

ELEMENT_START_TIME

public static final java.lang.String ELEMENT_START_TIME
The name of the encoded element that holds the scheduled start time.

See Also:
Constant Field Values

ELEMENT_DURATION

public static final java.lang.String ELEMENT_DURATION
The name of the encoded element that holds the scheduled duration.

See Also:
Constant Field Values

ELEMENT_DELAY_BETWEEN_ITERATIONS

public static final java.lang.String ELEMENT_DELAY_BETWEEN_ITERATIONS
The name of the encoded element that holds the delay between iterations.

See Also:
Constant Field Values

ELEMENT_NUM_CLIENTS

public static final java.lang.String ELEMENT_NUM_CLIENTS
The name of the encoded element that holds the number of clients.

See Also:
Constant Field Values

ELEMENT_REQUESTED_CLIENTS

public static final java.lang.String ELEMENT_REQUESTED_CLIENTS
The name of the encoded element that holds the requested clients.

See Also:
Constant Field Values

ELEMENT_MONITOR_CLIENTS

public static final java.lang.String ELEMENT_MONITOR_CLIENTS
The name of the encoded element that holds the requested monitor clients.

See Also:
Constant Field Values

ELEMENT_MONITOR_CLIENTS_IF_AVAILABLE

public static final java.lang.String ELEMENT_MONITOR_CLIENTS_IF_AVAILABLE
The name of the encoded element that indicates whether to monitor clients if they are also running resource monitor clients.

See Also:
Constant Field Values

ELEMENT_MIN_THREADS

public static final java.lang.String ELEMENT_MIN_THREADS
The name of the encoded element that holds the minimum number of threads to use.

See Also:
Constant Field Values

ELEMENT_MAX_THREADS

public static final java.lang.String ELEMENT_MAX_THREADS
The name of the encoded element that holds the maximum number of threads to use.

See Also:
Constant Field Values

ELEMENT_THREAD_INCREMENT

public static final java.lang.String ELEMENT_THREAD_INCREMENT
The name of the encoded element that holds the thread increment.

See Also:
Constant Field Values

ELEMENT_THREAD_STARTUP_DELAY

public static final java.lang.String ELEMENT_THREAD_STARTUP_DELAY
The name of the encoded element that holds the thread startup delay.

See Also:
Constant Field Values

ELEMENT_COLLECTION_INTERVAL

public static final java.lang.String ELEMENT_COLLECTION_INTERVAL
The name of the encoded element that holds the collection interval.

See Also:
Constant Field Values

ELEMENT_FOLDER_NAME

public static final java.lang.String ELEMENT_FOLDER_NAME
The name of the encoded element that holds the job folder name.

See Also:
Constant Field Values

ELEMENT_MAX_NONIMPROVING

public static final java.lang.String ELEMENT_MAX_NONIMPROVING
The name of the encoded element that holds the maximum allowed nonimproving iterations.

See Also:
Constant Field Values

ELEMENT_RERUN_BEST_ITERATION

public static final java.lang.String ELEMENT_RERUN_BEST_ITERATION
The name of the encoded element that indicates whether to rerun the best iteration.

See Also:
Constant Field Values

ELEMENT_RERUN_DURATION

public static final java.lang.String ELEMENT_RERUN_DURATION
The name of the encoded element that holds the scheduled duration for the rerun iteration.

See Also:
Constant Field Values

ELEMENT_NOTIFY_ADDRESSES

public static final java.lang.String ELEMENT_NOTIFY_ADDRESSES
The name of the encoded element that holds the addresses of the users to notify when the optimizing job is done running.

See Also:
Constant Field Values

ELEMENT_DEPENDENCIES

public static final java.lang.String ELEMENT_DEPENDENCIES
The name of the encoded element that holds the dependencies.

See Also:
Constant Field Values

ELEMENT_OPTIMIZATION_ALGORITHM

public static final java.lang.String ELEMENT_OPTIMIZATION_ALGORITHM
The name of the encoded element that holds the information about the optimization algorithm.

See Also:
Constant Field Values

ELEMENT_PARAMETERS

public static final java.lang.String ELEMENT_PARAMETERS
The name of the encoded element that holds the job parameters.

See Also:
Constant Field Values

ELEMENT_ACTUAL_START_TIME

public static final java.lang.String ELEMENT_ACTUAL_START_TIME
The name of the encoded element that holds the actual start time.

See Also:
Constant Field Values

ELEMENT_ACTUAL_STOP_TIME

public static final java.lang.String ELEMENT_ACTUAL_STOP_TIME
The name of the encoded element that holds the actual stop time.

See Also:
Constant Field Values

ELEMENT_STOP_REASON

public static final java.lang.String ELEMENT_STOP_REASON
The name of the encoded element that holds the stop reason.

See Also:
Constant Field Values

ELEMENT_PAUSE_REQUESTED

public static final java.lang.String ELEMENT_PAUSE_REQUESTED
The name of th eencoded element that indicates whether the optimizing job should make the next iteration disabled when it is scheduled.

See Also:
Constant Field Values
Constructor Detail

OptimizingJob

public OptimizingJob(SLAMDServer slamdServer,
                     java.lang.String optimizingJobID,
                     OptimizationAlgorithm optimizationAlgorithm,
                     Job baseJob,
                     java.lang.String folderName,
                     java.lang.String description,
                     boolean includeThreadsInDescription,
                     java.util.Date startTime,
                     int duration,
                     int delayBetweenIterations,
                     int numClients,
                     java.lang.String[] requestedClients,
                     java.lang.String[] monitorClients,
                     boolean monitorClientsIfAvailable,
                     int minThreads,
                     int maxThreads,
                     int threadIncrement,
                     int collectionInterval,
                     int maxNonImproving,
                     java.lang.String[] notifyAddresses,
                     boolean reRunBestIteration,
                     int reRunDuration,
                     boolean displayInReadOnlyMode)
Creates a new instance of an optimizing job based on the provided information.

Parameters:
slamdServer - The SLAMD server with which this optimizing job is associated.
optimizingJobID - The unique ID for this optimizing job.
optimizationAlgorithm - The optimization algorithm to use for this optimizing job.
baseJob - The base job that should be used to provide parameter information for this optimizing job.
folderName - The name of the job folder in which the optimizing job should be placed.
description - The base description for each job iteration.
includeThreadsInDescription - Indicates whether the thread count should be included in the description for each job iteration.
startTime - The time that the first iteration should start running.
duration - The maximum length of time any job iteration should be allowed to run.
delayBetweenIterations - The length of time in seconds that should be left between job iterations.
numClients - The number of clients that should be used to run each iteration.
requestedClients - The set of clients that have been requested for each iteration.
monitorClients - The set of resource monitor clients that have been requested for this optimizing job.
monitorClientsIfAvailable - Indicates whether any resource monitor clients on the same system(s) as the job clients should automatically be used.
minThreads - The minimum number of threads that should be used on each client.
maxThreads - The maximum number of threads that should be used for each client. If there is no maximum, this should be negative.
threadIncrement - The increase in threads that should be used between iterations.
collectionInterval - The statistics collection interval that should be used for the job iterations.
maxNonImproving - The maximum number of consecutive non-improving iterations that will be allowed before ending the job.
notifyAddresses - The e-mail addresses of the users that should be notified when the optimization process is complete.
reRunBestIteration - Indicates whether the best iteration should be re-run once the optimizing job is otherwise complete.
reRunDuration - The duration that should be used when re-running the best iteration.
displayInReadOnlyMode - Indicates whether this optimizing job should be displayed in restricted read-only mode.

OptimizingJob

public OptimizingJob(SLAMDServer slamdServer,
                     java.lang.String optimizingJobID,
                     OptimizationAlgorithm optimizationAlgorithm,
                     JobClass jobClass,
                     java.lang.String folderName,
                     java.lang.String description,
                     boolean includeThreadsInDescription,
                     java.util.Date startTime,
                     int duration,
                     int delayBetweenIterations,
                     int numClients,
                     java.lang.String[] requestedClients,
                     java.lang.String[] monitorClients,
                     boolean monitorClientsIfAvailable,
                     int minThreads,
                     int maxThreads,
                     int threadIncrement,
                     int collectionInterval,
                     int maxNonImproving,
                     java.lang.String[] notifyAddresses,
                     boolean reRunBestIteration,
                     int reRunDuration,
                     ParameterList parameters,
                     boolean displayInReadOnlyMode)
Creates a new instance of an optimizing job based on the provided information.

Parameters:
slamdServer - The SLAMD server with which this optimizing job is associated.
optimizingJobID - The unique ID for this optimizing job.
optimizationAlgorithm - The optimization algorithm to use for this optimizing job.
jobClass - The job class associated with this optimizing job.
folderName - The name of the folder in which this optimizing job should be placed.
description - The base description for each job iteration.
includeThreadsInDescription - Indicates whether the thread count should be included in the description for each job iteration.
startTime - The time that the first iteration should start running.
duration - The maximum length of time any job iteration should be allowed to run.
delayBetweenIterations - The length of time in seconds that should be left between job iterations.
numClients - The number of clients that should be used to run each iteration.
requestedClients - The set of clients that have been requested for each iteration.
monitorClients - The set of resource monitor clients that have been requested for this optimizing job.
monitorClientsIfAvailable - Indicates whether any resource monitor clients on the same system(s) as the job clients should automatically be used.
minThreads - The minimum number of threads that should be used on each client.
maxThreads - The maximum number of threads that should be used for each client. If there is no maximum, this should be negative.
threadIncrement - The increase in threads that should be used between iterations.
collectionInterval - The statistics collection interval that should be used for the job iterations.
maxNonImproving - The maximum number of consecutive non-improving iterations that will be allowed before ending the job.
notifyAddresses - The e-mail addresses of the users that should be notified when the optimization process is complete.
reRunBestIteration - Indicates whether the best iteration should be re-run once the optimizing job is otherwise complete.
reRunDuration - The duration that should be used when re-running the best iteration.
parameters - The parameter list for this optimizing job.
displayInReadOnlyMode - Indicates whether this optimizing job should be displayed in restricted read-only mode.
Method Detail

getOptimizingJobID

public java.lang.String getOptimizingJobID()
Retrieves the unique ID associated with this optimizing job.

Returns:
The unique ID associated with this optimizing job.

getOptimizationAlgorithm

public OptimizationAlgorithm getOptimizationAlgorithm()
Retrieves the optimization algorithm associated with this optimizing job.

Returns:
The optimization algorithm associated with this optimizing job.

getJobClass

public JobClass getJobClass()
Retrieves the job class associated with this optimizing job.

Returns:
The job class associated with this optimizing job.

getJobClassName

public java.lang.String getJobClassName()
Retrieves the name of the job class associated with this optimizing job.

Returns:
The name of the job class associated with this optimizing job.

getJobName

public java.lang.String getJobName()
Retrieves the job name for the job class associated with this optimizing job.

Returns:
The job name for the job class associated with this optimizing job.

getJobClassDescription

public java.lang.String getJobClassDescription()
Retrieves the description for the job class associated with this optimizing job.

Returns:
The description for the job class associated with this optimizing job.

getJobGroup

public java.lang.String getJobGroup()
Retrieves the name of the job group with which this optimizing job is associated.

Returns:
The name of the job group with which this optimizing job is associated, or null if it was not scheduled as part of a job group.

setJobGroup

public void setJobGroup(java.lang.String jobGroup)
Specifies the name of the job group with which this optimizing job is associated.

Parameters:
jobGroup - The name of the job group with which this optimizing job is associated.

displayInReadOnlyMode

public boolean displayInReadOnlyMode()
Indicates whether this optimizing job should be displayed in restricted read-only mode.

Returns:
true if this optimizing job should be displayed in restricted read-only mode, or false if not.

setDisplayInReadOnlyMode

public void setDisplayInReadOnlyMode(boolean displayInReadOnlyMode)
Specifies whether this optimizing job should be displayed in restricted read-only mode.

Parameters:
displayInReadOnlyMode - Indicates whether this optimizing job should be displayed in restricted read-only mode.

getFolderName

public java.lang.String getFolderName()
Retrieves the name of the job folder in which this optimizing job is located.

Returns:
The name of the job folder in which this optimizing job is located.

setFolderName

public void setFolderName(java.lang.String folderName)
Specifies the name of the job folder in which this optimizing job is located.

Parameters:
folderName - The name of the job folder in which this optimizing job is located.

getParameterStubs

public ParameterList getParameterStubs()
Retrieves the set of parameter stubs associated with this optimizing job.

Returns:
The set of parameter stubs associated with this optimizing job.

getOptimizationParameterStubs

public ParameterList getOptimizationParameterStubs()
Retrieves the set of parameter stubs associated with the optimization algorithm.

Returns:
The set of parameter stubs associated with the optimization algorithm.

getParameters

public ParameterList getParameters()
Retrieves the parameter list associated with this optimizing job.

Returns:
The parameter list associated with this optimizing job.

getOptimizationParameters

public ParameterList getOptimizationParameters()
Retrieves the set of parameters associated with the optimization algorithm.

Returns:
The set of parameters associated with the optimization algorithm.

getDescription

public java.lang.String getDescription()
Retrieves the base description for this optimizing job.

Returns:
The base description for this optimizing job.

includeThreadsInDescription

public boolean includeThreadsInDescription()
Indicates whether the number of threads should be included in the description for each iteration of this optimizing job.

Returns:
true if the number of threads should be included in the description for this optimizing job, or false if not.

getStartTime

public java.util.Date getStartTime()
Retrieves the time at which the first iteration of this optimizing job should start running.

Returns:
The time at which the first iteration of this optimizing job.

getDuration

public int getDuration()
Retrieves the maximum length of time that any iteration of this optimizing job should be allowed to run.

Returns:
The maximum length of time that any iteration of this optimizing job should be allowed to run.

getDelayBetweenIterations

public int getDelayBetweenIterations()
Retrieves the length of time in seconds that should be scheduled between iterations of this optimizing job.

Returns:
The length of time in seconds that should be scheduled between iterations of this optimizing job.

reRunBestIteration

public boolean reRunBestIteration()
Indicates whether the best iteration should be re-run once the job has completed.

Returns:
true if the best iteration should be re-run after the job has completed, or false if not.

getReRunDuration

public int getReRunDuration()
Retrieves the duration that should be used when re-running the best iteration of the optimizing job.

Returns:
The duration that should be used when re-running the best iteration of the optimizing job.

getReRunIteration

public Job getReRunIteration()
Retrieves the job iteration that was a re-run of the best iteration for this optimizing job.

Returns:
The job iteration that was a re-run of the best iteration for this optimizing job, or null if there is none or it hasn't run yet.

setReRunIteration

public void setReRunIteration(Job reRunIteration)
Specifies the job that is a re-run of the best iteration of this optimizing job.

Parameters:
reRunIteration - The job that is a re-run of the best iteration of this optimizing job.

getNumClients

public int getNumClients()
Retrieves the number of clients that should be used to run each iteration of this optimizing job.

Returns:
The number of clients that should be used to run each iteration of this optimizing job.

getRequestedClients

public java.lang.String[] getRequestedClients()
Retrieves the set of clients that have been requested to run each iteration of this optimizing job.

Returns:
The number of clients that should be used to run each iteration of this optimizing job.

getResourceMonitorClients

public java.lang.String[] getResourceMonitorClients()
Retrieves the set of resource monitor clients that have been requested for this optimizing job.

Returns:
The set of resource monitor clients that have been requested for this optimizing job.

monitorClientsIfAvailable

public boolean monitorClientsIfAvailable()
Indicates whether an attempt will be made to use resource monitor clients on the same systems as the clients used to run this job.

Returns:
true if resource monitor clients on the same systems as the clients will be used, or false if not.

setMonitorClientsIfAvailable

public void setMonitorClientsIfAvailable(boolean monitorClientsIfAvailable)
Specifies whether an attempt should be made to use resource monitor clients on the same systems as the clients used to run this job.

Parameters:
monitorClientsIfAvailable - Specifies whether an attempt should be made to use resource monitor clients on the same systems as the clients used to run this job.

getMinThreads

public int getMinThreads()
Retrieves the minimum number of threads that should be used in an iteration of this optimizing job.

Returns:
The minimum number of threads that should be used in an iteration of this optimizing job.

getMaxThreads

public int getMaxThreads()
Retrieves the maximum number of threads that should be used in an iteration of this optimizing job.

Returns:
The maximum number of threads that should be used in an iteration of this optimizing job.

getThreadIncrement

public int getThreadIncrement()
Retrieves the increment that should be used when increasing the number of threads used between iterations of this optimizing job.

Returns:
The increment that should be used when increasing the number of threads used between iterations of this optimizing job.

getThreadStartupDelay

public int getThreadStartupDelay()
Retrieves the thread startup delay for iterations of this optimizing job.

Returns:
The thread startup delay for iterations of this optimizing job.

setThreadStartupDelay

public void setThreadStartupDelay(int threadStartupDelay)
Specifies the thread startup delay for iterations of this optimizing job.

Parameters:
threadStartupDelay - The thread startup delay for iterations of this optimizing job.

getCollectionInterval

public int getCollectionInterval()
Retrieves the statistics collection interval that should be used for each iteration of this optimizing job.

Returns:
The statistics collection interval that should be used for each iteration of this optimizing job.

getMaxNonImproving

public int getMaxNonImproving()
Retrieves the maximum number of consecutive non-improving iterations that will be allowed before the job is determined to have found the optimum value.

Returns:
The maximum number of consecutive non-improving iterations that will be allowed before the job is determined to have found the optimum value.

getNotifyAddresses

public java.lang.String[] getNotifyAddresses()
Retrieves the e-mail address(es) of the user(s) that should be notified whenever the optimization process has completed.

Returns:
The e-mail address(es) of the user(s) that should be notified whenever the optimization process has completed.

getActualStartTime

public java.util.Date getActualStartTime()
Retrieves the time at which the first iteration of this job actually started running.

Returns:
The time at which the first iteration of this job actually started running.

setActualStartTime

public void setActualStartTime(java.util.Date actualStartTime)
Specifies the time at which the first iteration of this job actually started running.

Parameters:
actualStartTime - The time at which the first iteration of this job actually started running.

getActualStopTime

public java.util.Date getActualStopTime()
Retrieves the time at which the last iteration of this job actually completed running.

Returns:
The time at which the last iteration of this job actually completed running.

setActualStopTime

public void setActualStopTime(java.util.Date actualStopTime)
Specifies the time at which the last iteration of this job actually completed running.

Parameters:
actualStopTime - The time at which the last iteration of this job actually completed running.

getJobState

public int getJobState()
Retrieves the current state of this optimizing job.

Returns:
The current state of this optimizing job.

setJobState

public void setJobState(int jobState)
Specifies the current state of this optimizing job.

Parameters:
jobState - The current state of this optimizing job.

getJobStateString

public java.lang.String getJobStateString()
Retrieves the string representation of the current state for this optimizing job.

Returns:
The string representation of the current state for this optimizing job.

getStopReason

public java.lang.String getStopReason()
Retrieves the reason that the job stopped running.

Returns:
The reason that the job stopped running.

setStopReason

public void setStopReason(java.lang.String stopReason)
Specifies the reason that the job stopped running.

Parameters:
stopReason - The reason that the job stopped running.

getAssociatedJobs

public Job[] getAssociatedJobs()
Retrieves the set of jobs scheduled as iterations of this optimizing job.

Returns:
The set of jobs scheduled as iterations of this optimizing job.

setAssociatedJobs

public void setAssociatedJobs(Job[] associatedJobs)
Specifies the set of jobs scheduled as iterations of this optimizing job.

Parameters:
associatedJobs - The set of jobs scheduled as iterations of this optimizing job.

getDependencies

public java.lang.String[] getDependencies()
Retrieves the set of dependencies associated with this optimizing job.

Returns:
The set of dependencies associated with this optimizing job.

setDependencies

public void setDependencies(java.lang.String[] dependencies)
Specifies the set of dependencies for this optimizing job.

Parameters:
dependencies - The set of dependencies for this optimizing job.

doneRunning

public boolean doneRunning()
Indicates whether the optimization process has completed (i.e., no additional iterations will be performed, for whatever reason).

Returns:
true if the optimization process has completed, or false if not.

hasStats

public boolean hasStats()
Indicates whether at least some statistical information is available for this optimizing job.

Returns:
true if there is statistical information available for this optimizing job, or false if not.

getOptimalThreadCount

public int getOptimalThreadCount()
Retrieves the optimal thread count that has been identified. Note that this may not be accurate if the job has not yet completed.

Returns:
The optimal thread count that has been identified, or -1 if no optimal thread count has been determined.

getOptimalValue

public double getOptimalValue()
Retrieves the optimal value that has been identified. Note that this may not be accurate if the job has not yet completed.

Returns:
The optimal value that has been identified, or -1.0 if no optimal value has been determined.

getOptimalJobID

public java.lang.String getOptimalJobID()
Retrieves the job ID of the optimal iteration. Note that this may not be accurate if the job has not yet completed.

Returns:
The job ID of the optimal iteration, or null if no optimal iteration has been determined.

setOptimalIteration

public void setOptimalIteration(Job optimalIteration)
Specifies the optimal iteration for this optimizing job. This method should only be used by optimization algorithms.

Parameters:
optimalIteration - The job that is the optimal iteration for this optimizing job.

getOptimalIteration

public Job getOptimalIteration()
Retrieves the job that was the optimal iteration for this optimizing job. Note that this may not be accurate if the job has not yet completed.

Returns:
The job that was the optimal iteration for this optimizing job.

schedule

public void schedule()
              throws SLAMDServerException
Causes the first iteration of this optimizing job to be scheduled for execution in the SLAMD server.

Throws:
SLAMDServerException - If a problem occurs while scheduling the optimizing job.

cancel

public void cancel()
            throws SLAMDServerException
Handles the work of cancelling this optimizing job.

Throws:
SLAMDServerException - If a problem occurs while cancelling the job.

pauseRequested

public boolean pauseRequested()
Indicates whether a request has been submitted to pause this optimizing job.

Returns:
true if a request has been made to pause this optimizing job, or false if not.

pauseBeforeNextIteration

public void pauseBeforeNextIteration()
Requests that this optimizing job be paused before its next iteration. If this is done, the next iteration will be disabled when it is scheduled so that it will not automatically start running when the appropriate start time arrives.


cancelPause

public void cancelPause()
Indicates that this optimizing job does not need to be paused before the next iteration.


jobIterationComplete

public void jobIterationComplete(Job jobIteration)
Indicates that one iteration of this optimizing job is complete and that any appropriate action should be taken. If necessary, it will schedule the next iteration. Otherwise, it will indicate that processing is complete.

Parameters:
jobIteration - The job iteration that has completed.

scheduleReRunOfBestIteration

public void scheduleReRunOfBestIteration()
This schedules a second run of the iteration that yielded the best result.


sendJobCompleteNotification

public void sendJobCompleteNotification()
Sends an e-mail message to any configured recipients indicating that the optimization process has completed.


encode

public byte[] encode()
Encodes information about this optimizing job to a byte array suitable for storage in the configuration database.

Returns:
The byte array containing the encoded optimizing job.

decode

public static OptimizingJob decode(SLAMDServer slamdServer,
                                   byte[] encodedOptimizingJob)
                            throws DecodeException
Decodes the provided byte array as an optimizing job.

Parameters:
slamdServer - The SLAMD server with which the optimizing job is associated.
encodedOptimizingJob - The byte array containing the encoded optimizing job.
Returns:
The optimizing job decoded from the provided byte array.
Throws:
DecodeException - If a problem occurs while attempting to decode the provided byte array as an optimizing job.

decodeSummary

public static OptimizingJob decodeSummary(SLAMDServer slamdServer,
                                          byte[] encodedOptimizingJob)
                                   throws DecodeException
Decodes the provided byte array as an optimizing job, but only including summary information.

Parameters:
slamdServer - The SLAMD server with which the optimizing job is associated.
encodedOptimizingJob - The byte array containing the encoded optimizing job.
Returns:
The summary optimizing job decoded from the provided byte array.
Throws:
DecodeException - If a problem occurs while attempting to decode the provided byte array as an optimizing job.

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
Compares this optimizing job with the provided object to determine the relative order of the two in a sorted list. The comparison will be based first by start time, then by optimizing job ID.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - The object to compare with this optimizing job. It must be an OptimizingJob.
Returns:
A negative value if this optimizing job should be ordered before the provided object, a positive value if this optimizing job should be ordered after the provided object, or zero if there is no difference in ordering.
Throws:
java.lang.ClassCastException - If the provided object is not an OptimizingJob.