Package com.mongodb

Examples of com.mongodb.DBAddress


        final String host = PropertiesUtil.toString(props.get(PROP_HOST), DEFAULT_HOST);
        final int port = PropertiesUtil.toInteger(props.get(PROP_PORT), DEFAULT_PORT);
        final String db = PropertiesUtil.toString(props.get(PROP_DB), DEFAULT_DB);
        logger.info("Starting MongoDB resource provider with host={}, port={}, db={}",
                new Object[] {host, port, db});
        final DBAddress address = new DBAddress(host, port, db);
        final MongoOptions options = new MongoOptions();
       
        options.connectionsPerHost = PropertiesUtil.toInteger(props.get(PROP_NUM_CONNECTIONS), DEFAULT_NUMCONNECTIONS);
        options.threadsAllowedToBlockForConnectionMultiplier = PropertiesUtil.toInteger(props.get(PROP_THREAD_MULTIPLIER), DEFAULT_THREAD_MULTIPLIER);
        final Mongo m = new Mongo(address, options);
View Full Code Here


    private final String remoteServer = "remote:27017/test";

    @Ignore
    @Test
    public void performBenchMark() throws UnknownHostException, InterruptedException {
        Mongo local = new Mongo(new DBAddress(localServer));
        Mongo remote = new Mongo(new DBAddress(remoteServer));

        run(local, false, false);
        run(local, true, false);
        run(remote, false, true);
        run(remote, true, true);
View Full Code Here

    }

    @Ignore
    @Test
    public void performBenchMark_WriteConcern() throws UnknownHostException, InterruptedException {
        Mongo mongo = new Mongo(new DBAddress(remoteServer));
        final DB db = mongo.getDB(TEST_DB1);
        final DBCollection nodes = db.getCollection("nodes");
        final DBCollection blobs = db.getCollection("blobs");
        int readers = 0;
        int writers = 2;
View Full Code Here

        return auth;
    }


    public MongoDatastore(String url, int port, String dbName) throws UnknownHostException {
        DBAddress address = new DBAddress(url, port, dbName);
        mongo = new Mongo(address);
        db = mongo.getDB(dbName);
    }
View Full Code Here

                // need to append db to url.
                url += "/" + database;
                System.out.println("new database url = " + url);
                MongoOptions options = new MongoOptions();
                options.connectionsPerHost = Integer.parseInt(maxConnections);
                mongo = new Mongo(new DBAddress(url), options);

                System.out.println("mongo connection created with " + url);
            }
            catch (Exception e1) {
                System.err
View Full Code Here

    private final String remoteServer = "remote:27017/test";

    @Ignore
    @Test
    public void performBenchMark() throws UnknownHostException, InterruptedException {
        Mongo local = new Mongo(new DBAddress(localServer));
        Mongo remote = new Mongo(new DBAddress(remoteServer));

        run(local, false, false);
        run(local, true, false);
        run(remote, false, true);
        run(remote, true, true);
View Full Code Here

    }

    @Ignore
    @Test
    public void performBenchMark_WriteConcern() throws UnknownHostException, InterruptedException {
        Mongo mongo = new Mongo(new DBAddress(remoteServer));
        final DB db = mongo.getDB(TEST_DB1);
        final DBCollection nodes = db.getCollection("nodes");
        final DBCollection blobs = db.getCollection("blobs");
        int readers = 0;
        int writers = 2;
View Full Code Here

    private final String remoteServer = "remote:27017/test";

    @Ignore
    @Test
    public void performBenchMark() throws UnknownHostException, InterruptedException {
        Mongo local = new Mongo(new DBAddress(localServer));
        Mongo remote = new Mongo(new DBAddress(remoteServer));

        run(local, false, false);
        run(local, true, false);
        run(remote, false, true);
        run(remote, true, true);
View Full Code Here

    }

    @Ignore
    @Test
    public void performBenchMark_WriteConcern() throws UnknownHostException, InterruptedException {
        Mongo mongo = new Mongo(new DBAddress(remoteServer));
        final DB db = mongo.getDB(TEST_DB1);
        final DBCollection nodes = db.getCollection("nodes");
        final DBCollection blobs = db.getCollection("blobs");
        int readers = 0;
        int writers = 2;
View Full Code Here

                }

                // need to append db to url.
                url += "/" + database;
                // System.out.println("new database url = " + url);
                mongo = new Mongo(new DBAddress(url));
                mongo.getMongoOptions().setConnectionsPerHost(100);
                // System.out.println("mongo connection created with " + url);
            }
            catch (Exception e1)
            {
View Full Code Here

TOP

Related Classes of com.mongodb.DBAddress

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.