use of org.apache.accumulo.fate.zookeeper.ZooUtil.NodeExistsPolicy in project accumulo by apache.
the class WalStateManager method updateState.
private void updateState(TServerInstance tsi, Path path, WalState state) throws WalMarkerException {
byte[] data = (state + "," + path).getBytes(UTF_8);
try {
NodeExistsPolicy policy = NodeExistsPolicy.OVERWRITE;
if (state == WalState.OPEN) {
policy = NodeExistsPolicy.FAIL;
}
log.debug("Setting {} to {}", path.getName(), state);
zoo.putPersistentData(root() + "/" + tsi + "/" + path.getName(), data, policy);
} catch (KeeperException | InterruptedException e) {
throw new WalMarkerException(e);
}
}
Aggregations