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


Java ApplicationId.equals方法代碼示例

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


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

示例1: loadRMAppState

import org.apache.hadoop.yarn.api.records.ApplicationId; //導入方法依賴的package包/類
private synchronized void loadRMAppState(RMState rmState) throws Exception {
  List<String> childNodes = getChildrenWithRetries(rmAppRoot, false);
  for (String childNodeName : childNodes) {
    String childNodePath = getNodePath(rmAppRoot, childNodeName);
    byte[] childData = getDataWithRetries(childNodePath, false);
    if (childNodeName.startsWith(ApplicationId.appIdStrPrefix)) {
      // application
      if (LOG.isDebugEnabled()) {
        LOG.debug("Loading application from znode: " + childNodeName);
      }
      ApplicationId appId = ConverterUtils.toApplicationId(childNodeName);
      ApplicationStateDataPBImpl appState =
          new ApplicationStateDataPBImpl(
              ApplicationStateDataProto.parseFrom(childData));
      if (!appId.equals(
          appState.getApplicationSubmissionContext().getApplicationId())) {
        throw new YarnRuntimeException("The child node name is different " +
            "from the application id");
      }
      rmState.appState.put(appId, appState);
      loadApplicationAttemptState(appState, appId);
    } else {
      LOG.info("Unknown child node with name: " + childNodeName);
    }
  }
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:27,代碼來源:ZKRMStateStore.java

示例2: waitForAppCleanupMessageRecved

import org.apache.hadoop.yarn.api.records.ApplicationId; //導入方法依賴的package包/類
private void waitForAppCleanupMessageRecved(MockNM nm, ApplicationId appId)
    throws Exception {
  while (true) {
    NodeHeartbeatResponse response = nm.nodeHeartbeat(true);
    if (response.getApplicationsToCleanup() != null
        && response.getApplicationsToCleanup().size() == 1
        && appId.equals(response.getApplicationsToCleanup().get(0))) {
      return;
    }

    LOG.info("Haven't got application=" + appId.toString()
        + " in cleanup list from node heartbeat response, "
        + "sleep for a while before next heartbeat");
    Thread.sleep(1000);
  }
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:17,代碼來源:TestApplicationCleanup.java

示例3: authorizeGetAndStopContainerRequest

import org.apache.hadoop.yarn.api.records.ApplicationId; //導入方法依賴的package包/類
@Private
@VisibleForTesting
protected void authorizeGetAndStopContainerRequest(ContainerId containerId,
    Container container, boolean stopRequest, NMTokenIdentifier identifier)
    throws YarnException {
  /*
   * For get/stop container status; we need to verify that 1) User (NMToken)
   * application attempt only has started container. 2) Requested containerId
   * belongs to the same application attempt (NMToken) which was used. (Note:-
   * This will prevent user in knowing another application's containers).
   */
  ApplicationId nmTokenAppId =
      identifier.getApplicationAttemptId().getApplicationId();
  
  if ((!nmTokenAppId.equals(containerId.getApplicationAttemptId().getApplicationId()))
      || (container != null && !nmTokenAppId.equals(container
          .getContainerId().getApplicationAttemptId().getApplicationId()))) {
    if (stopRequest) {
      LOG.warn(identifier.getApplicationAttemptId()
          + " attempted to stop non-application container : "
          + container.getContainerId());
      NMAuditLogger.logFailure("UnknownUser", AuditConstants.STOP_CONTAINER,
        "ContainerManagerImpl", "Trying to stop unknown container!",
        nmTokenAppId, container.getContainerId());
    } else {
      LOG.warn(identifier.getApplicationAttemptId()
          + " attempted to get status for non-application container : "
          + container.getContainerId());
    }
  }
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:32,代碼來源:ContainerManagerImpl.java

示例4: createApplicationState

import org.apache.hadoop.yarn.api.records.ApplicationId; //導入方法依賴的package包/類
private ApplicationStateData createApplicationState(String appIdStr,
    byte[] data) throws IOException {
  ApplicationId appId = ConverterUtils.toApplicationId(appIdStr);
  ApplicationStateDataPBImpl appState =
      new ApplicationStateDataPBImpl(
          ApplicationStateDataProto.parseFrom(data));
  if (!appId.equals(
      appState.getApplicationSubmissionContext().getApplicationId())) {
    throw new YarnRuntimeException("The database entry for " + appId
        + " contains data for "
        + appState.getApplicationSubmissionContext().getApplicationId());
  }
  return appState;
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:15,代碼來源:LeveldbRMStateStore.java


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