Package com.findwise.hydra.mongodb

Examples of com.findwise.hydra.mongodb.MongoTailableIterator


    // Next, we add three documents with a field "externalDocId" to let us identify them
    Set<String> externalDocumentIds = createDocuments(3);

    // Now we just have to wait for all three documents to end up in the "oldDocuments" repository
    MongoTailableIterator inactiveIterator = mongoConnector.getDocumentReader().getInactiveIterator(new MongoQuery());

    Set<String> finishedDocumentIds = new HashSet<String>();
    while(!finishedDocumentIds.equals(externalDocumentIds)) {
      if(inactiveIterator.hasNext()) {
        MongoDocument finishedDocument = inactiveIterator.next();
        logger.info("Found finished document " + finishedDocument);
        // Assert that the document was successfully processed
        assertThat(finishedDocument.getStatus(), equalTo(Document.Status.PROCESSED));
        // Here we assert that we indeed have passed through the staticField stage
        assertThat((String) finishedDocument.getContentField("testField"), equalTo("Set by SetStaticFieldStage"));
View Full Code Here

TOP

Related Classes of com.findwise.hydra.mongodb.MongoTailableIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.