
com.mongodb.hadoop.streaming.io.MongoIdentifierResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mongo-hadoop-streaming Show documentation
Show all versions of mongo-hadoop-streaming Show documentation
The MongoDB Connector for Hadoop is a plugin for Hadoop that provides the ability to use MongoDB as an input source and/or an output destination.
package com.mongodb.hadoop.streaming.io;
import com.mongodb.hadoop.io.BSONWritable;
import org.apache.hadoop.streaming.io.IdentifierResolver;
public class MongoIdentifierResolver extends IdentifierResolver {
public static final String MONGODB_ID = "mongodb";
public static final String MONGO_ID = "mongo";
public static final String BSON_ID = "bson";
@Override
public void resolve(final String identifier) {
if (identifier.equalsIgnoreCase(MONGODB_ID) || identifier.equalsIgnoreCase(MONGO_ID) || identifier.equalsIgnoreCase(BSON_ID)) {
setInputWriterClass(MongoInputWriter.class);
setOutputReaderClass(MongoOutputReader.class);
setOutputKeyClass(BSONWritable.class);
setOutputValueClass(BSONWritable.class);
} else {
super.resolve(identifier);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy