本文整理了Java中org.apache.helix.manager.zk.zookeeper.ZkClient.getConnection()
方法的一些代码示例,展示了ZkClient.getConnection()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkClient.getConnection()
方法的具体详情如下:
包路径:org.apache.helix.manager.zk.zookeeper.ZkClient
类名称:ZkClient
方法名:getConnection
暂无
代码示例来源:origin: apache/helix
@Override
public Boolean call() throws Exception {
return getConnection().exists(path, watch);
}
});
代码示例来源:origin: apache/helix
@Override
public Stat call() throws Exception {
Stat stat = ((ZkConnection) getConnection()).getZookeeper().exists(path, false);
return stat;
}
});
代码示例来源:origin: apache/helix
@Override
public String call() throws Exception {
return getConnection().create(path, data, acl, mode);
}
});
代码示例来源:origin: apache/helix
@Override
public List<String> call() throws Exception {
return getConnection().getChildren(path, watch);
}
});
代码示例来源:origin: apache/helix
@Override
public Object call() throws Exception {
getConnection().delete(path);
return null;
}
});
代码示例来源:origin: apache/helix
@Override public Object call() throws Exception {
getConnection().addAuthInfo(scheme, auth);
return null;
}
});
代码示例来源:origin: apache/helix
@Override public Object call() throws Exception {
getConnection().exists(path, true);
return null;
}
});
代码示例来源:origin: apache/helix
@Override public Object call() throws Exception {
return getConnection().writeDataReturnStat(path, data, expectedVersion);
}
});
代码示例来源:origin: apache/helix
@Override public byte[] call() throws Exception {
return getConnection().readData(path, stat, watch);
}
});
代码示例来源:origin: apache/helix
@Override public List<OpResult> call() throws Exception {
return getConnection().multi(ops);
}
});
代码示例来源:origin: apache/helix
@Override public Object call() throws Exception {
((ZkConnection) getConnection()).getZookeeper().exists(path, null, cb,
new ZkAsyncCallbacks.ZkAsyncCallContext(_monitor, startT, 0, true));
return null;
}
});
代码示例来源:origin: apache/helix
@Override public Object call() throws Exception {
((ZkConnection) getConnection()).getZookeeper().create(path, data, ZooDefs.Ids.OPEN_ACL_UNSAFE,
// Arrays.asList(DEFAULT_ACL),
mode, cb, new ZkAsyncCallbacks.ZkAsyncCallContext(_monitor, startT,
data == null ? 0 : data.length, false));
return null;
}
});
代码示例来源:origin: apache/helix
@Override public Object call() throws Exception {
((ZkConnection) getConnection()).getZookeeper().getData(path, null, cb,
new ZkAsyncCallbacks.ZkAsyncCallContext(_monitor, startT, 0, true));
return null;
}
});
代码示例来源:origin: apache/helix
public boolean isConnectionClosed() {
IZkConnection connection = getConnection();
return (connection == null || connection.getZookeeperState() == null ||
!connection.getZookeeperState().isAlive());
}
代码示例来源:origin: apache/helix
@Override public Object call() throws Exception {
((ZkConnection) getConnection()).getZookeeper().setData(path, data, version, cb,
new ZkAsyncCallbacks.ZkAsyncCallContext(_monitor, startT,
data == null ? 0 : data.length, false));
return null;
}
});
代码示例来源:origin: apache/helix
@Override public Object call() throws Exception {
((ZkConnection) getConnection()).getZookeeper().delete(path, -1, cb,
new ZkAsyncCallbacks.ZkAsyncCallContext(_monitor, startT, 0, false));
return null;
}
});
代码示例来源:origin: apache/helix
public long getSessionId() {
ZkConnection zkConnection = ((ZkConnection) getConnection());
ZooKeeper zk = zkConnection.getZookeeper();
if (zk == null) {
throw new HelixException(
"ZooKeeper connection information is not available now. ZkClient might be disconnected.");
} else {
return zkConnection.getZookeeper().getSessionId();
}
}
代码示例来源:origin: apache/helix
@Override
public boolean verify() {
return !((ZkClient) manager._zkclient).getConnection().getZookeeperState().isAlive();
}
}, 3000));
代码示例来源:origin: apache/helix
private void reconnect() {
getEventLock().lock();
try {
ZkConnection connection = ((ZkConnection) getConnection());
connection.reconnect(this);
} catch (InterruptedException e) {
throw new ZkInterruptedException(e);
} finally {
getEventLock().unlock();
}
}
代码示例来源:origin: apache/helix
public long getCreationTime(String path) {
acquireEventLock();
try {
return getConnection().getCreateTime(path);
} catch (KeeperException e) {
throw ZkException.create(e);
} catch (InterruptedException e) {
throw new ZkInterruptedException(e);
} finally {
getEventLock().unlock();
}
}
内容来源于网络,如有侵权,请联系作者删除!