// write back _lastRev with background thread
unsaved.put(path, rev);
}
}
if (isNew) {
CacheValue key = childNodeCacheKey(path, rev, null);
DocumentNodeState.Children c = new DocumentNodeState.Children();
Set<String> set = Sets.newTreeSet();
for (String p : added) {
set.add(Utils.unshareString(PathUtils.getName(p)));
}
c.children.addAll(set);
nodeChildrenCache.put(key, c);
}
// update diff cache
JsopWriter w = new JsopStream();
for (String p : added) {
w.tag('+').key(PathUtils.getName(p)).object().endObject().newline();
}
for (String p : removed) {
w.tag('-').value(PathUtils.getName(p)).newline();
}
for (String p : changed) {
w.tag('^').key(PathUtils.getName(p)).object().endObject().newline();
}
cacheEntry.append(path, w.toString());
// update docChildrenCache
if (!added.isEmpty()) {
CacheValue docChildrenKey = new StringValue(path);
NodeDocument.Children docChildren = docChildrenCache.getIfPresent(docChildrenKey);
if (docChildren != null) {
int currentSize = docChildren.childNames.size();
NavigableSet<String> names = Sets.newTreeSet(docChildren.childNames);
// incomplete cache entries must not be updated with