use of org.apache.curator.framework.api.ProtectACLCreateModePathAndBytesable in project jstorm by alibaba.
the class ZkState method writeBytes.
public void writeBytes(String path, byte[] bytes) {
try {
if (_curator.checkExists().forPath(path) == null) {
CreateBuilder builder = _curator.create();
ProtectACLCreateModePathAndBytesable<String> createAble = (ProtectACLCreateModePathAndBytesable<String>) builder.creatingParentsIfNeeded();
createAble.withMode(CreateMode.PERSISTENT).forPath(path, bytes);
} else {
_curator.setData().forPath(path, bytes);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations