use of org.apache.jackrabbit.oak.spi.mount.Mount in project jackrabbit-oak by apache.
the class MultiplexingIndexWriter method deleteDocuments.
@Override
public void deleteDocuments(String path) throws IOException {
Mount mount = mountInfoProvider.getMountByPath(path);
getWriter(mount).deleteDocuments(path);
// Note that one mount cannot be part of another mount
if (mount.isDefault()) {
// If any mount falls under given path then delete all documents in that
for (Mount m : mountInfoProvider.getMountsPlacedUnder(path)) {
getWriter(m).deleteAll();
}
}
}
use of org.apache.jackrabbit.oak.spi.mount.Mount in project jackrabbit-oak by apache.
the class NodeCounterEditor method leaveNew.
public void leaveNew(NodeState before, NodeState after) throws CommitFailedException {
if (countOffsets.isEmpty()) {
return;
}
root.callback.indexUpdate();
for (Map.Entry<Mount, Integer> e : countOffsets.entrySet()) {
NodeBuilder builder = getBuilder(e.getKey());
int countOffset = e.getValue();
PropertyState p = builder.getProperty(COUNT_HASH_PROPERTY_NAME);
long count = p == null ? 0 : p.getValue(Type.LONG);
count += countOffset;
if (count <= 0) {
if (builder.getChildNodeCount(1) >= 0) {
builder.removeProperty(COUNT_HASH_PROPERTY_NAME);
} else {
builder.remove();
}
} else {
builder.setProperty(COUNT_HASH_PROPERTY_NAME, count);
}
}
}
Aggregations