test_class.declarator: c
test_class.modifier: private
test_class.original_string: private MongoConnection c;
test_class.type: MongoConnection
test_class.var_name: c
test_class.declarator: dbName
test_class.modifier: private
test_class.original_string: private String dbName;
test_class.type: String
test_class.var_name: dbName
test_class.declarator: builder
test_class.modifier: private
test_class.original_string: private DocumentMK.Builder builder;
test_class.type: DocumentMK.Builder
test_class.var_name: builder
test_class.declarator: store
test_class.modifier: private
test_class.original_string: private MongoDocumentStore store;
test_class.type: MongoDocumentStore
test_class.var_name: store
test_class.declarator: ns
test_class.modifier: private
test_class.original_string: private DocumentNodeStore ns;
test_class.type: DocumentNodeStore
test_class.var_name: ns
test_class.file: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoMissingLastRevSeekerTest.java
test_class.identifier: MongoMissingLastRevSeekerTest
test_case.body: @Test
      public void completeResult() throws Exception {
          final int NUM_DOCS = 200;
          // populate the store
          List<UpdateOp> ops = Lists.newArrayList();
          for (int i = 0; i < NUM_DOCS; i++) {
              UpdateOp op = new UpdateOp(getIdFromPath("/node-" + i), true);
              NodeDocument.setModified(op, new Revision(i * 5000, 0, 1));
              ops.add(op);
          }
          assertTrue(store.create(NODES, ops));
  
          Set<String> ids = Sets.newHashSet();
          boolean updated = false;
          MissingLastRevSeeker seeker = builder.createMissingLastRevSeeker();
          for (NodeDocument doc : seeker.getCandidates(0)) {
              if (!updated) {
                  // as soon as we have the first document, update /node-0
                  UpdateOp op = new UpdateOp(getIdFromPath("/node-0"), false);
                  // and push out the _modified timestamp
                  NodeDocument.setModified(op, new Revision(NUM_DOCS * 5000, 0, 1));
                  // even after the update the document matches the query
                  assertNotNull(store.findAndUpdate(NODES, op));
                  updated = true;
              }
              if (doc.getPath().toString().startsWith("/node-")) {
                  ids.add(doc.getId());
              }
          }
          // seeker must return all documents
          assertEquals(NUM_DOCS, ids.size());
      }
test_case.class_method_signature: MongoMissingLastRevSeekerTest.completeResult()
test_case.full_signature: @Test public void completeResult()
test_case.identifier: completeResult
test_case.invocations: newArrayList getIdFromPath setModified add assertTrue create newHashSet createMissingLastRevSeeker getCandidates getIdFromPath setModified assertNotNull findAndUpdate startsWith toString getPath add getId assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void completeResult()
focal_class.declarator: store
focal_class.modifier: private final
focal_class.original_string: private final MongoDocumentStore store;
focal_class.type: MongoDocumentStore
focal_class.var_name: store
focal_class.file: oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoMissingLastRevSeeker.java
focal_class.identifier: MongoMissingLastRevSeeker
focal_class.class_method_signature: MongoMissingLastRevSeeker.MongoMissingLastRevSeeker(MongoDocumentStore store, Clock clock)
focal_class.full_signature: public  MongoMissingLastRevSeeker(MongoDocumentStore store, Clock clock)
focal_class.identifier: MongoMissingLastRevSeeker
focal_class.modifiers: public
focal_class.parameters: (MongoDocumentStore store, Clock clock)
focal_class.signature:  MongoMissingLastRevSeeker(MongoDocumentStore store, Clock clock)
focal_class.class_method_signature: MongoMissingLastRevSeeker.getCandidates(final long startTime)
focal_class.full_signature: @Override @NotNull public CloseableIterable<NodeDocument> getCandidates(final long startTime)
focal_class.identifier: getCandidates
focal_class.modifiers: @Override @NotNull public
focal_class.parameters: (final long startTime)
focal_class.return: CloseableIterable<NodeDocument>
focal_class.signature: CloseableIterable<NodeDocument> getCandidates(final long startTime)
focal_class.class_method_signature: MongoMissingLastRevSeeker.isRecoveryNeeded()
focal_class.full_signature: @Override public boolean isRecoveryNeeded()
focal_class.identifier: isRecoveryNeeded
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isRecoveryNeeded()
focal_class.class_method_signature: MongoMissingLastRevSeeker.getNodeCollection()
focal_class.full_signature: private MongoCollection<BasicDBObject> getNodeCollection()
focal_class.identifier: getNodeCollection
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: MongoCollection<BasicDBObject>
focal_class.signature: MongoCollection<BasicDBObject> getNodeCollection()
focal_class.class_method_signature: MongoMissingLastRevSeeker.getClusterNodeCollection()
focal_class.full_signature: private MongoCollection<BasicDBObject> getClusterNodeCollection()
focal_class.identifier: getClusterNodeCollection
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: MongoCollection<BasicDBObject>
focal_class.signature: MongoCollection<BasicDBObject> getClusterNodeCollection()
focal_class.superclass: extends MissingLastRevSeeker
focal_method.body: @Override
      @NotNull
      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()
                  .find(query).sort(sortFields);
          return CloseableIterable.wrap(transform(cursor,
                  input -> store.convertFromDBObject(NODES, input)));
      }
focal_method.class_method_signature: MongoMissingLastRevSeeker.getCandidates(final long startTime)
focal_method.full_signature: @Override @NotNull public CloseableIterable<NodeDocument> getCandidates(final long startTime)
focal_method.identifier: getCandidates
focal_method.invocations: gte getModifiedInSecs sort find getNodeCollection wrap transform convertFromDBObject
focal_method.modifiers: @Override @NotNull public
focal_method.parameters: (final long startTime)
focal_method.return: CloseableIterable<NodeDocument>
focal_method.signature: CloseableIterable<NodeDocument> getCandidates(final long startTime)