use of com.mongodb.hadoop.testutils.MapReduceJob in project mongo-hadoop by mongodb.
the class TestStandalone method testMultipleCollectionSupport.
@Test
public void testMultipleCollectionSupport() {
mongoImport(getInputUri().getCollection(), TREASURY_JSON_PATH);
mongoImport(inputUri2.getCollection(), TREASURY_JSON_PATH);
MapReduceJob treasuryJob = new MapReduceJob("com.mongodb.hadoop.examples.treasury.TreasuryYieldXMLConfig").jar(JOBJAR_PATH).param(MONGO_SPLITTER_CLASS, MultiMongoCollectionSplitter.class.getName()).inputUris(getInputUri(), inputUri2).outputUri(getOutputUri());
if (isHadoopV1()) {
treasuryJob.outputCommitter(MongoOutputCommitter.class);
}
treasuryJob.execute(isRunTestInVm());
compareDoubled(getClient(getInputUri()).getDB(getOutputUri().getDatabase()).getCollection(getOutputUri().getCollection()));
}
use of com.mongodb.hadoop.testutils.MapReduceJob in project mongo-hadoop by mongodb.
the class TestStandalone method testTreasuryJsonConfig.
@Test
public void testTreasuryJsonConfig() {
mongoImport("yield_historical.in3", TREASURY_JSON_PATH);
MapReduceJob treasuryJob = new MapReduceJob("com.mongodb.hadoop.examples.treasury.TreasuryYieldXMLConfig").jar(JOBJAR_PATH).param(MONGO_SPLITTER_CLASS, MultiMongoCollectionSplitter.class.getName()).param(MULTI_COLLECTION_CONF_KEY, collectionSettings().toString()).outputUri(getOutputUri());
if (isHadoopV1()) {
treasuryJob.outputCommitter(MongoOutputCommitter.class);
}
treasuryJob.execute(isRunTestInVm());
compareDoubled(getClient(getInputUri()).getDB(getOutputUri().getDatabase()).getCollection(getOutputUri().getCollection()));
}
use of com.mongodb.hadoop.testutils.MapReduceJob in project mongo-hadoop by mongodb.
the class TestSharded method testShardedClusterWithGtLtQueryFormats.
@Test
public void testShardedClusterWithGtLtQueryFormats() {
DBCollection collection = getMongos().getDB("mongo_hadoop").getCollection("yield_historical.out");
collection.drop();
MapReduceJob job = new MapReduceJob(TreasuryYieldXMLConfig.class.getName()).jar(JOBJAR_PATH).inputUris(getInputUri()).outputUri(getOutputUri()).param(SPLITS_USE_RANGEQUERY, "true");
if (isHadoopV1()) {
job.outputCommitter(MongoOutputCommitter.class);
}
job.execute(isRunTestInVm());
compareResults(collection, getReference());
collection.drop();
job.param(INPUT_QUERY, "{\"_id\":{\"$gt\":{\"$date\":1182470400000}}}").inputUris(getInputUri()).execute(isRunTestInVm());
// Make sure that this fails when rangequery is used with a query that conflicts
assertEquals(0, collection.count());
}
use of com.mongodb.hadoop.testutils.MapReduceJob in project mongo-hadoop by mongodb.
the class TestSharded method testBasicInputSource.
@Test
public void testBasicInputSource() {
MapReduceJob job = new MapReduceJob(TreasuryYieldXMLConfig.class.getName()).jar(JOBJAR_PATH).inputUris(getInputUri()).outputUri(getOutputUri());
if (isHadoopV1()) {
job.outputCommitter(MongoOutputCommitter.class);
}
job.execute(isRunTestInVm());
compareResults(getMongos().getDB("mongo_hadoop").getCollection("yield_historical.out"), getReference());
}
Aggregations