當前位置: 首頁>>代碼示例>>Java>>正文


Java ApplicationAttemptId.equals方法代碼示例

本文整理匯總了Java中org.apache.hadoop.yarn.api.records.ApplicationAttemptId.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java ApplicationAttemptId.equals方法的具體用法?Java ApplicationAttemptId.equals怎麽用?Java ApplicationAttemptId.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.hadoop.yarn.api.records.ApplicationAttemptId的用法示例。


在下文中一共展示了ApplicationAttemptId.equals方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: unreserveResource

import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; //導入方法依賴的package包/類
@Override
public synchronized void unreserveResource(
    SchedulerApplicationAttempt application) {
  // Cannot unreserve for wrong application...
  ApplicationAttemptId reservedApplication = 
      getReservedContainer().getContainer().getId().getApplicationAttemptId(); 
  if (!reservedApplication.equals(
      application.getApplicationAttemptId())) {
    throw new IllegalStateException("Trying to unreserve " +  
        " for application " + application.getApplicationId() + 
        " when currently reserved " + 
        " for application " + reservedApplication.getApplicationId() + 
        " on node " + this);
  }
  
  setReservedContainer(null);
  this.reservedAppSchedulable = null;
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:19,代碼來源:FSSchedulerNode.java

示例2: unreserveResource

import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; //導入方法依賴的package包/類
@Override
public synchronized void unreserveResource(
    SchedulerApplicationAttempt application) {

  // adding NP checks as this can now be called for preemption
  if (getReservedContainer() != null
      && getReservedContainer().getContainer() != null
      && getReservedContainer().getContainer().getId() != null
      && getReservedContainer().getContainer().getId()
        .getApplicationAttemptId() != null) {

    // Cannot unreserve for wrong application...
    ApplicationAttemptId reservedApplication =
        getReservedContainer().getContainer().getId()
          .getApplicationAttemptId();
    if (!reservedApplication.equals(
        application.getApplicationAttemptId())) {
      throw new IllegalStateException("Trying to unreserve " +
          " for application " + application.getApplicationAttemptId() +
          " when currently reserved " +
          " for application " + reservedApplication.getApplicationId() +
          " on node " + this);
    }
  }
  setReservedContainer(null);
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:27,代碼來源:FiCaSchedulerNode.java

示例3: validateContainerReleaseRequest

import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; //導入方法依賴的package包/類
/**
 * It will validate to make sure all the containers belong to correct
 * application attempt id. If not then it will throw
 * {@link InvalidContainerReleaseException}
 * 
 * @param containerReleaseList
 *          containers to be released as requested by application master.
 * @param appAttemptId
 *          Application attempt Id
 * @throws InvalidContainerReleaseException
 */
public static void
    validateContainerReleaseRequest(List<ContainerId> containerReleaseList,
        ApplicationAttemptId appAttemptId)
        throws InvalidContainerReleaseException {
  for (ContainerId cId : containerReleaseList) {
    if (!appAttemptId.equals(cId.getApplicationAttemptId())) {
      throw new InvalidContainerReleaseException(
          "Cannot release container : "
              + cId.toString()
              + " not belonging to this application attempt : "
              + appAttemptId);
    }
  }
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:26,代碼來源:RMServerUtils.java

示例4: createAttemptState

import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; //導入方法依賴的package包/類
private ApplicationAttemptStateData createAttemptState(String itemName,
    byte[] data) throws IOException {
  ApplicationAttemptId attemptId =
      ConverterUtils.toApplicationAttemptId(itemName);
  ApplicationAttemptStateDataPBImpl attemptState =
      new ApplicationAttemptStateDataPBImpl(
          ApplicationAttemptStateDataProto.parseFrom(data));
  if (!attemptId.equals(attemptState.getAttemptId())) {
    throw new YarnRuntimeException("The database entry for " + attemptId
        + " contains data for " + attemptState.getAttemptId());
  }
  return attemptState;
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:14,代碼來源:LeveldbRMStateStore.java


注:本文中的org.apache.hadoop.yarn.api.records.ApplicationAttemptId.equals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。