/** * sync create */ @Override public boolean create(String path, T record, int options) { AccessResult result = doCreate(path, record, options); return result._retCode == RetCode.OK; }
/** * sync create */ @Override public boolean create(String path, T record, int options) { AccessResult result = doCreate(path, record, options); return result._retCode == RetCode.OK; }
AccessResult res = doCreate(parentPath, null, AccessOption.PERSISTENT); result._pathCreated.addAll(res._pathCreated); RetCode rc = res._retCode;
AccessResult res = doCreate(parentPath, null, AccessOption.PERSISTENT); result._pathCreated.addAll(res._pathCreated); RetCode rc = res._retCode;
AccessResult res = doCreate(path, record, options); result._pathCreated.addAll(res._pathCreated); RetCode rc = res._retCode;
AccessResult res = doCreate(path, record, options); result._pathCreated.addAll(res._pathCreated); RetCode rc = res._retCode;
RetCode rc; if (newData != null) { AccessResult res = doCreate(path, newData, options); result._pathCreated.addAll(res._pathCreated); rc = res._retCode;
RetCode rc; if (newData != null) { AccessResult res = doCreate(path, newData, options); result._pathCreated.addAll(res._pathCreated); rc = res._retCode;
@Override public boolean create(String path, T data, int options) { String clientPath = path; String serverPath = prependChroot(clientPath); Cache<T> cache = getCache(serverPath); if (cache != null) { try { cache.lockWrite(); ZkBaseDataAccessor<T>.AccessResult result = _baseAccessor.doCreate(serverPath, data, options); boolean success = (result._retCode == RetCode.OK); updateCache(cache, result._pathCreated, success, serverPath, data, ZNode.ZERO_STAT); return success; } finally { cache.unlockWrite(); } } // no cache return _baseAccessor.create(serverPath, data, options); }
@Override public boolean create(String path, T data, int options) { String clientPath = path; String serverPath = prependChroot(clientPath); Cache<T> cache = getCache(serverPath); if (cache != null) { try { cache.lockWrite(); ZkBaseDataAccessor<T>.AccessResult result = _baseAccessor.doCreate(serverPath, data, options); boolean success = (result._retCode == RetCode.OK); updateCache(cache, result._pathCreated, success, serverPath, data, ZNode.ZERO_STAT); return success; } finally { cache.unlockWrite(); } } // no cache return _baseAccessor.create(serverPath, data, options); }