- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.registerListener()
方法的一些代码示例,展示了ZooKeeperWatcher.registerListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperWatcher.registerListener()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher
类名称:ZooKeeperWatcher
方法名:registerListener
[英]Register the specified listener to receive ZooKeeper events.
[中]注册指定的侦听器以接收ZooKeeper事件。
代码示例来源:origin: harbby/presto-connectors
/**
* @param watcher
* @param sn ServerName
* @param master In an instance of a Master.
*/
ActiveMasterManager(ZooKeeperWatcher watcher, ServerName sn, Server master) {
super(watcher);
watcher.registerListener(this);
this.sn = sn;
this.master = master;
}
代码示例来源:origin: harbby/presto-connectors
/**
* Construct a ZooKeeper event listener.
*/
public RecoveringRegionWatcher(ZooKeeperWatcher watcher, HRegionServer server) {
super(watcher);
watcher.registerListener(this);
this.server = server;
}
代码示例来源:origin: co.cask.hbase/hbase
public void registerRegionServerListener(ZooKeeperListener listener) {
this.zookeeper.registerListener(listener);
}
代码示例来源:origin: harbby/presto-connectors
@Override
public void registerListener() {
watcher.registerListener(this);
}
代码示例来源:origin: XiaoMi/themis
public void start() throws KeeperException, IOException {
watcher.registerListener(this);
loadAliveClients();
}
代码示例来源:origin: harbby/presto-connectors
public ReplicationTrackerZKImpl(ZooKeeperWatcher zookeeper,
final ReplicationPeers replicationPeers, Configuration conf, Abortable abortable,
Stoppable stopper) {
super(zookeeper, conf, abortable);
this.replicationPeers = replicationPeers;
this.stopper = stopper;
this.zookeeper.registerListener(new OtherRegionServerWatcher(this.zookeeper));
this.zookeeper.registerListener(new PeersWatcher(this.zookeeper));
}
代码示例来源:origin: harbby/presto-connectors
@Override
public void init() throws IOException {
this.zkretries = conf.getLong("hbase.splitlog.zk.retries", DEFAULT_ZK_RETRIES);
this.resubmitThreshold = conf.getLong("hbase.splitlog.max.resubmit", DEFAULT_MAX_RESUBMIT);
this.timeout = conf.getInt(HConstants.HBASE_SPLITLOG_MANAGER_TIMEOUT, DEFAULT_TIMEOUT);
setRecoveryMode(true);
if (this.watcher != null) {
this.watcher.registerListener(this);
lookForOrphans();
}
}
代码示例来源:origin: com.aliyun.hbase/alihbase-client
private void init(){
try {
ZKUtil2.createWithParents(watcher, node);
} catch (KeeperException e) {
LOG.warn("create vhost root node failed, pub-network still disabled.", e);
return;
}
this.watcher.registerListener(this);
updateVhostMap();
}
代码示例来源:origin: harbby/presto-connectors
private TableHFileArchiveTracker(ZooKeeperWatcher watcher, HFileArchiveTableMonitor monitor) {
super(watcher);
watcher.registerListener(this);
this.monitor = monitor;
this.archiveHFileZNode = ZKTableArchiveClient.getArchiveZNode(watcher.getConfiguration(),
watcher);
}
代码示例来源:origin: harbby/presto-connectors
/**
* Starts the tracking of draining RegionServers.
*
* <p>All Draining RSs will be tracked after this method is called.
*
* @throws KeeperException
*/
public void start() throws KeeperException, IOException {
watcher.registerListener(this);
List<String> servers =
ZKUtil.listChildrenAndWatchThem(watcher, watcher.drainingZNode);
add(servers);
}
代码示例来源:origin: co.cask.hbase/hbase
/**
* Starts the tracking of draining RegionServers.
*
* <p>All Draining RSs will be tracked after this method is called.
*
* @throws KeeperException
*/
public void start() throws KeeperException, IOException {
watcher.registerListener(this);
List<String> servers =
ZKUtil.listChildrenAndWatchThem(watcher, watcher.drainingZNode);
add(servers);
}
代码示例来源:origin: co.cask.hbase/hbase
/**
* Starts the tracking of online RegionServers.
*
* <p>All RSs will be tracked after this method is called.
*
* @throws KeeperException
* @throws IOException
*/
public void start() throws KeeperException, IOException {
watcher.registerListener(this);
List<String> servers =
ZKUtil.listChildrenAndWatchThem(watcher, watcher.rsZNode);
add(servers);
}
代码示例来源:origin: harbby/presto-connectors
/**
* Starts the tracking of online RegionServers.
*
* <p>All RSs will be tracked after this method is called.
*
* @throws KeeperException
* @throws IOException
*/
public void start() throws KeeperException, IOException {
watcher.registerListener(this);
List<String> servers =
ZKUtil.listChildrenAndWatchThem(watcher, watcher.rsZNode);
add(servers);
}
代码示例来源:origin: harbby/presto-connectors
public void start() throws KeeperException {
try {
watcher.registerListener(this);
if (ZKUtil.watchAndCheckExists(watcher, aclZNode)) {
List<ZKUtil.NodeAndData> existing =
ZKUtil.getChildDataAndWatchForNewChildren(watcher, aclZNode);
if (existing != null) {
refreshNodes(existing);
}
}
} finally {
initialized.countDown();
}
}
代码示例来源:origin: co.cask.hbase/hbase
public void finishInitialization(boolean masterRecovery) {
if (!masterRecovery) {
Threads.setDaemonThreadRunning(timeoutMonitor.getThread(), serverName
+ ".splitLogManagerTimeoutMonitor");
}
// Watcher can be null during tests with Mock'd servers.
if (this.watcher != null) {
this.watcher.registerListener(this);
lookForOrphans();
}
}
代码示例来源:origin: harbby/presto-connectors
public void start() throws KeeperException {
watcher.registerListener(this);
// make sure the base node exists
ZKUtil.createWithParents(watcher, keysParentZNode);
if (ZKUtil.watchAndCheckExists(watcher, keysParentZNode)) {
List<ZKUtil.NodeAndData> nodes =
ZKUtil.getChildDataAndWatchForNewChildren(watcher, keysParentZNode);
refreshNodes(nodes);
}
}
代码示例来源:origin: co.cask.hbase/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());
}
}
代码示例来源:origin: harbby/presto-connectors
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());
}
}
代码示例来源:origin: harbby/presto-connectors
/**
* Closes the current ZKW (if not null) and creates a new one
* @throws IOException If anything goes wrong connecting
*/
void reloadZkWatcher() throws IOException {
if (zkw != null) zkw.close();
zkw = new ZooKeeperWatcher(ctx.getConfiguration(),
"connection to cluster: " + ctx.getPeerId(), this);
getZkw().registerListener(new PeerRegionServerListener(this));
}
代码示例来源:origin: harbby/presto-connectors
public void start() throws KeeperException {
watcher.registerListener(this);
ZKUtil.createWithParents(watcher, labelZnode);
ZKUtil.createWithParents(watcher, userAuthsZnode);
byte[] data = ZKUtil.getDataAndWatch(watcher, labelZnode);
if (data != null && data.length > 0) {
refreshVisibilityLabelsCache(data);
}
data = ZKUtil.getDataAndWatch(watcher, userAuthsZnode);
if (data != null && data.length > 0) {
refreshUserAuthsCache(data);
}
}
在审查这篇文章Android: I want to shake it ,评分最高的答案说您应该取消注册并重新注册加速度计 onStop 和 onResume 的监听器以节省电池生命周期。 我的问题是我
我有一个为 Cordova 应用程序编写的 Android 后台服务,我想通过 sensorManager 与加速度计进行交互。 我觉得我已经很接近了,但我认为还不够。 出于某种原因,sensorMa
@Override protected void onResume(){ //super.onResume(); sensorManager.registerListener
我正在尝试从 Android 手机传感器读取值。我按如下方式初始化传感器: private void sensorInit() { sensorManager = (SensorManager
我不明白怎么用这个方法, sensorManager.registerListener(SensorEventListener listener, Sensor sensor, int rate, H
本文整理了Java中org.apache.pulsar.zookeeper.ZooKeeperDataCache.registerListener()方法的一些代码示例,展示了ZooKeeperDat
本文整理了Java中org.apache.pulsar.zookeeper.ZooKeeperChildrenCache.registerListener()方法的一些代码示例,展示了ZooKeepe
本文整理了Java中com.yahoo.pulsar.zookeeper.ZooKeeperChildrenCache.registerListener()方法的一些代码示例,展示了ZooKeeper
本文整理了Java中com.twitter.distributedlog.impl.ZKNamespaceWatcher.registerListener()方法的一些代码示例,展示了ZKNamesp
本文整理了Java中com.alibaba.wasp.zookeeper.ZooKeeperWatcher.registerListener()方法的一些代码示例,展示了ZooKeeperWatche
本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZKWatcher.registerListener()方法的一些代码示例,展示了ZKWatcher.regis
本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.registerListener()方法的一些代码示例,展示了ZooKeepe
本文整理了Java中org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore.registerListener()方法的一些代码示例
更新: 我能够通过引入类范围静态计数器并忽略 x 数量的事件来解决我遇到的特定问题。但我仍然想知道我做错了什么:以微秒为单位用提示注册监听器,而不是使用四个给定常量之一。 我的应用程序中的一个 Act
我是一名优秀的程序员,十分优秀!