gpt4 book ai didi

org.apache.hadoop.hbase.zookeeper.ZKSplitLog.isRescanNode()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 02:43:31 26 4
gpt4 key购买 nike

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

ZKSplitLog.isRescanNode介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

private void deleteNodeSuccess(String path) {
 if (ignoreZKDeleteForTesting) {
  return;
 }
 Task task;
 task = details.getTasks().remove(path);
 if (task == null) {
  if (ZKSplitLog.isRescanNode(watcher, path)) {
   SplitLogCounters.tot_mgr_rescan_deleted.increment();
  }
  SplitLogCounters.tot_mgr_missing_state_in_delete.increment();
  LOG.debug("Deleted task without in memory state " + path);
  return;
 }
 synchronized (task) {
  task.status = DELETED;
  task.notify();
 }
 SplitLogCounters.tot_mgr_task_deleted.increment();
}

代码示例来源:origin: apache/hbase

@Override
public int remainingTasksInCoordination() {
 int count = 0;
 try {
  List<String> tasks = ZKUtil.listChildrenNoWatch(watcher,
      watcher.getZNodePaths().splitLogZNode);
  if (tasks != null) {
   int listSize = tasks.size();
   for (int i = 0; i < listSize; i++) {
    if (!ZKSplitLog.isRescanNode(tasks.get(i))) {
     count++;
    }
   }
  }
 } catch (KeeperException ke) {
  LOG.warn("Failed to check remaining tasks", ke);
  count = -1;
 }
 return count;
}

代码示例来源:origin: apache/hbase

