Search in sources :

Example 1 with DELETED_ONCE

use of org.apache.jackrabbit.oak.plugins.document.NodeDocument.DELETED_ONCE 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)));
}
Also used : ReadPreference(com.mongodb.ReadPreference) MongoCollection(com.mongodb.client.MongoCollection) Iterables.transform(com.google.common.collect.Iterables.transform) LoggerFactory(org.slf4j.LoggerFactory) SD_MAX_REV_TIME_IN_SECS(org.apache.jackrabbit.oak.plugins.document.NodeDocument.SD_MAX_REV_TIME_IN_SECS) MODIFIED_IN_SECS(org.apache.jackrabbit.oak.plugins.document.NodeDocument.MODIFIED_IN_SECS) ArrayList(java.util.ArrayList) Collections.singletonList(java.util.Collections.singletonList) Filters(com.mongodb.client.model.Filters) Bson(org.bson.conversions.Bson) Utils(org.apache.jackrabbit.oak.plugins.document.util.Utils) Lists(com.google.common.collect.Lists) CloseableIterable(org.apache.jackrabbit.oak.plugins.document.util.CloseableIterable) StandardSystemProperty(com.google.common.base.StandardSystemProperty) SD_TYPE(org.apache.jackrabbit.oak.plugins.document.NodeDocument.SD_TYPE) NodeDocument(org.apache.jackrabbit.oak.plugins.document.NodeDocument) SplitDocType(org.apache.jackrabbit.oak.plugins.document.NodeDocument.SplitDocType) RevisionVector(org.apache.jackrabbit.oak.plugins.document.RevisionVector) Nonnull(javax.annotation.Nonnull) PATH(org.apache.jackrabbit.oak.plugins.document.NodeDocument.PATH) Revision(org.apache.jackrabbit.oak.plugins.document.Revision) NODES(org.apache.jackrabbit.oak.plugins.document.Collection.NODES) DELETED_ONCE(org.apache.jackrabbit.oak.plugins.document.NodeDocument.DELETED_ONCE) Function(com.google.common.base.Function) SplitDocumentCleanUp(org.apache.jackrabbit.oak.plugins.document.SplitDocumentCleanUp) Logger(org.slf4j.Logger) NodeDocument.getModifiedInSecs(org.apache.jackrabbit.oak.plugins.document.NodeDocument.getModifiedInSecs) BasicDBObject(com.mongodb.BasicDBObject) Set(java.util.Set) VersionGCSupport(org.apache.jackrabbit.oak.plugins.document.VersionGCSupport) VersionGCStats(org.apache.jackrabbit.oak.plugins.document.VersionGarbageCollector.VersionGCStats) TimeUnit(java.util.concurrent.TimeUnit) List(java.util.List) Block(com.mongodb.Block) Clock(org.apache.jackrabbit.oak.stats.Clock) Predicate(com.google.common.base.Predicate) FindIterable(com.mongodb.client.FindIterable) Document(org.apache.jackrabbit.oak.plugins.document.Document) ID(org.apache.jackrabbit.oak.plugins.document.Document.ID) Pattern(java.util.regex.Pattern) Iterables.filter(com.google.common.collect.Iterables.filter) Joiner(com.google.common.base.Joiner) DEFAULT_NO_BRANCH(org.apache.jackrabbit.oak.plugins.document.NodeDocument.SplitDocType.DEFAULT_NO_BRANCH) BasicDBObject(com.mongodb.BasicDBObject) Bson(org.bson.conversions.Bson)

Aggregations

Function (com.google.common.base.Function)1 Joiner (com.google.common.base.Joiner)1 Predicate (com.google.common.base.Predicate)1 StandardSystemProperty (com.google.common.base.StandardSystemProperty)1 Iterables.filter (com.google.common.collect.Iterables.filter)1 Iterables.transform (com.google.common.collect.Iterables.transform)1 Lists (com.google.common.collect.Lists)1 BasicDBObject (com.mongodb.BasicDBObject)1 Block (com.mongodb.Block)1 ReadPreference (com.mongodb.ReadPreference)1 FindIterable (com.mongodb.client.FindIterable)1 MongoCollection (com.mongodb.client.MongoCollection)1 Filters (com.mongodb.client.model.Filters)1 ArrayList (java.util.ArrayList)1 Collections.singletonList (java.util.Collections.singletonList)1 List (java.util.List)1 Set (java.util.Set)1 TimeUnit (java.util.concurrent.TimeUnit)1 Pattern (java.util.regex.Pattern)1 Nonnull (javax.annotation.Nonnull)1