use of org.apache.jackrabbit.oak.plugins.document.Collection.NODES in project jackrabbit-oak by apache.
the class MongoBlobReferenceIterator method getIteratorOverDocsWithBinaries.
@Override
public Iterator<NodeDocument> getIteratorOverDocsWithBinaries() {
Bson query = Filters.eq(NodeDocument.HAS_BINARY_FLAG, NodeDocument.HAS_BINARY_VAL);
// TODO It currently prefers secondary. Would that be Ok?
MongoCursor<BasicDBObject> cursor = documentStore.getDBCollection(NODES).withReadPreference(documentStore.getConfiguredReadPreference(NODES)).find(query).iterator();
return CloseableIterator.wrap(transform(cursor, input -> documentStore.convertFromDBObject(NODES, input)), cursor);
}
use of org.apache.jackrabbit.oak.plugins.document.Collection.NODES in project jackrabbit-oak by apache.
the class MongoMissingLastRevSeeker method getCandidates.
@Override
@Nonnull
public CloseableIterable<NodeDocument> getCandidates(final long startTime) {
Bson query = Filters.gte(NodeDocument.MODIFIED_IN_SECS, NodeDocument.getModifiedInSecs(startTime));
Bson sortFields = new BasicDBObject(NodeDocument.MODIFIED_IN_SECS, 1);
FindIterable<BasicDBObject> cursor = getNodeCollection().withReadPreference(ReadPreference.primary()).find(query).sort(sortFields);
return CloseableIterable.wrap(transform(cursor, input -> store.convertFromDBObject(NODES, input)));
}
use of org.apache.jackrabbit.oak.plugins.document.Collection.NODES in project jackrabbit-oak by apache.
the class MongoVersionGCSupport method logSplitDocIdsTobeDeleted.
private void logSplitDocIdsTobeDeleted(Bson query) {
// Fetch only the id
final BasicDBObject keys = new BasicDBObject(Document.ID, 1);
List<String> ids = new ArrayList<>();
getNodeCollection().withReadPreference(store.getConfiguredReadPreference(NODES)).find(query).projection(keys).forEach((Block<BasicDBObject>) doc -> ids.add(getID(doc)));
StringBuilder sb = new StringBuilder("Split documents with following ids were deleted as part of GC \n");
Joiner.on(StandardSystemProperty.LINE_SEPARATOR.value()).appendTo(sb, ids);
LOG.debug(sb.toString());
}
use of org.apache.jackrabbit.oak.plugins.document.Collection.NODES in project jackrabbit-oak by apache.
the class MongoVersionGCSupport method getPossiblyDeletedDocs.
@Override
public CloseableIterable<NodeDocument> getPossiblyDeletedDocs(final long fromModified, final long toModified) {
// _deletedOnce == true && _modified >= fromModified && _modified < toModified
Bson query = Filters.and(Filters.eq(DELETED_ONCE, true), Filters.gte(MODIFIED_IN_SECS, getModifiedInSecs(fromModified)), Filters.lt(MODIFIED_IN_SECS, getModifiedInSecs(toModified)));
FindIterable<BasicDBObject> cursor = getNodeCollection().withReadPreference(ReadPreference.secondaryPreferred()).find(query).batchSize(batchSize);
return CloseableIterable.wrap(transform(cursor, input -> store.convertFromDBObject(NODES, input)));
}
Aggregations