- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.prefix()
方法的一些代码示例,展示了ZooKeeperWatcher.prefix()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperWatcher.prefix()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher
类名称:ZooKeeperWatcher
方法名:prefix
[英]Adds this instance's identifier as a prefix to the passed str
[中]将此实例的标识符作为前缀添加到传递的str
代码示例来源:origin: co.cask.hbase/hbase
/**
* Handles KeeperExceptions in client calls.
* <p>
* This may be temporary but for now this gives one place to deal with these.
* <p>
* TODO: Currently this method rethrows the exception to let the caller handle
* <p>
* @param ke
* @throws KeeperException
*/
public void keeperException(KeeperException ke)
throws KeeperException {
LOG.error(prefix("Received unexpected KeeperException, re-throwing exception"), ke);
throw ke;
}
代码示例来源:origin: com.aliyun.hbase/alihbase-client
/**
* Handles KeeperExceptions in client calls.
* <p>
* This may be temporary but for now this gives one place to deal with these.
* <p>
* TODO: Currently this method rethrows the exception to let the caller handle
* <p>
* @param ke
* @throws KeeperException
*/
public void keeperException(KeeperException ke)
throws KeeperException {
LOG.error(prefix("Received unexpected KeeperException, re-throwing exception"), ke);
throw ke;
}
代码示例来源:origin: co.cask.hbase/hbase
/**
* Handles InterruptedExceptions in client calls.
* <p>
* This may be temporary but for now this gives one place to deal with these.
* <p>
* TODO: Currently, this method does nothing.
* Is this ever expected to happen? Do we abort or can we let it run?
* Maybe this should be logged as WARN? It shouldn't happen?
* <p>
* @param ie
*/
public void interruptedException(InterruptedException ie) {
LOG.debug(prefix("Received InterruptedException, doing nothing here"), ie);
// At least preserver interrupt.
Thread.currentThread().interrupt();
// no-op
}
代码示例来源:origin: com.aliyun.hbase/alihbase-client
/**
* Handles InterruptedExceptions in client calls.
* <p>
* This may be temporary but for now this gives one place to deal with these.
* <p>
* TODO: Currently, this method does nothing.
* Is this ever expected to happen? Do we abort or can we let it run?
* Maybe this should be logged as WARN? It shouldn't happen?
* <p>
* @param ie
*/
public void interruptedException(InterruptedException ie) {
LOG.debug(prefix("Received InterruptedException, doing nothing here"), ie);
// At least preserver interrupt.
Thread.currentThread().interrupt();
// no-op
}
代码示例来源:origin: harbby/presto-connectors
/**
* Handles KeeperExceptions in client calls.
* <p>
* This may be temporary but for now this gives one place to deal with these.
* <p>
* TODO: Currently this method rethrows the exception to let the caller handle
* <p>
* @param ke
* @throws KeeperException
*/
public void keeperException(KeeperException ke)
throws KeeperException {
LOG.error(prefix("Received unexpected KeeperException, re-throwing exception"), ke);
throw ke;
}
代码示例来源:origin: co.cask.hbase/hbase
/**
* Deletes all unassigned nodes regardless of their state.
*
* <p>No watchers are set.
*
* <p>This method is used by the Master during cluster startup to clear out
* any existing state from other cluster runs.
*
* @param zkw zk reference
* @throws KeeperException if unexpected zookeeper exception
*/
public static void deleteAllNodes(ZooKeeperWatcher zkw)
throws KeeperException {
LOG.debug(zkw.prefix("Deleting any existing unassigned nodes"));
ZKUtil.deleteChildrenRecursively(zkw, zkw.assignmentZNode);
}
代码示例来源:origin: harbby/presto-connectors
/**
* Handles InterruptedExceptions in client calls.
* <p>
* This may be temporary but for now this gives one place to deal with these.
* <p>
* TODO: Currently, this method does nothing.
* Is this ever expected to happen? Do we abort or can we let it run?
* Maybe this should be logged as WARN? It shouldn't happen?
* <p>
* @param ie
*/
public void interruptedException(InterruptedException ie) {
LOG.debug(prefix("Received InterruptedException, doing nothing here"), ie);
// At least preserver interrupt.
Thread.currentThread().interrupt();
// no-op
}
代码示例来源:origin: com.aliyun.hbase/alihbase-client
/**
* Get znode data. Does not set a watcher.
* @return ZNode data, null if the node does not exist or if there is an
* error.
*/
public static byte [] getData(ZooKeeperWatcher zkw, String znode)
throws KeeperException, InterruptedException {
try {
byte [] data = zkw.getRecoverableZooKeeper2().getData(znode, null, null);
// logRetrievedMsg(zkw, znode, data, false);
return data;
} catch (KeeperException.NoNodeException e) {
LOG.debug(zkw.prefix("Unable to get data of znode " + znode + " " +
"because node does not exist (not an error)"));
return null;
} catch (KeeperException e) {
LOG.warn(zkw.prefix("Unable to get data of znode " + znode), e);
zkw.keeperException(e);
return null;
}
}
代码示例来源:origin: co.cask.hbase/hbase
private static byte[] getDataInternal(ZooKeeperWatcher zkw, String znode, Stat stat,
boolean watcherSet)
throws KeeperException {
try {
byte [] data = zkw.getRecoverableZooKeeper().getData(znode, zkw, stat);
logRetrievedMsg(zkw, znode, data, watcherSet);
return data;
} catch (KeeperException.NoNodeException e) {
LOG.debug(zkw.prefix("Unable to get data of znode " + znode + " " +
"because node does not exist (not an error)"));
return null;
} catch (KeeperException e) {
LOG.warn(zkw.prefix("Unable to get data of znode " + znode), e);
zkw.keeperException(e);
return null;
} catch (InterruptedException e) {
LOG.warn(zkw.prefix("Unable to get data of znode " + znode), e);
zkw.interruptedException(e);
return null;
}
}
代码示例来源:origin: co.cask.hbase/hbase
private static void logRetrievedMsg(final ZooKeeperWatcher zkw,
final String znode, final byte [] data, final boolean watcherSet) {
if (!LOG.isDebugEnabled()) return;
LOG.debug(zkw.prefix("Retrieved " + ((data == null)? 0: data.length) +
" byte(s) of data from znode " + znode +
(watcherSet? " and set watcher; ": "; data=") +
(data == null? "null": data.length == 0? "empty": (
znode.startsWith(zkw.assignmentZNode) ?
RegionTransitionData.fromBytes(data).toString()
: StringUtils.abbreviate(Bytes.toStringBinary(data), 32)))));
}
代码示例来源:origin: harbby/presto-connectors
/**
* Deletes all unassigned nodes regardless of their state.
*
* <p>No watchers are set.
*
* <p>This method is used by the Master during cluster startup to clear out
* any existing state from other cluster runs.
*
* @param zkw zk reference
* @throws KeeperException if unexpected zookeeper exception
*/
public static void deleteAllNodes(ZooKeeperWatcher zkw)
throws KeeperException {
LOG.debug(zkw.prefix("Deleting any existing unassigned nodes"));
ZKUtil.deleteChildrenRecursively(zkw, zkw.assignmentZNode);
}
代码示例来源:origin: co.cask.hbase/hbase
/**
* Check if the specified node exists. Sets no watches.
*
* @param zkw zk reference
* @param znode path of node to watch
* @return version of the node if it exists, -1 if does not exist
* @throws KeeperException if unexpected zookeeper exception
*/
public static int checkExists(ZooKeeperWatcher zkw, String znode)
throws KeeperException {
try {
Stat s = zkw.getRecoverableZooKeeper().exists(znode, null);
return s != null ? s.getVersion() : -1;
} catch (KeeperException e) {
LOG.warn(zkw.prefix("Unable to set watcher on znode (" + znode + ")"), e);
zkw.keeperException(e);
return -1;
} catch (InterruptedException e) {
LOG.warn(zkw.prefix("Unable to set watcher on znode (" + znode + ")"), e);
zkw.interruptedException(e);
return -1;
}
}
代码示例来源:origin: com.aliyun.hbase/alihbase-client
/**
* Check if the specified node exists. Sets no watches.
*
* @param zkw zk reference
* @param znode path of node to watch
* @return version of the node if it exists, -1 if does not exist
* @throws KeeperException if unexpected zookeeper exception
*/
public static int checkExists(ZooKeeperWatcher zkw, String znode)
throws KeeperException {
try {
Stat s = zkw.getRecoverableZooKeeper2().exists(znode, null);
return s != null ? s.getVersion() : -1;
} catch (KeeperException e) {
LOG.warn(zkw.prefix("Unable to set watcher on znode (" + znode + ")"), e);
zkw.keeperException(e);
return -1;
} catch (InterruptedException e) {
LOG.warn(zkw.prefix("Unable to set watcher on znode (" + znode + ")"), e);
zkw.interruptedException(e);
return -1;
}
}
代码示例来源:origin: co.cask.hbase/hbase
public void stop() {
try {
// If our address is in ZK, delete it on our way out
byte [] bytes =
ZKUtil.getDataAndWatch(watcher, watcher.masterAddressZNode);
// TODO: redo this to make it atomic (only added for tests)
ServerName master = bytes == null ? null : ServerName.parseVersionedServerName(bytes);
if (master != null && master.equals(this.sn)) {
ZKUtil.deleteNode(watcher, watcher.masterAddressZNode);
}
} catch (KeeperException e) {
LOG.error(this.watcher.prefix("Error deleting our own master address node"), e);
}
}
}
代码示例来源:origin: harbby/presto-connectors
private static void logRetrievedMsg(final ZooKeeperWatcher zkw,
final String znode, final byte [] data, final boolean watcherSet) {
if (!LOG.isTraceEnabled()) return;
LOG.trace(zkw.prefix("Retrieved " + ((data == null)? 0: data.length) +
" byte(s) of data from znode " + znode +
(watcherSet? " and set watcher; ": "; data=") +
(data == null? "null": data.length == 0? "empty": (
znode.startsWith(zkw.assignmentZNode)?
ZKAssign.toString(data): // We should not be doing this reaching into another class
znode.startsWith(ZooKeeperWatcher.META_ZNODE_PREFIX)?
getServerNameOrEmptyString(data):
znode.startsWith(zkw.backupMasterAddressesZNode)?
getServerNameOrEmptyString(data):
StringUtils.abbreviate(Bytes.toStringBinary(data), 32)))));
}
代码示例来源:origin: co.cask.hbase/hbase
public static void createNodeOffline(ZooKeeperWatcher zkw, HRegionInfo region,
ServerName serverName, final EventType event)
throws KeeperException, KeeperException.NodeExistsException {
LOG.debug(zkw.prefix("Creating unassigned node for " +
region.getEncodedName() + " in OFFLINE state"));
RegionTransitionData data = new RegionTransitionData(event,
region.getRegionName(), serverName);
String node = getNodeName(zkw, region.getEncodedName());
ZKUtil.createAndWatch(zkw, node, data.getBytes());
}
代码示例来源:origin: harbby/presto-connectors
public static void createNodeOffline(ZooKeeperWatcher zkw, HRegionInfo region,
ServerName serverName, final EventType event)
throws KeeperException, KeeperException.NodeExistsException {
LOG.debug(zkw.prefix("Creating unassigned node " +
region.getEncodedName() + " in OFFLINE state"));
RegionTransition rt =
RegionTransition.createRegionTransition(event, region.getRegionName(), serverName);
String node = getNodeName(zkw, region.getEncodedName());
ZKUtil.createAndWatch(zkw, node, rt.toByteArray());
}
代码示例来源:origin: harbby/presto-connectors
private void createBaseZNodes() throws ZooKeeperConnectionException {
try {
// Create all the necessary "directories" of znodes
ZKUtil.createWithParents(this, baseZNode);
if (conf.getBoolean("hbase.assignment.usezk", true)) {
ZKUtil.createAndFailSilent(this, assignmentZNode);
}
ZKUtil.createAndFailSilent(this, rsZNode);
ZKUtil.createAndFailSilent(this, drainingZNode);
ZKUtil.createAndFailSilent(this, tableZNode);
ZKUtil.createAndFailSilent(this, splitLogZNode);
ZKUtil.createAndFailSilent(this, backupMasterAddressesZNode);
ZKUtil.createAndFailSilent(this, tableLockZNode);
ZKUtil.createAndFailSilent(this, recoveringRegionsZNode);
} catch (KeeperException e) {
throw new ZooKeeperConnectionException(
prefix("Unexpected KeeperException creating base node"), e);
}
}
代码示例来源:origin: com.aliyun.hbase/alihbase-client
private void createBaseZNodes() throws ZooKeeperConnectionException {
try {
// Create all the necessary "directories" of znodes
ZKUtil2.createWithParents(this, baseZNode);
if (conf.getBoolean("hbase.assignment.usezk", true)) {
ZKUtil2.createAndFailSilent(this, assignmentZNode);
}
ZKUtil2.createAndFailSilent(this, rsZNode);
ZKUtil2.createAndFailSilent(this, drainingZNode);
ZKUtil2.createAndFailSilent(this, tableZNode);
ZKUtil2.createAndFailSilent(this, splitLogZNode);
ZKUtil2.createAndFailSilent(this, backupMasterAddressesZNode);
ZKUtil2.createAndFailSilent(this, tableLockZNode);
ZKUtil2.createAndFailSilent(this, recoveringRegionsZNode);
} catch (KeeperException e) {
throw new ZooKeeperConnectionException(
prefix("Unexpected KeeperException creating base node"), e);
}
}
代码示例来源:origin: co.cask.hbase/hbase
private void createBaseZNodes() throws ZooKeeperConnectionException {
try {
// Create all the necessary "directories" of znodes
ZKUtil.createAndFailSilent(this, baseZNode);
ZKUtil.createAndFailSilent(this, assignmentZNode);
ZKUtil.createAndFailSilent(this, rsZNode);
ZKUtil.createAndFailSilent(this, drainingZNode);
ZKUtil.createAndFailSilent(this, masterTableZNode);
ZKUtil.createAndFailSilent(this, masterTableZNode92);
ZKUtil.createAndFailSilent(this, splitLogZNode);
ZKUtil.createAndFailSilent(this, backupMasterAddressesZNode);
} catch (KeeperException e) {
throw new ZooKeeperConnectionException(
prefix("Unexpected KeeperException creating base node"), e);
}
}
我想知道这在 SQL 中是否可行。假设您有两个表 A 和 B,并且您对表 A 进行选择并在表 B 上进行联接: SELECT a.*, b.* FROM TABLE_A a JOIN TABLE_B
我认为这只是一个一般的 C++ 问题: 我正在尝试使用 gnu c++ 编译器在 Linux Fedora 上编译本地版本的 ffmpeg。我的源代码位于以下一堆文件夹中: ~//Downloads/
我听说在 Linux 上编译 PHP 时设置 --prefix=PREFIX 选项将允许您一次安装多个 PHP 而不会发生冲突。 (我认为如果未设置默认值是 /usr/local)。但是,我不确定它到
我有以下 conda 环境文件 environment.yml: name: testproject channels: - defaults dependencies: - python=3.7 p
目前在我的 Makefile 中我有: prefix ?= /usr/local 这样我就可以在调用 make 时覆盖 prefix 值,如下所示: make prefix="/new_path" 我
我正在尝试创建一个计算 pptx 中单词的函数文档。问题是我不知道如何只找到这种标签: Some Text 当我尝试:print xmlTree.findall('.//a:t') , 它返回 Syn
gitconfig(1) : If not set explicitly with --file, there are four files where git config will search
嗨,我是 Spring MVC 的新手,我正在关注 Spring 引用文档,我对 View 解析器有疑问。这是我的示例代码。 @Controller @RequestMapping("/form")
我一般都是通过pip安装python包的。 对于 Google App Engine,我需要将包安装到另一个目标目录。 我试过了: pip install -I flask-restful --tar
我对一些使用指令 ngb-pagination 的组件进行了 Angular 测试。来自 ng-bootstrap . 现在,在我的测试中,我模拟这个组件如下: // on next line I g
我无法运行npm install npm@latest -g,而不会遇到权限错误并被迫使用sudo npm install npm@latest -g。我可以在不使用 sudo 的情况下运行它,但是
假设我有一个字符串公式,它的格式是:“func(a+b,c)”,其中func是一个定制函数,这个字符串同时包含中缀(即+)和前缀(即func)表示,我想将其转换为具有所有前缀表示的字符串,“func(
我已经写下了一个简单的函数来确定 str1 是否是 str2 的前缀。这是一个非常简单的函数,看起来像这样(在 JS 中): function isPrefix(str1, str2) // dete
我们有 git remote add origin http://...避免重复输入实际的源代码库路径。但是如何git subtree --prefix=... ?每次拉/推子树内容时,很难跟踪、记住
我的 travis 工作遇到了以下问题: Process Output:Could not find platform independent libraries Process Output:Co
我正在阅读 Artifice 的来源并看到: module Artifice NET_HTTP = ::Net::HTTP # ... end 行:https://github.com/wyc
我正在阅读有关 Angular 路由的文档并创建了一个简单的测试: const routes: Route[] = [ { path: '', redirectTo: '/home', pat
所以使用 Material 我们有一些代码来问一个问题,我们想在输入的前面添加一个 $ 符号或使用占位符。在这个垫子字段内部,我们还有一个垫子标签。如果我使用 matprefix,它会将美元符号放在标
目前我希望为 Apache Mesos 编写一个脚本来启动主/从(在 2 个不同的节点上)。 我有引用http://mesos.apache.org/documentation/latest/depl
我已为文档建立索引,每个文档都有一个字段:“CodeName”,其值类似于以下内容: document 1 has CodeName: "AAA01" document 2 has CodeName:
我是一名优秀的程序员,十分优秀!