public TaskSubmissionResult startTask ( ) { final AllocatedResource ar = this . allocatedResource . get ( ) ; if ( ar == null ) { final TaskSubmissionResult result = new TaskSubmissionResult ( getID ( ) , AbstractTaskResult . ReturnCode . NO_INSTANCE ) ; result . setDescription ( "Assigned instance of vertex " + this . toString ( ) + " is null!" ) ; return result ; } final List < TaskDeploymentDescriptor > tasks = new SerializableArrayList < TaskDeploymentDescriptor > ( ) ; tasks . add ( constructDeploymentDescriptor ( ) ) ; try { final List < TaskSubmissionResult > results = ar . getInstance ( ) . submitTasks ( tasks ) ; return results . get ( 0 ) ; } catch ( IOException e ) { final TaskSubmissionResult result = new TaskSubmissionResult ( getID ( ) , AbstractTaskResult . ReturnCode . IPC_ERROR ) ; result . setDescription ( StringUtils . stringifyException ( e ) ) ; return result ; } }
Deploys and starts the task represented by this vertex on the assigned instance .