Examples of MongoConnector


Examples of com.findwise.hydra.mongodb.MongoConnector

  }

  @Test
  public void testShutdown() throws IOException, InterruptedException {
    CoreConfiguration conf = ConfigurationFactory.getConfiguration("jUnit-RESTServerTest");
    RESTServer server = RESTServer.getNewStartedRESTServer(conf.getRestPort(), new HttpRESTHandler<MongoType>(new MongoConnector(conf)));
    server.shutdown();
    Thread.sleep(1000);
    if(server.isAlive()) {
      fail("Thread should be dead");
    }
View Full Code Here

Examples of com.findwise.hydra.mongodb.MongoConnector

import com.findwise.hydra.mongodb.MongoConnector;

public class StraightPipelineSetup {
  public static void main(String[] args) throws Exception {
    MongoConnector mdc = new MongoConnector(new TestConfiguration());

    mdc.connect();
   
    Object outId = addFile(mdc, "hydra-out-jar-with-dependencies.jar");
    Object basicId = addFile(mdc, "basic-stages-jar-with-dependencies.jar");
   
   
   
   
    Pipeline c = new Pipeline();
    Stage s = getStage(c, basicId, "copyStage1", "stage.CopyStage");
    Map<String, Object> map = s.getProperties();
    map.put("map", getSingleMap("in", "out1"));
    s.setProperties(map);
   
    s = getStage(c, basicId, "copyStage2", "stage.CopyStage", "copyStage1");
    map = s.getProperties();
    map.put("map", getSingleMap("out1", "out2"));
    s.setProperties(map);
   
    s = getStage(c, basicId, "copyStage3", "stage.CopyStage", "copyStage2");
    map = s.getProperties();
    map.put("map", getSingleMap("out2", "out3"));
    s.setProperties(map);
   
    s = getStage(c, outId, "solrOutput", "output.solr.SolrOutputStage", "copyStage3");
    map = s.getProperties();
    HashMap<String, String> fieldMap = new HashMap<String, String>();
    fieldMap.put("out1", "out1_s");
    fieldMap.put("out2", "out2_s");
    fieldMap.put("out3", "out3_s");
    fieldMap.put("in", "in_s");
    fieldMap.put("id", "id");
    map.put("fieldMappings", fieldMap);
    map.put("solrDeployPath", "http://127.0.0.1:8983/solr");
    s.setProperties(map);
   
    mdc.getPipelineWriter().write(c);
   
    System.out.println("Posted your stages into Hydra");
   
  }
View Full Code Here

Examples of com.findwise.hydra.mongodb.MongoConnector

    MongoClient mongo = new MongoClient(new MongoClientURI(conf.getDatabaseUrl()));
    DB db = mongo.getDB(conf.getNamespace());
    WriteConcern concern = mongo.getWriteConcern();
    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();
View Full Code Here

Examples of com.opengamma.util.mongo.MongoConnector

  public void persistentSubscriptionManagement() {
    ExternalScheme idScheme = ExternalScheme.of("TestDomain");
    MockLiveDataServer server = new MockLiveDataServer(idScheme, _cacheManager);
    server.connect();
   
    MongoConnector connector = MongoTestUtils.makeTestConnector(MongoDBPersistentSubscriptionManagerTest.class.getSimpleName(), true);
    MongoDBPersistentSubscriptionManager manager = new MongoDBPersistentSubscriptionManager(server, connector);
    manager.clean();
   
    assertTrue(manager.getPersistentSubscriptions().isEmpty());
View Full Code Here

Examples of com.opengamma.util.mongo.MongoConnector

   * @param testClass  the test class, not null
   * @param makeUnique  whether to make the database totally unique
   * @return the wrapped provider, not null
   */
  public static MongoDBValueCachingReferenceDataProvider makeMongoProvider(ReferenceDataProvider underlying, Class<?> testClass, boolean makeUnique) {
    MongoConnector mongoConnector = getMongoConnector(testClass, makeUnique);
    MongoDBValueCachingReferenceDataProvider mongoProvider = new MongoDBValueCachingReferenceDataProvider(underlying, mongoConnector);
    return mongoProvider;
  }
View Full Code Here

Examples of com.opengamma.util.mongo.MongoConnector

   * Creates a Mongo caching reference data provider for testing.
   *
   * @return the provider, not null
   */
  public static ReferenceDataProvider getMongoCachingReferenceDataProvider(BloombergReferenceDataProvider bbgProvider) {
    MongoConnector mongoConnector = BloombergTestUtils.getMongoConnector();
    return new MongoDBValueCachingReferenceDataProvider(bbgProvider, mongoConnector);
  }
View Full Code Here

Examples of com.opengamma.util.mongo.MongoConnector

  protected ReferenceDataProvider initReferenceDataProvider(ComponentRepository repo) {
    BloombergConnector bloombergConnector = getBloombergConnector();
    BloombergReferenceDataProvider underlying = new BloombergReferenceDataProvider(bloombergConnector);
    repo.registerLifecycle(underlying);
   
    MongoConnector mongoConnector = getMongoConnector();
    CacheManager cacheManager = getCacheManager();
    if (mongoConnector != null) {
      MongoDBInvalidFieldCachingReferenceDataProvider fieldCached = new MongoDBInvalidFieldCachingReferenceDataProvider(underlying, mongoConnector);
      return new MongoDBValueCachingReferenceDataProvider(fieldCached, mongoConnector);
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.