- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.linkedin.zookeeper.tracker.ZooKeeperTreeTracker
类的一些代码示例,展示了ZooKeeperTreeTracker
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperTreeTracker
类的具体详情如下:
包路径:org.linkedin.zookeeper.tracker.ZooKeeperTreeTracker
类名称:ZooKeeperTreeTracker
[英]The purpose of this class is to essentially keep a replica of ZooKeeper data in memory and be able to be notified when it changes.
[中]这个类的目的是在内存中保留ZooKeeper数据的副本,并在数据发生变化时能够得到通知。
代码示例来源:origin: org.pongasoft/org.linkedin.zookeeper-impl
public void track(NodeEventsListener<T> eventsListener)
throws InterruptedException, KeeperException
{
registerListener(eventsListener);
track();
}
代码示例来源:origin: org.fusesource.fabric/fabric-configadmin
public void destroy() throws Exception {
for (ZooKeeperTreeTracker<String> tree : trees.values()) {
tree.destroy();
}
trees.clear();
}
代码示例来源:origin: org.fusesource.fabric/fabric-configadmin
protected List<String> getChildren(ZooKeeperTreeTracker<String> tree, String node) {
List<String> children = new ArrayList<String>();
if (tree != null) {
Pattern p = Pattern.compile(node + "/[^/]*");
for (String c : tree.getTree().keySet()) {
if (p.matcher(c).matches()) {
children.add(c.substring(c.lastIndexOf('/') + 1));
}
}
}
return children;
}
代码示例来源:origin: org.pongasoft/org.linkedin.zookeeper-impl
private Map<String, TrackedNode<T>> handleNodeDataChanged(String path,
Collection<NodeEvent<T>> events)
throws InterruptedException, KeeperException
{
return trackNode(path,
new LinkedHashMap<String, TrackedNode<T>>(_tree),
events,
computeDepth(path));
}
代码示例来源:origin: org.pongasoft/org.linkedin.zookeeper-impl
public void track() throws InterruptedException, KeeperException
{
Collection<NodeEvent<T>> events = new ArrayList<NodeEvent<T>>();
synchronized(_lock)
{
_tree = trackNode(_root, new LinkedHashMap<String, TrackedNode<T>>(), events, 0);
}
raiseEvents(events);
}
代码示例来源:origin: org.fusesource.fabric/fabric-configadmin
protected ZooKeeperTreeTracker<String> track(String path) throws InterruptedException, KeeperException, IOException {
ZooKeeperTreeTracker<String> tree = trees.get(path);
if (tree == null) {
if (ZooKeeperUtils.exists(zooKeeper, path) != null) {
tree = new ZooKeeperTreeTracker<String>(zooKeeper, new ZKStringDataReader(), path);
trees.put(path, tree);
tree.track(this);
String[] parents = getParents(tree.getTree().get(path));
for (String parent : parents) {
track(ZkPath.CONFIG_VERSIONS_PROFILE.getPath(version, parent));
}
} else {
// If the node does not exist yet, we track the parent to make
// sure we receive the node creation event
String p = ZkPath.CONFIG_VERSIONS_PROFILES.getPath(version);
if (!trees.containsKey(p)) {
tree = new ZooKeeperTreeTracker<String>(zooKeeper, new ZKStringDataReader(), p, 1);
trees.put(p, tree);
tree.track(this);
}
return null;
}
}
return tree;
}
代码示例来源:origin: org.fusesource.insight/insight-graph
@Override
public void start() throws LifecycleException {
super.start();
try {
tracker.track();
} catch (Exception e) {
throw new LifecycleException(e.getMessage(), e);
}
}
代码示例来源:origin: org.pongasoft/org.linkedin.zookeeper-impl
private Map<String, TrackedNode<T>> handleNodeDeleted(String path,
Collection<NodeEvent<T>> events)
throws InterruptedException, KeeperException
{
Map<String, TrackedNode<T>> tree = _tree;
if(_tree.containsKey(path))
{
tree = new LinkedHashMap<String, TrackedNode<T>>(_tree);
TrackedNode<T> trackedNode = tree.remove(path);
events.add(new NodeEvent<T>(NodeEventType.DELETED,
trackedNode));
if(log.isDebugEnabled())
log.debug(logString(path, "stop tracking node"));
// after a delete event, we try to track the node again as a delete/add event could happen
// and be undetected otherwise!
trackNode(path, tree, events, trackedNode.getDepth());
}
return tree;
}
代码示例来源:origin: org.fusesource.insight/insight-graph
this.tracker = new ZooKeeperTreeTracker<OutputWriter>(collector.getZkClient(), reader, zkPath);
代码示例来源:origin: org.pongasoft/org.linkedin.zookeeper-impl
public ZooKeeperTreeTracker(IZKClient zk, ZKDataReader<T> zkDataReader, String root, int depth)
{
_zk = zk;
_zkDataReader = zkDataReader;
_root = root;
_rootDepth = computeAbsoluteDepth(_root);
_depth = depth;
}
代码示例来源:origin: org.pongasoft/org.linkedin.zookeeper-impl
log.debug(logString(event.getPath(), "Raising error to " +
LangUtils.identityString(listener)),
th);
log.warn(logString(event.getPath(), "Error in watcher while executing listener " +
LangUtils.identityString(listener) +
" (ignored)"),
代码示例来源:origin: org.pongasoft/org.linkedin.zookeeper-impl
private Map<String, TrackedNode<T>> handleNodeChildrenChanged(String path,
Collection<NodeEvent<T>> events)
throws InterruptedException, KeeperException
{
return trackNode(path,
new LinkedHashMap<String, TrackedNode<T>>(_tree),
events,
computeDepth(path));
}
代码示例来源:origin: org.pongasoft/org.linkedin.zookeeper-impl
log.debug(logString(path, "max depth reached ${depth}"));
trackNode(childPath, tree, events, depth + 1);
_lock.notifyAll();
if(log.isDebugEnabled())
log.debug(logString(path,
"start tracking " + (depth < _depth ? "": "leaf ") +
"node zkTxId=" + newTrackedNode.getZkTxId()));
log.debug(logString(path, "no such node"));
代码示例来源:origin: org.pongasoft/org.linkedin.zookeeper-impl
private int computeDepth(String path)
{
return computeAbsoluteDepth(path) - _rootDepth;
}
代码示例来源:origin: org.fusesource.insight/insight-graph
@Override
public void validateSetup(Query query) throws ValidationException {
Map<String, TrackedNode<OutputWriter>> tree = tracker.getTree();
for (Map.Entry<String, TrackedNode<OutputWriter>> entry : tree.entrySet()) {
String name = entry.getKey();
TrackedNode<OutputWriter> value = entry.getValue();
OutputWriter data = value.getData();
if (data != null) {
configureWriter(data);
data.validateSetup(query);
}
}
}
代码示例来源:origin: org.fusesource.insight/insight-graph
@Override
public void stop() throws LifecycleException {
tracker.destroy();
super.stop();
}
代码示例来源:origin: org.fusesource.insight/insight-graph
@Override
public void doWrite(Query query) throws Exception {
Map<String, TrackedNode<OutputWriter>> tree = tracker.getTree();
for (Map.Entry<String, TrackedNode<OutputWriter>> entry : tree.entrySet()) {
String name = entry.getKey();
TrackedNode<OutputWriter> value = entry.getValue();
OutputWriter data = value.getData();
if (data != null) {
configureWriter(data);
data.doWrite(query);
}
}
}
代码示例来源:origin: org.fusesource.fabric/fabric-configadmin
private void load(String pid, String node, Dictionary dict) throws KeeperException, InterruptedException, IOException {
ZooKeeperTreeTracker<String> tree = track(node);
TrackedNode<String> root = tree != null ? tree.getTree().get(node) : null;
String[] parents = getParents(root);
for (String parent : parents) {
load(pid, ZkProfiles.getPath(version, parent), dict);
}
TrackedNode<String> cfg = tree != null ? tree.getTree().get(node + "/" + pid + ".properties") : null;
if (cfg != null) {
//if (cfg != null && !DELETED.equals(cfg.getData())) {
Properties properties = toProperties(cfg.getData());
// clear out the dict if it had a deleted key.
if (properties.remove(DELETED) != null) {
Enumeration keys = dict.keys();
while (keys.hasMoreElements()) {
dict.remove(keys.nextElement());
}
}
for (Map.Entry<Object, Object> entry : properties.entrySet()) {
if (DELETED.equals(entry.getValue())) {
dict.remove(entry.getKey());
} else {
dict.put(entry.getKey(), entry.getValue());
}
}
}
}
代码示例来源:origin: org.fusesource.fabric/fabric-configadmin
private void getPids(String node, Set<String> pids) throws KeeperException, InterruptedException, IOException {
ZooKeeperTreeTracker<String> tree = track(node);
TrackedNode<String> root = tree != null ? tree.getTree().get(node) : null;
String[] parents = getParents(root);
for (String parent : parents) {
getPids(ZkProfiles.getPath(version, parent), pids);
}
for (String pid : getChildren(tree, node)) {
if (pid.endsWith(".properties")) {
pid = stripSuffix(pid, ".properties");
pids.add(pid);
}
}
}
我正在制作一个简单的跳棋游戏并设置了网格系统,我只想开始设置下面类中显示的参数; #include #include using namespace std; class Tracker { pr
我使用的是 Arch Linux,内核 3.16。 从上周开始,我的两个进程 tracker-extract 和 tracker-store 占用了过多的内存。导致系统每 2 小时挂起一次。 trac
我在单个节点上安装了 hadoop。我使用的操作系统是 Ubuntu。我已经非常成功地为 1st 创建了一个 hduser。当我删除现有的 hduser 并在同一系统中创建一个新的 hduser 时,
在我的 hadoop 安装中,我没有找到 mapred-site.xml 文件,但它有 mapred-site.xml.template。 我已将以下属性添加到 mapred.xml.template
我是hadoop的新手,所以我有一些疑问。如果主节点发生故障,hadoop 集群会发生什么?我们能否在没有任何损失的情况下恢复该节点?是否可以保留一个辅助主节点在当前主节点发生故障时自动切换为主节点?
我已将其发布为issue on GitHub opencv_contrib,但尚未回复。 系统信息(版本) OpenCV => 4.2.0 操作系统/平台=> Windows 10,64位 编译器=>
我正在 laravel 5.2 中安装 Laravel Stats Tracker,并添加我的提供者和门面,设置我的中间件文件、kernel.php 和 config/database.php 文件。
我遇到与Tracker相关的问题。 [InvalidOperationException: Tracker.Current is not initialized] Sitecore.Analyt
Closed. This question is off-topic。它当前不接受答案。 想改善这个问题吗? Update the question,所以它是用于堆栈溢出的on-topic。 7年前关
iOS 上的 Xcode VM Tracker 检测工具中的“交换大小”是什么? iOS 10 有交换功能吗? 最佳答案 它指的是压缩内存,这是iOS处理未使用页面的方式。来源:https://dev
看Tracker.autorun ,这主要是神奇的......但我想知道它如何决定哪些变量将形成计算的依赖关系。它只挑选出“ react 性”变量,例如以下内容: window.bar = 1
我正在使用 Template.onCreated 创建一些模板,然后使用 Tracker.autorun 进行一些订阅,然后从服务器收集数据并将它们存储在客户端的 MiniMongo 上。 然后,我可
我有这样一个 Meteor 应用程序示例: import React from 'react'; import { Meteor } from 'meteor/meteor'; import { re
我有一个已经存在多年的开源 gps 跟踪应用程序。最近,我一直在提示,在 android nougat 中,人们不是每分钟获取一次更新,而是当手机拔下时每五分钟从手机获取一次更新. 尽管我们尝试将其关
我一直在尝试测试新的 Vision API,并让多跟踪器应用在 Android Studio 中运行。 我在手机上运行示例应用程序,但无法检测到任何条形码。我已经测试了 ISBN 码、QR 码和人脸。
我在 mapred-site.xml 中做了一些条目,要选择这些更改,我需要重新启动在集群节点上运行的 TT 和 JT。 我可以从命令行使用云时代管理器 Web 服务重新启动它们吗?因此,我可以在任何
我在足球视频中遇到了一些与 SORT 跟踪器(卡尔曼滤波器和匈牙利算法的组合)与 YOLO v3 相结合相关的问题。正如主论文中也提到的,SORT 在身份切换方面遭受了很多损失(换句话说,即使跟踪对象
我想使用 SDK v4 在 Google Analytics(分析)中设置用户范围维度。该维度的值在运行时永远不会改变。 当我创建维度 following this instructions 时该页面
本文整理了Java中org.linkedin.zookeeper.tracker.ZooKeeperTreeTracker类的一些代码示例,展示了ZooKeeperTreeTracker类的具体用法。
尝试在 Tracker 中将文件(图像)附加到工件上时出现错误: 2018/07/11 13:16:04 [error] 3553#0: *1299 FastCGI sent in stderr: "
我是一名优秀的程序员,十分优秀!