private void setDone(String path, TerminationStatus status) {
 Task task = details.getTasks().get(path);
 if (task == null) {
  if (!ZKSplitLog.isRescanNode(watcher, path)) {
   SplitLogCounters.tot_mgr_unacquired_orphan_done.increment();
   LOG.debug("Unacquired orphan task is done " + path);

代码示例来源:origin: apache/hbase

/**
 * It is possible for a task to stay in UNASSIGNED state indefinitely - say SplitLogManager wants
 * to resubmit a task. It forces the task to UNASSIGNED state but it dies before it could create
 * the RESCAN task node to signal the SplitLogWorkers to pick up the task. To prevent this
 * scenario the SplitLogManager resubmits all orphan and UNASSIGNED tasks at startup.
 * @param path
 */
private void handleUnassignedTask(String path) {
 if (ZKSplitLog.isRescanNode(watcher, path)) {
  return;
 }
 Task task = findOrCreateOrphanTask(path);
 if (task.isOrphan() && (task.incarnation.get() == 0)) {
  LOG.info("Resubmitting unassigned orphan task " + path);
  // ignore failure to resubmit. The timeout-monitor will handle it later
  // albeit in a more crude fashion
  resubmitTask(path, task, FORCE);
 }
}

代码示例来源:origin: apache/hbase

@Override
public void nodeDataChanged(String path) {
 Task task;
 task = details.getTasks().get(path);
 if (task != null || ZKSplitLog.isRescanNode(watcher, path)) {
  if (task != null) {
   task.heartbeatNoDetails(EnvironmentEdgeManager.currentTime());
  }
  getDataSetWatch(path, zkretries);
 }
}

代码示例来源:origin: apache/hbase

private void lookForOrphans() {
 List<String> orphans;
 try {
  orphans = ZKUtil.listChildrenNoWatch(this.watcher,
      this.watcher.getZNodePaths().splitLogZNode);
  if (orphans == null) {
   LOG.warn("Could not get children of " + this.watcher.getZNodePaths().splitLogZNode);
   return;
  }
 } catch (KeeperException e) {
  LOG.warn("Could not get children of " + this.watcher.getZNodePaths().splitLogZNode + " "
    + StringUtils.stringifyException(e));
  return;
 }
 int rescan_nodes = 0;
 int listSize = orphans.size();
 for (int i = 0; i < listSize; i++) {
  String path = orphans.get(i);
  String nodepath = ZNodePaths.joinZNode(watcher.getZNodePaths().splitLogZNode, path);
  if (ZKSplitLog.isRescanNode(watcher, nodepath)) {
   rescan_nodes++;
   LOG.debug("Found orphan rescan node " + path);
  } else {
   LOG.info("Found orphan task " + path);
  }
  getDataSetWatch(nodepath, zkretries);
 }
 LOG.info("Found " + (orphans.size() - rescan_nodes) + " orphan tasks and " + rescan_nodes
   + " rescan nodes");
}

代码示例来源:origin: apache/hbase

if (ZKSplitLog.isRescanNode(watcher, currentTask)) {
 ZkSplitLogWorkerCoordination.ZkSplitTaskDetails splitTaskDetails =
   new ZkSplitLogWorkerCoordination.ZkSplitTaskDetails();

代码示例来源:origin: apache/hbase

} else if (slt.isDone()) {
 LOG.info("Task " + path + " entered state=" + slt.toString());
 if (taskFinisher != null && !ZKSplitLog.isRescanNode(watcher, path)) {
  if (taskFinisher.finish(slt.getServerName(), ZKSplitLog.getFileName(path)) == Status.DONE) {
   setDone(path, SUCCESS);

代码示例来源:origin: co.cask.hbase/hbase

private void deleteNodeSuccess(String path) {
 if (ignoreZKDeleteForTesting) {
  return;
 }
 Task task;
 task = tasks.remove(path);
 if (task == null) {
  if (ZKSplitLog.isRescanNode(watcher, path)) {
   tot_mgr_rescan_deleted.incrementAndGet();
  }
  tot_mgr_missing_state_in_delete.incrementAndGet();
  LOG.debug("deleted task without in memory state " + path);
  return;
 }
 synchronized (task) {
  task.status = DELETED;
  task.notify();
 }
 tot_mgr_task_deleted.incrementAndGet();
}

代码示例来源:origin: harbby/presto-connectors

private List<String> listSplitLogTasks() throws KeeperException {
 List<String> taskOrRescanList = ZKUtil.listChildrenNoWatch(watcher, watcher.splitLogZNode);
 if (taskOrRescanList == null || taskOrRescanList.isEmpty()) {
  return Collections.<String> emptyList();
 }
 List<String> taskList = new ArrayList<String>();
 for (String taskOrRescan : taskOrRescanList) {
  // Remove rescan nodes
  if (!ZKSplitLog.isRescanNode(taskOrRescan)) {
   taskList.add(taskOrRescan);
  }
 }
 return taskList;
}

代码示例来源:origin: co.cask.hbase/hbase

private int remainingTasksInZK() {
 int count = 0;
 try {
  List<String> tasks =
   ZKUtil.listChildrenNoWatch(watcher, watcher.splitLogZNode);
  if (tasks != null) {
   for (String t: tasks) {
    if (!ZKSplitLog.isRescanNode(watcher, t)) {
     count++;
    }
   }
  }
 } catch (KeeperException ke) {
  LOG.warn("Failed to check remaining tasks", ke);
  count = -1;
 }
 return count;
}

代码示例来源:origin: harbby/presto-connectors

private void deleteNodeSuccess(String path) {
 if (ignoreZKDeleteForTesting) {
  return;
 }
 Task task;
 task = details.getTasks().remove(path);
 if (task == null) {
  if (ZKSplitLog.isRescanNode(watcher, path)) {
   SplitLogCounters.tot_mgr_rescan_deleted.incrementAndGet();
  }
  SplitLogCounters.tot_mgr_missing_state_in_delete.incrementAndGet();
  LOG.debug("deleted task without in memory state " + path);
  return;
 }
 synchronized (task) {
  task.status = DELETED;
  task.notify();
 }
 SplitLogCounters.tot_mgr_task_deleted.incrementAndGet();
}

代码示例来源:origin: co.cask.hbase/hbase

private void setDone(String path, TerminationStatus status) {
 Task task = tasks.get(path);
 if (task == null) {
  if (!ZKSplitLog.isRescanNode(watcher, path)) {
   tot_mgr_unacquired_orphan_done.incrementAndGet();
   LOG.debug("unacquired orphan task is done " + path);

代码示例来源:origin: harbby/presto-connectors

@Override
public int remainingTasksInCoordination() {
 int count = 0;
 try {
  List<String> tasks = ZKUtil.listChildrenNoWatch(watcher, watcher.splitLogZNode);
  if (tasks != null) {
   int listSize = tasks.size();
   for (int i = 0; i < listSize; i++) {
    if (!ZKSplitLog.isRescanNode(tasks.get(i))) {
     count++;
    }
   }
  }
 } catch (KeeperException ke) {
  LOG.warn("Failed to check remaining tasks", ke);
  count = -1;
 }
 return count;
}

代码示例来源:origin: co.cask.hbase/hbase

@Override
public void nodeDataChanged(String path) {
 Task task;
 task = tasks.get(path);
 if (task != null || ZKSplitLog.isRescanNode(watcher, path)) {
  if (task != null) {
   task.heartbeatNoDetails(EnvironmentEdgeManager.currentTimeMillis());
  }
  getDataSetWatch(path, zkretries);
 }
}

代码示例来源:origin: co.cask.hbase/hbase

private void lookForOrphans() {
 List<String> orphans;
 try {
   orphans = ZKUtil.listChildrenNoWatch(this.watcher,
    this.watcher.splitLogZNode);
  if (orphans == null) {
   LOG.warn("could not get children of " + this.watcher.splitLogZNode);
   return;
  }
 } catch (KeeperException e) {
  LOG.warn("could not get children of " + this.watcher.splitLogZNode +
    " " + StringUtils.stringifyException(e));
  return;
 }
 int rescan_nodes = 0;
 for (String path : orphans) {
  String nodepath = ZKUtil.joinZNode(watcher.splitLogZNode, path);
  if (ZKSplitLog.isRescanNode(watcher, nodepath)) {
   rescan_nodes++;
   LOG.debug("found orphan rescan node " + path);
  } else {
   LOG.info("found orphan task " + path);
  }
  getDataSetWatch(nodepath, zkretries);
 }
 LOG.info("found " + (orphans.size() - rescan_nodes) + " orphan tasks and " +
   rescan_nodes + " rescan nodes");
}

代码示例来源:origin: harbby/presto-connectors

@Override
public void nodeDataChanged(String path) {
 Task task;
 task = details.getTasks().get(path);
 if (task != null || ZKSplitLog.isRescanNode(watcher, path)) {
  if (task != null) {
   task.heartbeatNoDetails(EnvironmentEdgeManager.currentTime());
  }
  getDataSetWatch(path, zkretries);
 }
}

代码示例来源:origin: co.cask.hbase/hbase

/**
 * It is possible for a task to stay in UNASSIGNED state indefinitely - say
 * SplitLogManager wants to resubmit a task. It forces the task to UNASSIGNED
 * state but it dies before it could create the RESCAN task node to signal
 * the SplitLogWorkers to pick up the task. To prevent this scenario the
 * SplitLogManager resubmits all orphan and UNASSIGNED tasks at startup.
 *
 * @param path
 */
private void handleUnassignedTask(String path) {
 if (ZKSplitLog.isRescanNode(watcher, path)) {
  return;
 }
 Task task = findOrCreateOrphanTask(path);
 if (task.isOrphan() && (task.incarnation == 0)) {
  LOG.info("resubmitting unassigned orphan task " + path);
  // ignore failure to resubmit. The timeout-monitor will handle it later
  // albeit in a more crude fashion
  resubmit(path, task, FORCE);
 }
}

代码示例来源:origin: harbby/presto-connectors

/**
 * It is possible for a task to stay in UNASSIGNED state indefinitely - say SplitLogManager wants
 * to resubmit a task. It forces the task to UNASSIGNED state but it dies before it could create
 * the RESCAN task node to signal the SplitLogWorkers to pick up the task. To prevent this
 * scenario the SplitLogManager resubmits all orphan and UNASSIGNED tasks at startup.
 * @param path
 */
private void handleUnassignedTask(String path) {
 if (ZKSplitLog.isRescanNode(watcher, path)) {
  return;
 }
 Task task = findOrCreateOrphanTask(path);
 if (task.isOrphan() && (task.incarnation.get() == 0)) {
  LOG.info("resubmitting unassigned orphan task " + path);
  // ignore failure to resubmit. The timeout-monitor will handle it later
  // albeit in a more crude fashion
  resubmitTask(path, task, FORCE);
 }
}

代码示例来源:origin: harbby/presto-connectors

private void lookForOrphans() {
 List<String> orphans;
 try {
  orphans = ZKUtil.listChildrenNoWatch(this.watcher, this.watcher.splitLogZNode);
  if (orphans == null) {
   LOG.warn("could not get children of " + this.watcher.splitLogZNode);
   return;
  }
 } catch (KeeperException e) {
  LOG.warn("could not get children of " + this.watcher.splitLogZNode + " "
    + StringUtils.stringifyException(e));
  return;
 }
 int rescan_nodes = 0;
 int listSize = orphans.size();
 for (int i = 0; i < listSize; i++) {
  String path = orphans.get(i);
  String nodepath = ZKUtil.joinZNode(watcher.splitLogZNode, path);
  if (ZKSplitLog.isRescanNode(watcher, nodepath)) {
   rescan_nodes++;
   LOG.debug("found orphan rescan node " + path);
  } else {
   LOG.info("found orphan task " + path);
  }
  getDataSetWatch(nodepath, zkretries);
 }
 LOG.info("Found " + (orphans.size() - rescan_nodes) + " orphan tasks and " + rescan_nodes
   + " rescan nodes");
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com