/** * sync update */ @Override public boolean update(String path, DataUpdater<T> updater, int options) { AccessResult result = doUpdate(path, updater, options); return result._retCode == RetCode.OK; }
/** * sync update */ @Override public boolean update(String path, DataUpdater<T> updater, int options) { AccessResult result = doUpdate(path, updater, options); return result._retCode == RetCode.OK; }
@Override public boolean update(String path, DataUpdater<T> updater, 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.doUpdate(serverPath, updater, options); boolean success = (result._retCode == RetCode.OK); updateCache(cache, result._pathCreated, success, serverPath, result._updatedValue, result._stat); return success; } finally { cache.unlockWrite(); } } // no cache return _groupCommit.commit(_baseAccessor, options, serverPath, updater); // return _baseAccessor.update(serverPath, updater, options); }
@Override public boolean update(String path, DataUpdater<T> updater, 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.doUpdate(serverPath, updater, options); boolean success = (result._retCode == RetCode.OK); updateCache(cache, result._pathCreated, success, serverPath, result._updatedValue, result._stat); return success; } finally { cache.unlockWrite(); } } // no cache return _groupCommit.commit(_baseAccessor, options, serverPath, updater); // return _baseAccessor.update(serverPath, updater, options); }