• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ApplicationStateDataPBImpl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl的典型用法代码示例。如果您正苦于以下问题:Java ApplicationStateDataPBImpl类的具体用法?Java ApplicationStateDataPBImpl怎么用?Java ApplicationStateDataPBImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ApplicationStateDataPBImpl类属于org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb包,在下文中一共展示了ApplicationStateDataPBImpl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: loadRMAppState

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的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: loadRMAppState

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
private synchronized void loadRMAppState(RMState rmState) throws Exception {
  List<String> childNodes = getChildren(rmAppRoot);
  for (String childNodeName : childNodes) {
    String childNodePath = getNodePath(rmAppRoot, childNodeName);
    byte[] childData = getData(childNodePath);
    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:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:27,代码来源:ZKRMStateStore.java


示例3: storeApplicationState

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
@Override
public synchronized void storeApplicationState(String appId,
    ApplicationStateDataPBImpl appStateDataPB) throws Exception {
  Path appDirPath = getAppDir(rmAppRoot, appId);
  fs.mkdirs(appDirPath);
  Path nodeCreatePath = getNodePath(appDirPath, appId);

  LOG.info("Storing info for app: " + appId + " at: " + nodeCreatePath);
  byte[] appStateData = appStateDataPB.getProto().toByteArray();
  try {
    // currently throw all exceptions. May need to respond differently for HA
    // based on whether we have lost the right to write to FS
    writeFile(nodeCreatePath, appStateData);
  } catch (Exception e) {
    LOG.info("Error storing info for app: " + appId, e);
    throw e;
  }
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:19,代码来源:FileSystemRMStateStore.java


示例4: loadRMAppState

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
private synchronized void loadRMAppState(RMState rmState) throws Exception {
  List<String> childNodes = getChildren(rmAppRoot);
  for (String childNodeName : childNodes) {
    String childNodePath = getNodePath(rmAppRoot, childNodeName);
    byte[] childData = getData(childNodePath);
    if (childNodeName.startsWith(ApplicationId.appIdStrPrefix)) {
      // application
      if (LOG.isDebugEnabled()) {
        LOG.debug("Loading application from znode: " + childNodeName);
      }
      ApplicationId appId = ApplicationId.fromString(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:hopshadoop,项目名称:hops,代码行数:27,代码来源:ZKRMStateStore.java


示例5: updateApplicationStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
@Override
public void updateApplicationStateInternal(ApplicationId appId,
    ApplicationStateDataPBImpl appStateData) throws Exception {
  ApplicationState updatedAppState =
      new ApplicationState(appStateData.getSubmitTime(),
        appStateData.getStartTime(),
        appStateData.getApplicationSubmissionContext(),
        appStateData.getUser(), appStateData.getState(),
        appStateData.getDiagnostics(), appStateData.getFinishTime());
  LOG.info("Updating final state " + appStateData.getState() + " for app: "
      + appId);
  if (state.appState.get(appId) != null) {
    // add the earlier attempts back
    updatedAppState.attempts
      .putAll(state.appState.get(appId).attempts);
  }
  state.appState.put(appId, updatedAppState);
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:19,代码来源:MemoryRMStateStore.java


示例6: storeApplicationStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
@Override
public synchronized void storeApplicationStateInternal(ApplicationId appId,
    ApplicationStateDataPBImpl appStateDataPB) throws Exception {
  String appIdStr = appId.toString();
  Path appDirPath = getAppDir(rmAppRoot, appIdStr);
  fs.mkdirs(appDirPath);
  Path nodeCreatePath = getNodePath(appDirPath, appIdStr);

  LOG.info("Storing info for app: " + appId + " at: " + nodeCreatePath);
  byte[] appStateData = appStateDataPB.getProto().toByteArray();
  try {
    // currently throw all exceptions. May need to respond differently for HA
    // based on whether we have lost the right to write to FS
    writeFile(nodeCreatePath, appStateData);
  } catch (Exception e) {
    LOG.info("Error storing info for app: " + appId, e);
    throw e;
  }
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:20,代码来源:FileSystemRMStateStore.java


示例7: updateApplicationStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
@Override
public synchronized void updateApplicationStateInternal(ApplicationId appId,
    ApplicationStateDataPBImpl appStateDataPB) throws Exception {
  String appIdStr = appId.toString();
  Path appDirPath = getAppDir(rmAppRoot, appIdStr);
  Path nodeCreatePath = getNodePath(appDirPath, appIdStr);

  LOG.info("Updating info for app: " + appId + " at: " + nodeCreatePath);
  byte[] appStateData = appStateDataPB.getProto().toByteArray();
  try {
    // currently throw all exceptions. May need to respond differently for HA
    // based on whether we have lost the right to write to FS
    updateFile(nodeCreatePath, appStateData);
  } catch (Exception e) {
    LOG.info("Error updating info for app: " + appId, e);
    throw e;
  }
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:19,代码来源:FileSystemRMStateStore.java


示例8: createApplicationState

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的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


示例9: processChildNode

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
@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);
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:31,代码来源:FileSystemRMStateStore.java


示例10: loadRMAppState

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
private synchronized void loadRMAppState(RMState rmState) throws Exception {
  List<String> childNodes = getChildrenWithRetries(rmAppRoot, true);
  for (String childNodeName : childNodes) {
    String childNodePath = getNodePath(rmAppRoot, childNodeName);
    byte[] childData = getDataWithRetries(childNodePath, true);
    if (childNodeName.startsWith(ApplicationId.appIdStrPrefix)) {
      // application
      if (LOG.isDebugEnabled()) {
        LOG.debug("Loading application from znode: " + childNodeName);
      }
      ApplicationId appId = ConverterUtils.toApplicationId(childNodeName);
      ApplicationStateDataPBImpl appStateData =
          new ApplicationStateDataPBImpl(
              ApplicationStateDataProto.parseFrom(childData));
      ApplicationState appState =
          new ApplicationState(appStateData.getSubmitTime(),
            appStateData.getStartTime(),
            appStateData.getApplicationSubmissionContext(),
            appStateData.getUser(),
            appStateData.getState(),
            appStateData.getDiagnostics(), appStateData.getFinishTime());
      if (!appId.equals(appState.context.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:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:33,代码来源:ZKRMStateStore.java


示例11: storeApplicationState

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
@Override
public void storeApplicationState(String appId, 
                                   ApplicationStateDataPBImpl appStateData)
    throws Exception {
  ApplicationState appState = new ApplicationState(
      appStateData.getSubmitTime(),
      appStateData.getApplicationSubmissionContext(), appStateData.getUser());
  if (state.appState.containsKey(appState.getAppId())) {
    Exception e = new IOException("App: " + appId + " is already stored.");
    LOG.info("Error storing info for app: " + appId, e);
    throw e;
  }
  state.appState.put(appState.getAppId(), appState);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:15,代码来源:MemoryRMStateStore.java


示例12: createApplicationState

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
private ApplicationStateData createApplicationState(String appIdStr,
    byte[] data) throws IOException {
  ApplicationId appId = ApplicationId.fromString(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:hopshadoop,项目名称:hops,代码行数:15,代码来源:LeveldbRMStateStore.java


示例13: createApplicationState

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
private ApplicationStateData createApplicationState(String appIdStr,
        byte[] data) throws IOException {
  ApplicationId appId = ConverterUtils.toApplicationId(appIdStr);
  ApplicationStateDataPBImpl appState = new ApplicationStateDataPBImpl(
          YarnServerResourceManagerRecoveryProtos.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:hopshadoop,项目名称:hops,代码行数:15,代码来源:DBRMStateStore.java


示例14: storeApplicationStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
@Override
public synchronized void storeApplicationStateInternal(ApplicationId appId,
    ApplicationStateDataPBImpl appStateDataPB) throws Exception {
  String nodeCreatePath = getNodePath(rmAppRoot, appId.toString());

  if (LOG.isDebugEnabled()) {
    LOG.debug("Storing info for app: " + appId + " at: " + nodeCreatePath);
  }
  byte[] appStateData = appStateDataPB.getProto().toByteArray();
  createWithRetries(nodeCreatePath, appStateData, zkAcl,
    CreateMode.PERSISTENT);

}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:14,代码来源:ZKRMStateStore.java


示例15: updateApplicationStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
@Override
public synchronized void updateApplicationStateInternal(ApplicationId appId,
    ApplicationStateDataPBImpl appStateDataPB) throws Exception {
  String nodeUpdatePath = getNodePath(rmAppRoot, appId.toString());

  if (LOG.isDebugEnabled()) {
    LOG.debug("Storing final state info for app: " + appId + " at: "
        + nodeUpdatePath);
  }
  byte[] appStateData = appStateDataPB.getProto().toByteArray();
  setDataWithRetries(nodeUpdatePath, appStateData, 0);
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:13,代码来源:ZKRMStateStore.java


示例16: storeApplicationStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
@Override
public void storeApplicationStateInternal(ApplicationId appId,
                                   ApplicationStateDataPBImpl appStateData)
    throws Exception {
  ApplicationState appState =
      new ApplicationState(appStateData.getSubmitTime(),
        appStateData.getStartTime(),
        appStateData.getApplicationSubmissionContext(),
        appStateData.getUser());
  state.appState.put(appId, appState);
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:12,代码来源:MemoryRMStateStore.java


示例17: storeApplicationState

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
@Override
protected void storeApplicationState(String appId,
    ApplicationStateDataPBImpl appStateData) throws Exception {
  // Do nothing
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:6,代码来源:NullRMStateStore.java


示例18: updateApplicationStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
protected abstract void updateApplicationStateInternal(ApplicationId appId,
ApplicationStateDataPBImpl appStateData) throws Exception;
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:3,代码来源:RMStateStore.java


示例19: storeApplicationStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
@Override
protected void storeApplicationStateInternal(ApplicationId appId,
    ApplicationStateDataPBImpl appStateData) throws Exception {
  // Do nothing
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:6,代码来源:NullRMStateStore.java


示例20: updateApplicationStateInternal

import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl; //导入依赖的package包/类
@Override
protected void updateApplicationStateInternal(ApplicationId appId,
    ApplicationStateDataPBImpl appStateData) throws Exception {
  // Do nothing 
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:6,代码来源:NullRMStateStore.java



注:本文中的org.apache.hadoop.yarn.server.resourcemanager.recovery.records.impl.pb.ApplicationStateDataPBImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Step类代码示例发布时间:2022-05-22
下一篇:
Java ImportDeclaration类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap