- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZKWatcher.abort()
方法的一些代码示例,展示了ZKWatcher.abort()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKWatcher.abort()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.zookeeper.ZKWatcher
类名称:ZKWatcher
方法名:abort
暂无
代码示例来源:origin: apache/hbase
@Override
public void nodeCreated(String path) {
if (path.equals(labelZnode) || path.equals(userAuthsZnode)) {
try {
ZKUtil.watchAndCheckExists(watcher, path);
} catch (KeeperException ke) {
LOG.error("Error setting watcher on node " + path, ke);
// only option is to abort
watcher.abort("ZooKeeper error obtaining label node children", ke);
}
}
}
代码示例来源:origin: apache/hbase
@Override
public void run() {
try {
List<ZKUtil.NodeAndData> nodes =
ZKUtil.getChildDataAndWatchForNewChildren(watcher, aclZNode);
refreshNodes(nodes);
} catch (KeeperException ke) {
LOG.error("Error reading data from zookeeper", ke);
// only option is to abort
watcher.abort("ZooKeeper error obtaining acl node children", ke);
}
}
});
代码示例来源:origin: apache/hbase
/**
* Write a labels mirror or user auths mirror into zookeeper
*
* @param data
* @param labelsOrUserAuths true for writing labels and false for user auths.
*/
public void writeToZookeeper(byte[] data, boolean labelsOrUserAuths) {
String znode = this.labelZnode;
if (!labelsOrUserAuths) {
znode = this.userAuthsZnode;
}
try {
ZKUtil.updateExistingNodeData(watcher, znode, data, -1);
} catch (KeeperException e) {
LOG.error("Failed writing to " + znode, e);
watcher.abort("Failed writing node " + znode + " to zookeeper", e);
}
}
}
代码示例来源:origin: apache/hbase
@Override
public void nodeCreated(String path) {
if (path.equals(keysParentZNode)) {
try {
List<ZKUtil.NodeAndData> nodes =
ZKUtil.getChildDataAndWatchForNewChildren(watcher, keysParentZNode);
refreshNodes(nodes);
} catch (KeeperException ke) {
LOG.error(HBaseMarkers.FATAL, "Error reading data from zookeeper", ke);
watcher.abort("Error reading new key znode "+path, ke);
}
}
}
代码示例来源:origin: apache/hbase
@Override
public void nodeChildrenChanged(String path) {
if (path.equals(keysParentZNode)) {
// keys changed
try {
List<ZKUtil.NodeAndData> nodes =
ZKUtil.getChildDataAndWatchForNewChildren(watcher, keysParentZNode);
refreshNodes(nodes);
} catch (KeeperException ke) {
LOG.error(HBaseMarkers.FATAL, "Error reading data from zookeeper", ke);
watcher.abort("Error reading changed keys from zookeeper", ke);
}
}
}
代码示例来源:origin: apache/hbase
@Override
public void run() {
// update cache on an existing table node
String entry = ZKUtil.getNodeName(path);
try {
byte[] data = ZKUtil.getDataAndWatch(watcher, path);
refreshAuthManager(entry, data);
} catch (KeeperException ke) {
LOG.error("Error reading data from zookeeper for node " + entry, ke);
// only option is to abort
watcher.abort("ZooKeeper error getting data for node " + entry, ke);
} catch (IOException ioe) {
LOG.error("Error reading permissions writables", ioe);
}
}
});
代码示例来源:origin: apache/hbase
/**
* refresh keys
*/
synchronized void refreshKeys() {
try {
List<ZKUtil.NodeAndData> nodes =
ZKUtil.getChildDataAndWatchForNewChildren(watcher, keysParentZNode);
refreshNodes(nodes);
} catch (KeeperException ke) {
LOG.error(HBaseMarkers.FATAL, "Error reading data from zookeeper", ke);
watcher.abort("Error reading changed keys from zookeeper", ke);
}
}
代码示例来源:origin: apache/hbase
private void handleLeaderChange() {
try {
synchronized(lock) {
if (ZKUtil.watchAndCheckExists(watcher, leaderZNode)) {
LOG.info("Found new leader for znode: "+leaderZNode);
leaderExists.set(true);
} else {
LOG.info("Leader change, but no new leader found");
leaderExists.set(false);
lock.notifyAll();
}
}
} catch (KeeperException ke) {
watcher.abort("ZooKeeper error checking for leader znode", ke);
candidate.stop("ZooKeeper error checking for leader: "+ke.getMessage());
}
}
代码示例来源:origin: apache/hbase
@Override
public void nodeDataChanged(String path) {
if (keysParentZNode.equals(ZKUtil.getParent(path))) {
try {
byte[] data = ZKUtil.getDataAndWatch(watcher, path);
if (data == null || data.length == 0) {
LOG.debug("Ignoring empty node "+path);
return;
}
AuthenticationKey key = (AuthenticationKey)Writables.getWritable(data,
new AuthenticationKey());
secretManager.addKey(key);
} catch (KeeperException ke) {
LOG.error(HBaseMarkers.FATAL, "Error reading data from zookeeper", ke);
watcher.abort("Error reading updated key znode "+path, ke);
} catch (IOException ioe) {
LOG.error(HBaseMarkers.FATAL, "Error reading key writables", ioe);
watcher.abort("Error reading key writables from znode "+path, ioe);
}
}
}
代码示例来源:origin: apache/hbase
@Override
public void nodeDataChanged(String path) {
if (path.equals(labelZnode) || path.equals(userAuthsZnode)) {
try {
watcher.sync(path);
byte[] data = ZKUtil.getDataAndWatch(watcher, path);
if (path.equals(labelZnode)) {
refreshVisibilityLabelsCache(data);
} else {
refreshUserAuthsCache(data);
}
} catch (KeeperException ke) {
LOG.error("Error reading data from zookeeper for node " + path, ke);
// only option is to abort
watcher.abort("ZooKeeper error getting data for node " + path, ke);
}
}
}
代码示例来源:origin: apache/hbase
/**
* Removes the leader znode, if it is currently claimed by this instance.
*/
public void stepDownAsLeader() {
try {
synchronized(lock) {
if (!leaderExists.get()) {
return;
}
byte[] leaderId = ZKUtil.getData(watcher, leaderZNode);
if (leaderId != null && Bytes.equals(nodeId, leaderId)) {
LOG.info("Stepping down as leader");
ZKUtil.deleteNodeFailSilent(watcher, leaderZNode);
leaderExists.set(false);
} else {
LOG.info("Not current leader, no need to step down");
}
}
} catch (KeeperException ke) {
watcher.abort("Unhandled zookeeper exception removing leader node", ke);
candidate.stop("Unhandled zookeeper exception removing leader node: "
+ ke.getMessage());
} catch (InterruptedException e) {
watcher.abort("Unhandled zookeeper exception removing leader node", e);
candidate.stop("Unhandled zookeeper exception removing leader node: "
+ e.getMessage());
}
}
代码示例来源:origin: apache/hbase
/***
* Delete the acl notify node of namespace
*/
public void deleteNamespaceACLNode(final String namespace) {
String zkNode = ZNodePaths.joinZNode(watcher.getZNodePaths().baseZNode, ACL_NODE);
zkNode = ZNodePaths.joinZNode(zkNode, AccessControlLists.NAMESPACE_PREFIX + namespace);
try {
ZKUtil.deleteNode(watcher, zkNode);
} catch (KeeperException.NoNodeException e) {
LOG.warn("No acl notify node of namespace '" + namespace + "'");
} catch (KeeperException e) {
LOG.error("Failed deleting acl node of namespace '" + namespace + "'", e);
watcher.abort("Failed deleting node " + zkNode, e);
}
}
}
代码示例来源:origin: apache/hbase
/**
* Releases the resources for the given AuthManager if the reference count is down to 0.
* @param instance AuthManager to be released
*/
public synchronized static void release(AuthManager instance) {
if (refCount.get(instance) == null || refCount.get(instance) < 1) {
String msg = "Something wrong with the AuthManager reference counting: " + instance
+ " whose count is " + refCount.get(instance);
LOG.error(HBaseMarkers.FATAL, msg);
instance.close();
managerMap.remove(instance.getZKPermissionWatcher().getWatcher());
instance.getZKPermissionWatcher().getWatcher().abort(msg, null);
} else {
int ref = refCount.get(instance);
--ref;
refCount.put(instance, ref);
if (ref == 0) {
instance.close();
managerMap.remove(instance.getZKPermissionWatcher().getWatcher());
refCount.remove(instance);
}
}
}
}
代码示例来源:origin: apache/hbase
/***
* Delete the acl notify node of table
* @param tableName
*/
public void deleteTableACLNode(final TableName tableName) {
String zkNode = ZNodePaths.joinZNode(watcher.getZNodePaths().baseZNode, ACL_NODE);
zkNode = ZNodePaths.joinZNode(zkNode, tableName.getNameAsString());
try {
ZKUtil.deleteNode(watcher, zkNode);
} catch (KeeperException.NoNodeException e) {
LOG.warn("No acl notify node of table '" + tableName + "'");
} catch (KeeperException e) {
LOG.error("Failed deleting acl node of table '" + tableName + "'", e);
watcher.abort("Failed deleting node " + zkNode, e);
}
}
代码示例来源:origin: apache/hbase
public void addKeyToZK(AuthenticationKey key) {
String keyZNode = getKeyNode(key.getKeyId());
try {
byte[] keyData = Writables.getBytes(key);
// TODO: is there any point in retrying beyond what ZK client does?
ZKUtil.createSetData(watcher, keyZNode, keyData);
} catch (KeeperException ke) {
LOG.error(HBaseMarkers.FATAL, "Unable to synchronize master key "+key.getKeyId()+
" to znode "+keyZNode, ke);
watcher.abort("Unable to synchronize secret key "+
key.getKeyId()+" in zookeeper", ke);
} catch (IOException ioe) {
// this can only happen from an error serializing the key
watcher.abort("Failed serializing key "+key.getKeyId(), ioe);
}
}
代码示例来源:origin: apache/hbase
public void removeKeyFromZK(AuthenticationKey key) {
String keyZNode = getKeyNode(key.getKeyId());
try {
ZKUtil.deleteNode(watcher, keyZNode);
} catch (KeeperException.NoNodeException nne) {
LOG.error("Non-existent znode "+keyZNode+" for key "+key.getKeyId(), nne);
} catch (KeeperException ke) {
LOG.error(HBaseMarkers.FATAL, "Failed removing znode "+keyZNode+" for key "+
key.getKeyId(), ke);
watcher.abort("Unhandled zookeeper error removing znode "+keyZNode+
" for key "+key.getKeyId(), ke);
}
}
代码示例来源:origin: apache/hbase
public void updateKeyInZK(AuthenticationKey key) {
String keyZNode = getKeyNode(key.getKeyId());
try {
byte[] keyData = Writables.getBytes(key);
try {
ZKUtil.updateExistingNodeData(watcher, keyZNode, keyData, -1);
} catch (KeeperException.NoNodeException ne) {
// node was somehow removed, try adding it back
ZKUtil.createSetData(watcher, keyZNode, keyData);
}
} catch (KeeperException ke) {
LOG.error(HBaseMarkers.FATAL, "Unable to update master key "+key.getKeyId()+
" in znode "+keyZNode);
watcher.abort("Unable to synchronize secret key "+
key.getKeyId()+" in zookeeper", ke);
} catch (IOException ioe) {
// this can only happen from an error serializing the key
watcher.abort("Failed serializing key "+key.getKeyId(), ioe);
}
}
代码示例来源:origin: apache/hbase
/***
* Write a table's access controls to the permissions mirror in zookeeper
* @param entry
* @param permsData
*/
public void writeToZookeeper(byte[] entry, byte[] permsData) {
String entryName = Bytes.toString(entry);
String zkNode = ZNodePaths.joinZNode(watcher.getZNodePaths().baseZNode, ACL_NODE);
zkNode = ZNodePaths.joinZNode(zkNode, entryName);
try {
ZKUtil.createWithParents(watcher, zkNode);
ZKUtil.updateExistingNodeData(watcher, zkNode, permsData, -1);
} catch (KeeperException e) {
LOG.error("Failed updating permissions for entry '" +
entryName + "'", e);
watcher.abort("Failed writing node "+zkNode+" to zookeeper", e);
}
}
代码示例来源:origin: apache/hbase
private void refreshNodes(List<ZKUtil.NodeAndData> nodes) {
for (ZKUtil.NodeAndData n : nodes) {
String path = n.getNode();
String keyId = ZKUtil.getNodeName(path);
try {
byte[] data = n.getData();
if (data == null || data.length == 0) {
LOG.debug("Ignoring empty node "+path);
continue;
}
AuthenticationKey key = (AuthenticationKey)Writables.getWritable(
data, new AuthenticationKey());
secretManager.addKey(key);
} catch (IOException ioe) {
LOG.error(HBaseMarkers.FATAL, "Failed reading new secret key for id '" +
keyId + "' from zk", ioe);
watcher.abort("Error deserializing key from znode "+path, ioe);
}
}
}
代码示例来源:origin: apache/hbase
public void start() {
try {
watcher.registerListener(this);
String parent = ZKUtil.getParent(leaderZNode);
if (ZKUtil.checkExists(watcher, parent) < 0) {
ZKUtil.createWithParents(watcher, parent);
}
} catch (KeeperException ke) {
watcher.abort("Unhandled zk exception when starting", ke);
candidate.stop("Unhandled zk exception starting up: "+ke.getMessage());
}
}
我们有数据(此时未分配)要转换/聚合/透视到 wazoo。 我在 www 上看了看,我问的所有答案都指向 hadoop 可扩展、运行便宜(没有 SQL 服务器机器和许可证)、快速(如果你有足够的数据)
这很明显,我们都同意我们可以将 HDFS + YARN + MapReduce 称为 Hadoop。但是,Hadoop 生态系统中的其他不同组合和其他产品会怎样? 例如,HDFS + YARN + S
如果 es-hadoop 只是连接到 HDFS 的 Hadoop 连接器,它如何支持 Hadoop 分析? 最佳答案 我假设您指的是 this project .在这种情况下,ES Hadoop 项目
看完this和 this论文,我决定我想在 MapReduce 上为大型数据集实现分布式体积渲染设置作为我的本科论文工作。 Hadoop 是一个合理的选择吗? Java 不会扼杀一些性能提升或使与 C
我一直在尝试查找有关如何通过命令行提交 hadoop 作业的信息。 我知道命令 - hadoop jar jar-file 主类输入输出 还有另一个命令,我正在尝试查找有关它的信息,但未能找到 - h
Hadoop 服务器在 Kubernetes 中。而Hadoop客户端位于外网。所以我尝试使用 kubernetes-service 来使用 Hadoop 服务器。但是 hadoop fs -put
有没有人遇到奇怪的环境问题,在调用 hadoop 命令时被迫使用 SU 而不是 SUDO? sudo su -c 'hadoop fs -ls /' hdfs Found 4 itemsdrwxr-x
在更改 mapred-site.xml 中的属性后,我给出了一个 tar.bz2 文件、.gz 和 tar.gz 文件作为输入。以上似乎都没有奏效。我假设这里发生的是 hadoop 作为输入读取的记录
如何在 Hadoop Pipes 中获取正在 hadoop 映射器 中执行的输入文件 名称? 我可以很容易地在基于 java 的 map reducer 中获取文件名,比如 FileSplit fil
我想使用 MapReduce 方法分析连续的数据流(通过 HTTP 访问),因此我一直在研究 Apache Hadoop。不幸的是,Hadoop 似乎期望以固定大小的输入文件开始作业,而不是能够在新数
名称节点可以执行任务吗?默认情况下,任务在集群的数据节点上执行。 最佳答案 假设您正在询问MapReduce ... 使用YARN,MapReduce任务在应用程序主数据库中执行,而不是在nameno
我有一个关系A包含 (zip-code). 我还有另一个关系B包含 (name:gender:zip-code) (x:m:1234) (y:f:1234) (z:m:1245) (s:f:1235)
我是hadoop地区的新手。您能帮我负责(k2,list[v2,v2,v2...])形式的输出(意味着将键及其所有关联值组合在一起)的责任是吗? 谢谢。 最佳答案 这是Hadoop的MapReduce
因此,我一直在尝试编写一个hadoop程序,该程序将输入作为一个包含许多文件的文件,并且我希望hadoop程序的输出仅是输入文件的一行。但是我还没有做到这一点。我也不想去 reducer 课。如果有人
我使用的输入文本文件的内容是 1 "Come 1 "Defects," 1 "I 1 "Information 1 "J" 2 "Plain 5 "Project 1
谁能告诉我以下grep命令的作用: $ bin/hadoop jar hadoop-*-examples.jar grep input output 'dfs[a-z.]+' 最佳答案 http:/
我不了解mapreducer的基本功能,mapreducer是否有助于将文件放入HDFS 或mapreducer仅有助于分析HDFS中现有文件中的内容 我对hadoop非常陌生,任何人都可以指导我理解
CopyFromLocal将从本地文件系统上载数据。 不要放会从任何文件上传数据,例如。本地FS,亚马逊S3 或仅来自本地fs ??? 最佳答案 请找到两个命令的用法。 put ======= Usa
我开始研究hadoop mapreduce。 我是Java和hadoop的初学者,并且了解hadoop mapreduce的编码,但是有兴趣了解它在云中的内部工作方式。 您能否分享一些很好的链接来说明
我一直在寻找Hadoop mapreduce类的类路径。我正在使用Hortonworks 2.2.4版沙箱。我需要这样的类路径来运行我的javac编译器: javac -cp (CLASS_PATH)
我是一名优秀的程序员,十分优秀!