- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.alibaba.otter.shared.common.utils.zookeeper.ZkClientx.exists()
方法的一些代码示例,展示了ZkClientx.exists()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkClientx.exists()
方法的具体详情如下:
包路径:com.alibaba.otter.shared.common.utils.zookeeper.ZkClientx
类名称:ZkClientx
方法名:exists
暂无
代码示例来源:origin: com.alibaba.otter/shared.common
@Override
public List<String> call() throws Exception {
exists(path, true);
try {
return getChildren(path, true);
} catch (ZkNoNodeException e) {
// ignore, the "exists" watch will listen for the parent node to appear
}
return null;
}
});
代码示例来源:origin: com.alibaba.otter/shared.common
public boolean exists(final String path) {
return exists(path, hasListeners(path));
}
代码示例来源:origin: com.alibaba.otter/shared.arbitrate
private void ensureExists(final String path) {
try {
if (zookeeper.exists(path)) {
return;
}
zookeeper.create(path, data, CreateMode.PERSISTENT);
} catch (ZkInterruptedException e) {
Thread.currentThread().interrupt();
interrupt = (InterruptedException) e.getCause();
} catch (ZkException e) {
exception = (KeeperException) e.getCause();
}
}
代码示例来源:origin: com.alibaba.otter/shared.common
@Override
public void run() throws Exception {
// reinstall watch
exists(path, true);
try {
Object data = readData(path, null, true);
listener.handleDataChange(path, data);
} catch (ZkNoNodeException e) {
listener.handleDataDeleted(path);
}
}
});
代码示例来源:origin: com.alibaba.otter/shared.common
public boolean waitUntilExists(String path, TimeUnit timeUnit, long time) throws ZkInterruptedException {
Date timeout = new Date(System.currentTimeMillis() + timeUnit.toMillis(time));
LOG.debug("Waiting until znode '" + path + "' becomes available.");
if (exists(path)) {
return true;
}
acquireEventLock();
try {
while (!exists(path, true)) {
boolean gotSignal = getEventLock().getZNodeEventCondition().awaitUntil(timeout);
if (!gotSignal) {
return false;
}
}
return true;
} catch (InterruptedException e) {
throw new ZkInterruptedException(e);
} finally {
getEventLock().unlock();
}
}
代码示例来源:origin: com.alibaba.otter/shared.common
@Override
public void run() throws Exception {
try {
// if the node doesn't exist we should listen for the root node to reappear
exists(path);
List<String> children = getChildren(path);
listener.handleChildChange(path, children);
} catch (ZkNoNodeException e) {
listener.handleChildChange(path, null);
}
}
});
代码示例来源:origin: com.alibaba.otter/shared.arbitrate
public EtlEventData await(Long pipelineId) throws InterruptedException {
Assert.notNull(pipelineId);
PermitMonitor permitMonitor = ArbitrateFactory.getInstance(pipelineId, PermitMonitor.class);
permitMonitor.waitForPermit();// 阻塞等待授权
RpcStageController stageController = ArbitrateFactory.getInstance(pipelineId, RpcStageController.class);
Long processId = stageController.waitForProcess(StageType.EXTRACT); // 符合条件的processId
ChannelStatus status = permitMonitor.getChannelPermit();
if (status.isStart() || status.isPause()) {// pause状态也让其处理,避免误删除pause状态的processId,导致通道挂起
EtlEventData eventData = stageController.getLastData(processId);
Node node = LoadBalanceFactory.getNextTransformNode(pipelineId);// 获取下一个处理节点信息
if (node == null) {// 没有后端节点
throw new ArbitrateException("Extract_single", "no next node");
} else {
eventData.setNextNid(node.getId());
return eventData;// 只有这一条路返回
}
} else {
logger.warn("pipelineId[{}] extract ignore processId[{}] by status[{}]", new Object[] { pipelineId,
processId, status });
String path = StagePathUtils.getProcess(pipelineId, processId);
zookeeper.exists(path);
return await(pipelineId);// 递归调用
}
}
代码示例来源:origin: com.alibaba.otter/shared.arbitrate
public EtlEventData await(Long pipelineId) throws InterruptedException {
Assert.notNull(pipelineId);
PermitMonitor permitMonitor = ArbitrateFactory.getInstance(pipelineId, PermitMonitor.class);
permitMonitor.waitForPermit();// 阻塞等待授权
RpcStageController stageController = ArbitrateFactory.getInstance(pipelineId, RpcStageController.class);
Long processId = stageController.waitForProcess(StageType.LOAD); // 符合条件的processId
ChannelStatus status = permitMonitor.getChannelPermit();
if (status.isStart()) {// 即时查询一下当前的状态,状态随时可能会变
return stageController.getLastData(processId);
} else {
// 需要进一步check,避免丢失load信号
status = permitMonitor.getChannelPermit(true);
if (status.isStart()) {
return stageController.getLastData(processId);
} else if (status.isPause()) {
String path = StagePathUtils.getProcess(pipelineId, processId);
if (zookeeper.exists(path)) { // 如果存在process,那说明没有被rollback掉(可能刚好在做rollback),这种运行进行load处理
return stageController.getLastData(processId);
}
}
logger.warn("pipelineId[{}] load ignore processId[{}] by status[{}]", new Object[] { pipelineId, processId,
status });
return await(pipelineId);// 递归调用
}
}
本文整理了Java中com.alibaba.otter.canal.common.zookeeper.ZkClientx类的一些代码示例,展示了ZkClientx类的具体用法。这些代码示例主要来源于G
本文整理了Java中com.alibaba.otter.canal.common.zookeeper.ZookeeperPathUtils类的一些代码示例,展示了ZookeeperPathUtils类
本文整理了Java中com.alibaba.otter.shared.common.utils.zookeeper.ZkClientx类的一些代码示例,展示了ZkClientx类的具体用法。这些代码示
本文整理了Java中com.alibaba.otter.canal.common.zookeeper.ZkClientx.readData()方法的一些代码示例,展示了ZkClientx.readDa
本文整理了Java中com.alibaba.otter.canal.common.zookeeper.ZkClientx.unsubscribeDataChanges()方法的一些代码示例,展示了Zk
本文整理了Java中com.alibaba.otter.canal.common.zookeeper.ZkClientx.getChildren()方法的一些代码示例,展示了ZkClientx.get
本文整理了Java中com.alibaba.otter.canal.common.zookeeper.ZkClientx.writeData()方法的一些代码示例,展示了ZkClientx.write
本文整理了Java中com.alibaba.otter.canal.common.zookeeper.ZkClientx.delete()方法的一些代码示例,展示了ZkClientx.delete()
本文整理了Java中com.alibaba.otter.canal.common.zookeeper.ZkClientx.subscribeDataChanges()方法的一些代码示例,展示了ZkCl
本文整理了Java中com.alibaba.otter.canal.common.zookeeper.ZkClientx.createPersistent()方法的一些代码示例,展示了ZkClient
本文整理了Java中com.alibaba.otter.canal.common.zookeeper.ZkClientx.createPersistentSequential()方法的一些代码示例,展
本文整理了Java中com.alibaba.otter.canal.common.zookeeper.ZkClientx.create()方法的一些代码示例,展示了ZkClientx.create()
本文整理了Java中com.alibaba.otter.canal.common.zookeeper.ZkClientx.getZkClient()方法的一些代码示例,展示了ZkClientx.get
本文整理了Java中com.alibaba.otter.canal.common.zookeeper.ZookeeperPathUtils.getDestinationServerRunning()方
本文整理了Java中com.alibaba.otter.canal.common.zookeeper.ZookeeperPathUtils.getDestinationPath()方法的一些代码示例,
本文整理了Java中com.alibaba.otter.shared.common.utils.zookeeper.ZkClientx.createPersistent()方法的一些代码示例,展示了Z
本文整理了Java中com.alibaba.otter.shared.common.utils.zookeeper.ZkClientx.delete()方法的一些代码示例,展示了ZkClientx.d
本文整理了Java中com.alibaba.otter.shared.common.utils.zookeeper.ZkClientx.create()方法的一些代码示例,展示了ZkClientx.c
本文整理了Java中com.alibaba.otter.shared.common.utils.zookeeper.ZkClientx.deleteRecursive()方法的一些代码示例,展示了Zk
本文整理了Java中com.alibaba.otter.shared.common.utils.zookeeper.ZkClientx.getChildren()方法的一些代码示例,展示了ZkClie
我是一名优秀的程序员,十分优秀!