Search in sources :

Example 1 with FateStatus

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);
    }
}
Also used : AdminUtil(org.apache.accumulo.fate.AdminUtil) IZooReaderWriter(org.apache.accumulo.fate.zookeeper.IZooReaderWriter) ZooStore(org.apache.accumulo.fate.ZooStore) ZooReaderWriterFactory(org.apache.accumulo.server.zookeeper.ZooReaderWriterFactory) FateStatus(org.apache.accumulo.fate.AdminUtil.FateStatus) KeeperException(org.apache.zookeeper.KeeperException)

Example 2 with FateStatus

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());
}
Also used : FateStatus(org.apache.accumulo.fate.AdminUtil.FateStatus)

Aggregations

FateStatus (org.apache.accumulo.fate.AdminUtil.FateStatus)2 AdminUtil (org.apache.accumulo.fate.AdminUtil)1 ZooStore (org.apache.accumulo.fate.ZooStore)1 IZooReaderWriter (org.apache.accumulo.fate.zookeeper.IZooReaderWriter)1 ZooReaderWriterFactory (org.apache.accumulo.server.zookeeper.ZooReaderWriterFactory)1 KeeperException (org.apache.zookeeper.KeeperException)1