Package com.findwise.hydra.mongodb

Examples of com.findwise.hydra.mongodb.MongoDocumentIO


      }
    }
  }

  private Set<String> createDocuments(int numDocs) throws UnknownHostException {
    MongoDocumentIO mongoDocumentIO = buildMongoDocumentIO(mongoConfiguration);
    Set<String> externalDocumentIds = new HashSet<String>();
    for(int i = 0; i < numDocs; i++) {
      String externalDocId = UUID.randomUUID().toString();
      MongoDocument mongoDocument = new MongoDocument();
      mongoDocument.putContentField("externalDocId", externalDocId);
      mongoDocumentIO.insert(mongoDocument);
      externalDocumentIds.add(externalDocId);
    }
    return externalDocumentIds;
  }
View Full Code Here


    long documentsToKeep = mongoConfiguration.getOldMaxCount();
    int oldDocsMaxSizeMB = mongoConfiguration.getOldMaxSize();
    StatusUpdater updater = new StatusUpdater(new MongoConnector(mongoConfiguration));
    GridFS documentFs = new GridFS(db);

    MongoDocumentIO io = new MongoDocumentIO(db, concern, documentsToKeep,
      oldDocsMaxSizeMB, updater, documentFs);
    io.prepare();
    return io;
  }
View Full Code Here

    long documentsToKeep = conf.getOldMaxCount();
    int oldDocsMaxSizeMB = conf.getOldMaxSize();
    StatusUpdater updater = new StatusUpdater(new MongoConnector(conf));
    GridFS documentFs = new GridFS(db);

    MongoDocumentIO io = new MongoDocumentIO(db, concern, documentsToKeep,
        oldDocsMaxSizeMB, updater, documentFs);
    io.prepare();

    MongoDocument document = new MongoDocument(args[args.length-1]);
    io.insert(document);
    System.out.println("Added document");
  }
View Full Code Here

TOP

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

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.