/** * Entry point to seed the local {@link AuthenticationKey} cache from ZooKeeper and set the first * watcher for future updates in ZooKeeper. */ public void updateAuthKeys() throws KeeperException, InterruptedException { // Might cause two watchers on baseNode, but only at startup for each tserver. if (zk.exists(baseNode, this)) { log.info("Added {} existing AuthenticationKeys to local cache from ZooKeeper", updateAuthKeys(baseNode)); } }
@Override public boolean transactionComplete(String type, long tid) throws Exception { String path = context.getZooKeeperRoot() + "/" + type + "/" + tid + "-running"; rdr.sync(path); return !rdr.exists(path); } }
@Override public boolean transactionAlive(String type, long tid) throws Exception { String path = context.getZooKeeperRoot() + "/" + type + "/" + tid; rdr.sync(path); return rdr.exists(path); }
@Override public boolean isPropertySet(Property prop, boolean cacheAndWatch) { if (fixedProps.containsKey(prop.getKey())) { return true; } if (cacheAndWatch) { if (getRaw(prop.getKey()) != null) { return true; } } else { ZooReader zr = context.getZooReaderWriter(); String zPath = propPathPrefix + "/" + prop.getKey(); try { if (zr.exists(zPath)) { return true; } } catch (KeeperException | InterruptedException e) { throw new IllegalStateException(e); } } return parent.isPropertySet(prop, cacheAndWatch); }
/** * Entry point to seed the local {@link AuthenticationKey} cache from ZooKeeper and set the first * watcher for future updates in ZooKeeper. */ public void updateAuthKeys() throws KeeperException, InterruptedException { // Might cause two watchers on baseNode, but only at startup for each tserver. if (zk.exists(baseNode, this)) { log.info("Added {} existing AuthenticationKeys to local cache from ZooKeeper", updateAuthKeys(baseNode)); } }
@Override public boolean transactionAlive(String type, long tid) throws Exception { String path = ZooUtil.getRoot(instance) + "/" + type + "/" + tid; rdr.sync(path); return rdr.exists(path); }
@Override public boolean transactionComplete(String type, long tid) throws Exception { String path = ZooUtil.getRoot(instance) + "/" + type + "/" + tid + "-running"; rdr.sync(path); return !rdr.exists(path); } }
@Override public boolean transactionAlive(String type, long tid) throws Exception { String path = ZooUtil.getRoot(instance) + "/" + type + "/" + tid; rdr.sync(path); return rdr.exists(path); }
@Override public boolean transactionComplete(String type, long tid) throws Exception { String path = ZooUtil.getRoot(instance) + "/" + type + "/" + tid + "-running"; rdr.sync(path); return !rdr.exists(path); } }