@Override
 public void processChildNode(String appDirName, String childNodeName, byte[] childData)
     throws com.google.protobuf.InvalidProtocolBufferException {
   if (childNodeName.startsWith(ApplicationId.appIdStrPrefix)) {
     // application
     if (LOG.isDebugEnabled()) {
       LOG.debug("Loading application from node: " + childNodeName);
     }
     ApplicationStateDataPBImpl appState =
         new ApplicationStateDataPBImpl(ApplicationStateDataProto.parseFrom(childData));
     ApplicationId appId = appState.getApplicationSubmissionContext().getApplicationId();
     rmState.appState.put(appId, appState);
   } else if (childNodeName.startsWith(ApplicationAttemptId.appAttemptIdStrPrefix)) {
     // attempt
     if (LOG.isDebugEnabled()) {
       LOG.debug("Loading application attempt from node: " + childNodeName);
     }
     ApplicationAttemptStateDataPBImpl attemptState =
         new ApplicationAttemptStateDataPBImpl(
             ApplicationAttemptStateDataProto.parseFrom(childData));
     attempts.add(attemptState);
   } else {
     LOG.info("Unknown child node with name: " + childNodeName);
   }
 }
Пример #2
0
 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;
 }