コード例 #1
0
ファイル: ContainerImpl.java プロジェクト: ericsonyc/Projects
  @Override
  public void handle(ContainerEvent event) {
    try {
      this.writeLock.lock();

      ContainerId containerID = event.getContainerID();
      LOG.debug("Processing " + containerID + " of type " + event.getType());

      ContainerState oldState = stateMachine.getCurrentState();
      ContainerState newState = null;
      try {
        newState = stateMachine.doTransition(event.getType(), event);
      } catch (InvalidStateTransitonException e) {
        LOG.warn(
            "Can't handle this event at current state: Current: ["
                + oldState
                + "], eventType: ["
                + event.getType()
                + "]",
            e);
      }
      if (oldState != newState) {
        LOG.info("Container " + containerID + " transitioned from " + oldState + " to " + newState);
      }
    } finally {
      this.writeLock.unlock();
    }
  }
コード例 #2
0
ファイル: Query.java プロジェクト: hyunsik/incubator-tajo
 public QueryState getState() {
   readLock.lock();
   try {
     return stateMachine.getCurrentState();
   } finally {
     readLock.unlock();
   }
 }
コード例 #3
0
ファイル: ContainerImpl.java プロジェクト: ericsonyc/Projects
 @Override
 public ContainerState getContainerState() {
   this.readLock.lock();
   try {
     return stateMachine.getCurrentState();
   } finally {
     this.readLock.unlock();
   }
 }
コード例 #4
0
 @VisibleForTesting
 public TaskStateInternal getInternalState() {
   readLock.lock();
   try {
     return stateMachine.getCurrentState();
   } finally {
     readLock.unlock();
   }
 }
コード例 #5
0
ファイル: ContainerImpl.java プロジェクト: ericsonyc/Projects
 public org.apache.hadoop.yarn.api.records.ContainerState getCurrentState() {
   switch (stateMachine.getCurrentState()) {
     case NEW:
     case LOCALIZING:
     case LOCALIZATION_FAILED:
     case LOCALIZED:
     case RUNNING:
     case EXITED_WITH_SUCCESS:
     case EXITED_WITH_FAILURE:
     case KILLING:
     case CONTAINER_CLEANEDUP_AFTER_KILL:
     case CONTAINER_RESOURCES_CLEANINGUP:
       return org.apache.hadoop.yarn.api.records.ContainerState.RUNNING;
     case DONE:
     default:
       return org.apache.hadoop.yarn.api.records.ContainerState.COMPLETE;
   }
 }