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

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

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

ZKSplitLog.getRescanNode介绍

暂无

代码示例

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

/**
 * Checks if the given path represents a rescan node.
 *
 * @param zkw reference to the {@link ZKWatcher} which also contains configuration and constants
 * @param path the absolute path, starts with '/'
 * @return whether the path represents a rescan node
 */
public static boolean isRescanNode(ZKWatcher zkw, String path) {
 String prefix = getRescanNode(zkw);
 if (path.length() <= prefix.length()) {
  return false;
 }
 for (int i = 0; i < prefix.length(); i++) {
  if (prefix.charAt(i) != path.charAt(i)) {
   return false;
  }
 }
 return true;
}

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

/**
 * signal the workers that a task was resubmitted by creating the RESCAN node.
 */
private void rescan(long retries) {
 // The RESCAN node will be deleted almost immediately by the
 // SplitLogManager as soon as it is created because it is being
 // created in the DONE state. This behavior prevents a buildup
 // of RESCAN nodes. But there is also a chance that a SplitLogWorker
 // might miss the watch-trigger that creation of RESCAN node provides.
 // Since the TimeoutMonitor will keep resubmitting UNASSIGNED tasks
 // therefore this behavior is safe.
 SplitLogTask slt = new SplitLogTask.Done(this.details.getServerName());
 this.watcher
   .getRecoverableZooKeeper()
   .getZooKeeper()
   .create(ZKSplitLog.getRescanNode(watcher), slt.toByteArray(), Ids.OPEN_ACL_UNSAFE,
    CreateMode.EPHEMERAL_SEQUENTIAL, new CreateRescanAsyncCallback(), Long.valueOf(retries));
}

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

public static boolean isRescanNode(ZooKeeperWatcher zkw, String path) {
 String prefix = getRescanNode(zkw);
 if (path.length() <= prefix.length()) {
  return false;
 }
 for (int i = 0; i < prefix.length(); i++) {
  if (prefix.charAt(i) != path.charAt(i)) {
   return false;
  }
 }
 return true;
}

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

/**
 * @param zkw
 * @param path the absolute path, starts with '/'
 * @return whether the path represents a rescan node
 */
public static boolean isRescanNode(ZooKeeperWatcher zkw, String path) {
 String prefix = getRescanNode(zkw);
 if (path.length() <= prefix.length()) {
  return false;
 }
 for (int i = 0; i < prefix.length(); i++) {
  if (prefix.charAt(i) != path.charAt(i)) {
   return false;
  }
 }
 return true;
}

代码示例来源:origin: org.apache.hbase/hbase-zookeeper

/**
 * Checks if the given path represents a rescan node.
 *
 * @param zkw reference to the {@link ZKWatcher} which also contains configuration and constants
 * @param path the absolute path, starts with '/'
 * @return whether the path represents a rescan node
 */
public static boolean isRescanNode(ZKWatcher zkw, String path) {
 String prefix = getRescanNode(zkw);
 if (path.length() <= prefix.length()) {
  return false;
 }
 for (int i = 0; i < prefix.length(); i++) {
  if (prefix.charAt(i) != path.charAt(i)) {
   return false;
  }
 }
 return true;
}

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

/**
 * signal the workers that a task was resubmitted by creating the
 * RESCAN node.
 * @throws KeeperException 
 */
private void createRescanNode(long retries) {
 // The RESCAN node will be deleted almost immediately by the
 // SplitLogManager as soon as it is created because it is being
 // created in the DONE state. This behavior prevents a buildup
 // of RESCAN nodes. But there is also a chance that a SplitLogWorker
 // might miss the watch-trigger that creation of RESCAN node provides.
 // Since the TimeoutMonitor will keep resubmitting UNASSIGNED tasks
 // therefore this behavior is safe.
 this.watcher.getRecoverableZooKeeper().getZooKeeper().
  create(ZKSplitLog.getRescanNode(watcher),
   TaskState.TASK_DONE.get(serverName), Ids.OPEN_ACL_UNSAFE,
   CreateMode.EPHEMERAL_SEQUENTIAL,
   new CreateRescanAsyncCallback(), Long.valueOf(retries));
}

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

/**
 * signal the workers that a task was resubmitted by creating the RESCAN node.
 */
private void rescan(long retries) {
 // The RESCAN node will be deleted almost immediately by the
 // SplitLogManager as soon as it is created because it is being
 // created in the DONE state. This behavior prevents a buildup
 // of RESCAN nodes. But there is also a chance that a SplitLogWorker
 // might miss the watch-trigger that creation of RESCAN node provides.
 // Since the TimeoutMonitor will keep resubmitting UNASSIGNED tasks
 // therefore this behavior is safe.
 SplitLogTask slt = new SplitLogTask.Done(this.details.getServerName(), getRecoveryMode());
 this.watcher
   .getRecoverableZooKeeper()
   .getZooKeeper()
   .create(ZKSplitLog.getRescanNode(watcher), slt.toByteArray(), Ids.OPEN_ACL_UNSAFE,
    CreateMode.EPHEMERAL_SEQUENTIAL, new CreateRescanAsyncCallback(), Long.valueOf(retries));
}

相关文章