@Override public boolean[] setChildren(List<String> paths, List<T> records, int options) { final int size = paths.size(); List<String> serverPaths = prependChroot(paths); Cache<T> cache = getCache(serverPaths); if (cache != null) { try { cache.lockWrite(); List<Stat> setStats = new ArrayList<Stat>(); List<List<String>> pathsCreatedList = new ArrayList<List<String>>(Collections.<List<String>> nCopies(size, null)); boolean[] success = _baseAccessor.set(serverPaths, records, pathsCreatedList, setStats, options); for (int i = 0; i < size; i++) { updateCache(cache, pathsCreatedList.get(i), success[i], serverPaths.get(i), records.get(i), setStats.get(i)); } return success; } finally { cache.unlockWrite(); } } return _baseAccessor.setChildren(serverPaths, records, options); }
@Override public boolean[] setChildren(List<String> paths, List<T> records, int options) { final int size = paths.size(); List<String> serverPaths = prependChroot(paths); Cache<T> cache = getCache(serverPaths); if (cache != null) { try { cache.lockWrite(); List<Stat> setStats = new ArrayList<Stat>(); List<List<String>> pathsCreatedList = new ArrayList<List<String>>(Collections.<List<String>>nCopies(size, null)); boolean[] success = _baseAccessor.set(serverPaths, records, pathsCreatedList, setStats, options); for (int i = 0; i < size; i++) { updateCache(cache, pathsCreatedList.get(i), success[i], serverPaths.get(i), records.get(i), setStats.get(i)); } return success; } finally { cache.unlockWrite(); } } return _baseAccessor.setChildren(serverPaths, records, options); }
records.add(record); success = extBaseAccessor.setChildren(paths, records, AccessOption.PERSISTENT); for (int i = 0; i < 10; i++) { Assert.assertTrue(success[i], "Should succeed in set: " + paths.get(i));
records.add(newRecord); success = accessor.setChildren(paths, records, AccessOption.PERSISTENT); for (int i = 0; i < 10; i++) { String msgId = "msg_" + i;