org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore.getChildren()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore.getChildren()方法的一些代码示例,展示了ZKRMStateStore.getChildren()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKRMStateStore.getChildren()方法的具体详情如下:
包路径:org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore
类名称:ZKRMStateStore
方法名:getChildren

ZKRMStateStore.getChildren介绍

暂无

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Override
protected synchronized void removeReservationState(String planName,
  String reservationIdName) throws Exception {
 String planNodePath = getNodePath(reservationRoot, planName);
 String reservationPath = getNodePath(planNodePath, reservationIdName);
 if (LOG.isDebugEnabled()) {
  LOG.debug("Removing reservationallocation " + reservationIdName
    + " for" + " plan " + planName);
 }
 zkManager.safeDelete(reservationPath, zkAcl, fencingNodePath);
 List<String> reservationNodes = getChildren(planNodePath);
 if (reservationNodes.isEmpty()) {
  zkManager.safeDelete(planNodePath, zkAcl, fencingNodePath);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

continue;
List<String> childNodes = getChildren(tokenRoot);
boolean dtNodeFound = false;
for (String childNodeName : childNodes) {
  } else {
   List<String> leafNodes = getChildren(parentNodePath);
   for (String leafNodeName : leafNodes) {
    loadDelegationTokenFromNode(rmState,

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

List<String> children = null;
try {
 children = getChildren(parentZnode);
} catch (KeeperException.NoNodeException ke) {

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

private void loadApplicationAttemptState(ApplicationStateData appState,
  String appPath) throws Exception {
 List<String> attempts = getChildren(appPath);
 for (String attemptIDStr : attempts) {
  if (attemptIDStr.startsWith(ApplicationAttemptId.appAttemptIdStrPrefix)) {
   String attemptPath = getNodePath(appPath, attemptIDStr);
   byte[] attemptData = getData(attemptPath);
   ApplicationAttemptStateDataPBImpl attemptState =
     new ApplicationAttemptStateDataPBImpl(
       ApplicationAttemptStateDataProto.parseFrom(attemptData));
   appState.attempts.put(attemptState.getAttemptId(), attemptState);
  }
 }
 LOG.debug("Done loading applications from ZK state store");
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

continue;
List<String> childNodes = getChildren(appRoot);
boolean appNodeFound = false;
for (String childNodeName : childNodes) {
   List<String> leafNodes = getChildren(parentNodePath);
   for (String leafNodeName : leafNodes) {
    String appIdStr = childNodeName + leafNodeName;

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

private void loadReservationSystemState(RMState rmState) throws Exception {
 List<String> planNodes = getChildren(reservationRoot);
 for (String planName : planNodes) {
  if (LOG.isDebugEnabled()) {
   LOG.debug("Loading plan from znode: " + planName);
  }
  String planNodePath = getNodePath(reservationRoot, planName);
  List<String> reservationNodes = getChildren(planNodePath);
  for (String reservationNodeName : reservationNodes) {
   String reservationNodePath =
     getNodePath(planNodePath, reservationNodeName);
   if (LOG.isDebugEnabled()) {
    LOG.debug("Loading reservation from znode: " + reservationNodePath);
   }
   byte[] reservationData = getData(reservationNodePath);
   ReservationAllocationStateProto allocationState =
     ReservationAllocationStateProto.parseFrom(reservationData);
   if (!rmState.getReservationState().containsKey(planName)) {
    rmState.getReservationState().put(planName, new HashMap<>());
   }
   ReservationId reservationId =
     ReservationId.parseReservationId(reservationNodeName);
   rmState.getReservationState().get(planName).put(reservationId,
     allocationState);
  }
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

private void loadRMDelegationKeyState(RMState rmState) throws Exception {
 List<String> childNodes = getChildren(dtMasterKeysRootPath);
 for (String childNodeName : childNodes) {
  String childNodePath = getNodePath(dtMasterKeysRootPath, childNodeName);
  byte[] childData = getData(childNodePath);
  if (childData == null) {
   LOG.warn("Content of " + childNodePath + " is broken.");
   continue;
  }
  ByteArrayInputStream is = new ByteArrayInputStream(childData);
  try (DataInputStream fsIn = new DataInputStream(is)) {
   if (childNodeName.startsWith(DELEGATION_KEY_PREFIX)) {
    DelegationKey key = new DelegationKey();
    key.readFields(fsIn);
    rmState.rmSecretManagerState.masterKeyState.add(key);
    if (LOG.isDebugEnabled()) {
     LOG.debug("Loaded delegation key: keyId=" + key.getKeyId()
       + ", expirationDate=" + key.getExpiryDate());
    }
   }
  }
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

private static void assertHierarchicalPaths(RMStateStore store,
  Map<Integer, Integer> pathToApps) throws Exception {
 for (Map.Entry<Integer, Integer> entry : pathToApps.entrySet()) {
  String path = createPath(((ZKRMStateStore)store).znodeWorkingPath,
    ZKRMStateStore.ROOT_ZNODE_NAME, ZKRMStateStore.RM_APP_ROOT);
  if (entry.getKey() != 0) {
   path = createPath(path, ZKRMStateStore.RM_APP_ROOT_HIERARCHIES,
     String.valueOf(entry.getKey()));
  }
  assertEquals("Number of childrens for path " + path,
    (int) entry.getValue(),
    ((ZKRMStateStore)store).getChildren(path).size());
 }
}

相关文章

微信公众号

最新文章

更多