public class InstanceDeployer extends java.lang.Object implements JobLifecycleObserver
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MODULE |
| Constructor and Description |
|---|
InstanceDeployer() |
| Modifier and Type | Method and Description |
|---|---|
void |
completedExecution(java.lang.String jobIdentifier,
java.lang.String taskIdentifier,
TaskLifecycleMetrics taskLifecycleMetrics)
This method is invoked when a task has completed execution either
successfully or due to an abnormal termination or previously issued abort
request.
|
void |
completedSuccessfully(java.lang.String jobIdentifier,
ProgressTracker progressTracker)
This method is invoked when all the constituent distributed tasks have
finished executing successfully.
|
void |
completedWithErrors(java.lang.String jobIdentifier,
ProgressTracker progressTracker)
This method is invoked when we have heard from all the sub-tasks, and one
or more errors have been encountered in the execution of constituent
tasks.
|
java.lang.String |
createJobIdentifier()
Create a Job Identifier.
|
ProgressTracker |
deployOperations(Operation[] operations)
This method deploys a set of operations on a specified number of
resources.
|
ProgressTracker |
deployOperations(Operation[] operations,
int numOfResources,
java.lang.String jobIdentifier)
This method deploys a set of operations on a specified number of
resources.
|
ProgressTracker |
deployOperations(Operation[] operations,
java.lang.String jobIdentifier)
This method deploys a set of operations on the set of available
resources.
|
java.lang.String |
getStatus()
Returns the status of all Jobs that have been submitted from this node in
question.
|
void |
initialize(java.util.Properties streamingProperties)
This initializes the deployer based on the specified argument.
|
void |
initialize(java.util.Properties streamingProperties,
java.lang.String commType)
This initializes the deployer based on the specified arguments.
|
void |
initialize(java.lang.String configurationFile,
int entityId,
java.util.Properties props,
java.lang.String commType)
This initializes the deployer based on the specified arguments.
|
void |
killJob(java.lang.String jobIdentifier)
Kill a Job with specified jobIdentifer
|
void |
refreshStatus(java.lang.String jobIdentifier)
This method refreshes the status of various tasks that comprise a Job.
|
void |
refreshStatus(java.lang.String jobIdentifier,
java.lang.String taskIdentifier)
This method refreshes the status of a specific task that is part of the
Job in question.
|
void |
resetTrackers()
Resets the task completion counts maintained by this class.
|
void |
setStartTime()
Resets the start timer which tracks the time at which an application
began execution.
|
void |
startedExecution(java.lang.String jobIdentifier,
java.lang.String taskIdentifier,
TaskLifecycleMetrics taskLifecycleMetrics)
This method is invoked when the first task reports that it has
begun execution.
|
public static final java.lang.String MODULE
public void setStartTime()
public void resetTrackers()
public java.lang.String createJobIdentifier()
public void initialize(java.util.Properties streamingProperties)
throws CommunicationsException,
java.io.IOException,
MarshallingException,
DeploymentException
streamingProperties - The properties for streamingCommunicationsException - If there are problems during network communications.java.io.IOException - If there are IO problems.MarshallingException - If there are problems marshalling the requests.DeploymentException - If no resources are available.public void initialize(java.util.Properties streamingProperties,
java.lang.String commType)
throws CommunicationsException,
java.io.IOException,
MarshallingException,
DeploymentException
streamingProperties - The properties for streamingcommType - The communications typeCommunicationsException - If there are problems during network communications.java.io.IOException - If there are IO problems.MarshallingException - If there are problems marshalling the requests.DeploymentException - If no resources are available.public void initialize(java.lang.String configurationFile,
int entityId,
java.util.Properties props,
java.lang.String commType)
throws CommunicationsException,
java.io.IOException,
MarshallingException,
DeploymentException
configurationFile - The configuration fileentityId - The ID for the entityprops - The properties for streamingcommType - The communications typeCommunicationsException - If there are problems during network communications.java.io.IOException - If there are IO problems.MarshallingException - If there are problems marshalling the requests.DeploymentException - If no resources are available.public ProgressTracker deployOperations(Operation[] operations) throws CommunicationsException, DeploymentException, MarshallingException
operations - The set of operations that need to be deployed.CommunicationsException - If there are problems during network communications.DeploymentException - If there are deployment related exceptions that are reported. One
reason why this might happen is if the number of requested resources
exceeds the number of available resources.MarshallingException - If there are problems marshalling the requests.public ProgressTracker deployOperations(Operation[] operations, java.lang.String jobIdentifier) throws CommunicationsException, DeploymentException, MarshallingException
jobIdentifier argument.operations - The set of operations that need to be deployed.jobIdentifier - The identifier that groups these operations together.CommunicationsException - If there are problems during network communications.DeploymentException - If there are deployment related exceptions that are reported. One
reason why this might happen is if the number of requested resources
exceeds the number of available resources.MarshallingException - If there are problems marshalling the requests.public ProgressTracker deployOperations(Operation[] operations, int numOfResources, java.lang.String jobIdentifier) throws CommunicationsException, DeploymentException, MarshallingException
jobIdentifier argument.operations - The set of operations that need to be deployed.numOfResources - The number of resources on which this needs to be deployed.jobIdentifier - The identifier that groups these operations together.CommunicationsException - If there are problems during network communications.DeploymentException - If there are deployment related exceptions that are reported. One
reason why this might happen is if the number of requested resources
exceeds the number of available resources.MarshallingException - If there are problems marshalling the requests.public java.lang.String getStatus()
public void refreshStatus(java.lang.String jobIdentifier)
throws CommunicationsException,
DeploymentException,
MarshallingException
jobIdentifier - The ID of the Job that needs to refreshed.CommunicationsException - If there are problems during network communications.DeploymentException - If there are deployment related exceptions that are reportedMarshallingException - If there are problems marshalling the requests.public void refreshStatus(java.lang.String jobIdentifier,
java.lang.String taskIdentifier)
throws CommunicationsException,
DeploymentException,
MarshallingException
jobIdentifier - The ID of the Job that needs to refreshed.taskIdentifier - The ID of the Task that needs to refreshed.CommunicationsException - If there are problems during network communications.DeploymentException - If there are deployment related exceptions that are reportedMarshallingException - If there are problems marshalling the requests.public void killJob(java.lang.String jobIdentifier)
throws DeploymentException,
CommunicationsException,
MarshallingException
jobIdentifier - The ID of the Job that needs to be terminatedDeploymentException - If there are deployment related exceptions that are reportedCommunicationsException - If there are problems during network communications.MarshallingException - If there are problems marshalling the request.public void completedExecution(java.lang.String jobIdentifier,
java.lang.String taskIdentifier,
TaskLifecycleMetrics taskLifecycleMetrics)
JobLifecycleObservertaskLifecycleMetrics.getExecutionStatus() method and
comparing it to the constants in the metrics, reveals the completion
status of the task.completedExecution in interface JobLifecycleObserverjobIdentifier - The ID of the Job being reported ontaskIdentifier - The taskId of one of the constituent taskstaskLifecycleMetrics - The metrics associated with the task in question.public void completedSuccessfully(java.lang.String jobIdentifier,
ProgressTracker progressTracker)
JobLifecycleObservercompletedSuccessfully in interface JobLifecycleObserverjobIdentifier - The ID of the Job being reported onprogressTracker - Contains information about the lifecycle metrics associated
with the constituent tasks.public void completedWithErrors(java.lang.String jobIdentifier,
ProgressTracker progressTracker)
JobLifecycleObservercompletedWithErrors in interface JobLifecycleObserverjobIdentifier - The ID of the Job being reported onprogressTracker - Contains information about the lifecycle metrics associated
with the constituent tasks.public void startedExecution(java.lang.String jobIdentifier,
java.lang.String taskIdentifier,
TaskLifecycleMetrics taskLifecycleMetrics)
JobLifecycleObserverstartedExecution in interface JobLifecycleObserverjobIdentifier - The ID of the Job being reported ontaskIdentifier - The taskId of one of the constituent tasks that has started
execution.taskLifecycleMetrics - The metrics associated with the task in question.