use of org.apache.jackrabbit.oak.plugins.document.NodeDocument.SplitDocType in project jackrabbit-oak by apache.
the class MongoVersionGCSupport method createQuery.
private DBObject createQuery(Set<SplitDocType> gcTypes, RevisionVector sweepRevs, long oldestRevTimeStamp) {
List<Integer> gcTypeCodes = Lists.newArrayList();
QueryBuilder orClause = start();
for (SplitDocType type : gcTypes) {
gcTypeCodes.add(type.typeCode());
for (DBObject query : queriesForType(type, sweepRevs)) {
orClause.or(query);
}
}
return start().and(start(SD_TYPE).in(gcTypeCodes).get(), orClause.get(), start(NodeDocument.SD_MAX_REV_TIME_IN_SECS).lessThan(NodeDocument.getModifiedInSecs(oldestRevTimeStamp)).get()).get();
}
use of org.apache.jackrabbit.oak.plugins.document.NodeDocument.SplitDocType in project jackrabbit-oak by apache.
the class SplitOperations method setSplitDocProps.
/**
* Set various split document related flag/properties
*
* @param mainDoc main document from which split document is being created
* @param old updateOp of the old document created via split
* @param oldDoc old document created via split
* @param maxRev max revision stored in the split document oldDoc
*/
private static void setSplitDocProps(NodeDocument mainDoc, NodeDocument oldDoc, UpdateOp old, Revision maxRev) {
setSplitDocMaxRev(old, maxRev);
SplitDocType type = SplitDocType.DEFAULT;
if (!mainDoc.hasChildren()) {
type = SplitDocType.DEFAULT_LEAF;
} else if (oldDoc.getLocalRevisions().isEmpty()) {
type = SplitDocType.COMMIT_ROOT_ONLY;
} else if (oldDoc.getLocalBranchCommits().isEmpty()) {
type = SplitDocType.DEFAULT_NO_BRANCH;
}
// Copy over the hasBinary flag
if (mainDoc.hasBinary()) {
setHasBinary(old);
}
setSplitDocType(old, type);
}
Aggregations