use of org.apache.accumulo.fate.AdminUtil.FateStatus in project accumulo by apache.
the class FunctionalTestUtils method getFateStatus.
private static FateStatus getFateStatus(Instance instance, AccumuloCluster cluster) {
try {
AdminUtil<String> admin = new AdminUtil<>(false);
String secret = cluster.getSiteConfiguration().get(Property.INSTANCE_SECRET);
IZooReaderWriter zk = new ZooReaderWriterFactory().getZooReaderWriter(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut(), secret);
ZooStore<String> zs = new ZooStore<>(ZooUtil.getRoot(instance) + Constants.ZFATE, zk);
FateStatus fateStatus = admin.getStatus(zs, zk, ZooUtil.getRoot(instance) + Constants.ZTABLE_LOCKS, null, null);
return fateStatus;
} catch (KeeperException | InterruptedException e) {
throw new RuntimeException(e);
}
}
use of org.apache.accumulo.fate.AdminUtil.FateStatus in project accumulo by apache.
the class FunctionalTestUtils method assertNoDanglingFateLocks.
public static void assertNoDanglingFateLocks(Instance instance, AccumuloCluster cluster) {
FateStatus fateStatus = getFateStatus(instance, cluster);
Assert.assertEquals("Dangling FATE locks : " + fateStatus.getDanglingHeldLocks(), 0, fateStatus.getDanglingHeldLocks().size());
Assert.assertEquals("Dangling FATE locks : " + fateStatus.getDanglingWaitingLocks(), 0, fateStatus.getDanglingWaitingLocks().size());
}
Aggregations