public class InstanceDeployer extends Object implements JobLifecycleObserver, Deployer
Constructor and Description |
---|
InstanceDeployer() |
Modifier and Type | Method and Description |
---|---|
void |
completedExecution(String jobIdentifier,
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(String jobIdentifier,
ProgressTracker progressTracker)
This method is invoked when all the constituent distributed tasks have
finished executing successfully.
|
void |
completedWithErrors(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.
|
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,
String jobIdentifier)
This method deploys a set of operations on a specified number of
resources.
|
ProgressTracker |
deployOperations(Operation[] operations,
String jobIdentifier)
This method deploys a set of operations on the set of available
resources.
|
String |
getStatus()
Returns the status of all Jobs that have been submitted from this node in
question.
|
void |
initialize(Properties streamingProperties)
This initializes the deployer based on the specified argument.
|
void |
initialize(Properties streamingProperties,
String commType)
This initializes the deployer based on the specified arguments.
|
void |
initialize(String configurationFile,
int entityId,
Properties props,
String commType)
This initializes the deployer based on the specified arguments.
|
void |
killJob(String jobIdentifier)
Kill a Job with specified jobIdentifer
|
void |
refreshStatus(String jobIdentifier)
This method refreshes the status of various tasks that comprise a Job.
|
void |
refreshStatus(String jobIdentifier,
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(String jobIdentifier,
String taskIdentifier,
TaskLifecycleMetrics taskLifecycleMetrics)
This method is invoked when the first task reports that it has
begun execution.
|
public static final String MODULE
public void setStartTime()
public void resetTrackers()
public String createJobIdentifier()
public void initialize(Properties streamingProperties) throws CommunicationsException, IOException, MarshallingException, DeploymentException
initialize
in interface Deployer
streamingProperties
- The properties for streamingCommunicationsException
- If there are problems during network communications.IOException
- If there are IO problems.MarshallingException
- If there are problems marshalling the requests.DeploymentException
- If no resources are available.public void initialize(Properties streamingProperties, String commType) throws CommunicationsException, IOException, MarshallingException, DeploymentException
streamingProperties
- The properties for streamingcommType
- The communications typeCommunicationsException
- If there are problems during network communications.IOException
- If there are IO problems.MarshallingException
- If there are problems marshalling the requests.DeploymentException
- If no resources are available.public void initialize(String configurationFile, int entityId, Properties props, String commType) throws CommunicationsException, 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.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
deployOperations
in interface Deployer
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, 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, 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 String getStatus()
public void refreshStatus(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(String jobIdentifier, 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(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(String jobIdentifier, String taskIdentifier, TaskLifecycleMetrics taskLifecycleMetrics)
JobLifecycleObserver
taskLifecycleMetrics.getExecutionStatus()
method and
comparing it to the constants in the metrics, reveals the completion
status of the task.completedExecution
in interface JobLifecycleObserver
jobIdentifier
- 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(String jobIdentifier, ProgressTracker progressTracker)
JobLifecycleObserver
completedSuccessfully
in interface JobLifecycleObserver
jobIdentifier
- The ID of the Job being reported onprogressTracker
- Contains information about the lifecycle metrics associated
with the constituent tasks.public void completedWithErrors(String jobIdentifier, ProgressTracker progressTracker)
JobLifecycleObserver
completedWithErrors
in interface JobLifecycleObserver
jobIdentifier
- The ID of the Job being reported onprogressTracker
- Contains information about the lifecycle metrics associated
with the constituent tasks.public void startedExecution(String jobIdentifier, String taskIdentifier, TaskLifecycleMetrics taskLifecycleMetrics)
JobLifecycleObserver
startedExecution
in interface JobLifecycleObserver
jobIdentifier
- 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.Copyright © 2015. All rights reserved.