Examples of MongoClientURIBuilder


Examples of com.mongodb.hadoop.util.MongoClientURIBuilder

    }

    public MongoClient getShard2() {
        if (shard2 == null) {
            try {
                shard2 = new MongoClient(authCheck(new MongoClientURIBuilder().port(27218)).build());
            } catch (UnknownHostException e) {
                throw new RuntimeException(e.getMessage(), e);
            }
        }
        return shard2;
View Full Code Here

Examples of com.mongodb.hadoop.util.MongoClientURIBuilder

    private static HiveClient client;
    private MongoClientURI mongoTestURI;
    private MongoClient mongoClient;

    public HiveTest() {
        mongoTestURI = authCheck(new MongoClientURIBuilder()
                                     .collection("mongo_hadoop", MONGO_COLLECTION)
                                ).build();

    }
View Full Code Here

Examples of com.mongodb.hadoop.util.MongoClientURIBuilder

        transferData(HDFS_BACKED_TABLE, MONGO_BACKED_TABLE);
    }

    public void createMongoBackedTable(final boolean withSerDeProps) {
        dropTable(MONGO_BACKED_TABLE);
        MongoClientURI uri = authCheck(new MongoClientURIBuilder()
                                           .collection("mongo_hadoop", MONGO_COLLECTION)
                                      ).build();
        execute(format("CREATE TABLE %s %s\n"
                       + "STORED BY '%s'\n"
                       + (withSerDeProps ? format("WITH SERDEPROPERTIES(%s)\n", SERDE_PROPERTIES) : "")
View Full Code Here

Examples of com.mongodb.hadoop.util.MongoClientURIBuilder

        collection.insert(user(1, "Jim", "Beam", "Clermont", "KY"));
        collection.insert(user(2, "Don", "Draper", "New York", "NY"));
        collection.insert(user(3, "John", "Elway", "Denver", "CO"));

        MongoClientURI uri = authCheck(new MongoClientURIBuilder()
                                           .collection("mongo_hadoop", collection.getName())
                                      ).build();

        ColumnMapping map = new ColumnMapping()
                                .map("id", "_id", "INT")
View Full Code Here

Examples of com.mongodb.hadoop.util.MongoClientURIBuilder

                                  .append("intField", i % 10)
                                  .append("booleanField", i % 2 == 0)
                                  .append("stringField", "" + (i % 2 == 0)));
        }

        MongoClientURI uri = authCheck(new MongoClientURIBuilder()
                                           .collection("mongo_hadoop", collection.getName())
                                      ).build();

        ColumnMapping map = new ColumnMapping()
                                .map("id", "_id", "INT")
View Full Code Here

Examples of com.mongodb.hadoop.util.MongoClientURIBuilder

        loadIntoHDFS(new File(EXAMPLE_DATA_HOME, "dump/enron_mail/messages.bson").getAbsolutePath(), "/user/hive/warehouse/enron");

        ColumnMapping map = new ColumnMapping()
                                .map("id", "_id", "INT")
                                .map("subFolder", "subFolder", "STRING");
        MongoClientURI uri = authCheck(new MongoClientURIBuilder()
                                           .collection("mongo_hadoop", collection.getName())
                                      ).build();
        execute(format("CREATE EXTERNAL TABLE %s (body STRING, subFolder STRING, mailbox STRING, filename STRING)\n"
                       + "ROW FORMAT SERDE '%s'\n"
                       + "WITH SERDEPROPERTIES('%s'='%s')\n"
View Full Code Here

Examples of com.mongodb.hadoop.util.MongoClientURIBuilder

                                                 .find(new BasicDBObject("_id", stats.getString("primary")));
                try {
                    if (shards.hasNext()) {
                        DBObject shard = shards.next();
                        String host = ((String) shard.get("host")).replace(shard.get("_id") + "/", "");
                        MongoClientURI shardHost = new MongoClientURIBuilder(inputURI)
                                                       .host(host)
                                                       .build();
                        MongoClient shardClient = null;
                        try {
                            shardClient = new MongoClient(shardHost);
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.