use of org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.KeeperException in project hbase by apache.
the class HBaseAdmin method getMasterAddress.
private ServerName getMasterAddress() throws IOException {
// TODO: Fix! Reaching into internal implementation!!!!
ConnectionImplementation connection = (ConnectionImplementation) this.connection;
ZooKeeperKeepAliveConnection zkw = connection.getKeepAliveZooKeeperWatcher();
try {
return MasterAddressTracker.getMasterAddress(zkw);
} catch (KeeperException e) {
throw new IOException("Failed to get master server name from MasterAddressTracker", e);
}
}
use of org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.KeeperException in project hadoop by apache.
the class ZKClient method getServiceData.
/**
* get data published by the service at the registration address
* @param path the path where the service is registered
* @return the data of the registered service
* @throws IOException
* @throws InterruptedException
*/
public String getServiceData(String path) throws IOException, InterruptedException {
String data;
try {
Stat stat = new Stat();
byte[] byteData = zkClient.getData(path, false, stat);
data = new String(byteData, Charset.forName("UTF-8"));
} catch (KeeperException ke) {
throw new IOException(ke);
}
return data;
}
use of org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.KeeperException in project hadoop by apache.
the class TestActiveStandbyElector method testParentZNodeACLs.
/**
* Test that ACLs are set on parent zNode even if the node already exists.
*/
@Test
public void testParentZNodeACLs() throws Exception {
KeeperException ke = new KeeperException(Code.NODEEXISTS) {
@Override
public Code code() {
return super.code();
}
};
Mockito.when(mockZK.create(Mockito.anyString(), Mockito.eq(new byte[] {}), Mockito.anyListOf(ACL.class), Mockito.eq(CreateMode.PERSISTENT))).thenThrow(ke);
elector.ensureParentZNode();
StringBuilder prefix = new StringBuilder();
for (String part : ZK_PARENT_NAME.split("/")) {
if (part.isEmpty())
continue;
prefix.append("/").append(part);
if (!"/".equals(prefix.toString())) {
Mockito.verify(mockZK).getACL(Mockito.eq(prefix.toString()), Mockito.eq(new Stat()));
Mockito.verify(mockZK).setACL(Mockito.eq(prefix.toString()), Mockito.eq(Ids.OPEN_ACL_UNSAFE), Mockito.anyInt());
}
}
}
use of org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.KeeperException in project pinpoint by naver.
the class DefaultZookeeperClient method delete.
@Override
public void delete(String path) throws PinpointZookeeperException, InterruptedException {
checkState();
ZooKeeper zookeeper = this.zookeeper;
try {
zookeeper.delete(path, -1);
} catch (KeeperException exception) {
if (exception.code() != Code.NONODE) {
handleException(exception);
}
}
}
use of org.apache.flink.shaded.zookeeper3.org.apache.zookeeper.KeeperException in project pinpoint by naver.
the class DefaultZookeeperClient method getData.
@Override
public byte[] getData(String path) throws PinpointZookeeperException, InterruptedException {
checkState();
ZooKeeper zookeeper = this.zookeeper;
try {
return zookeeper.getData(path, false, null);
} catch (KeeperException exception) {
handleException(exception);
}
throw new UnknownException("UnknownException.");
}
Aggregations