List of usage examples for org.apache.hadoop.conf Configuration get
public String get(String name)
name
property, null
if no such property exists. From source file:colossal.pipe.AvroKeyProjectionMapper.java
License:Apache License
@Override public void setConf(org.apache.hadoop.conf.Configuration conf) { if (conf == null) return; // you first get a null configuration - ignore that String mos = conf.get(AvroJob.MAP_OUTPUT_SCHEMA); Schema schema = Schema.parse(mos); pair = new Pair<Object, Object>(schema); Schema keySchema = Pair.getKeySchema(schema); final List<Field> fields = keySchema.getFields(); final GenericRecord key = new GenericData.Record(keySchema); projector = new Projector(key, fields); }
From source file:colossal.pipe.AvroKeyVoidValueMapper.java
License:Apache License
@Override public void setConf(org.apache.hadoop.conf.Configuration conf) { pair = new Pair<Object, Void>(Schema.parse(conf.get(AvroJob.INPUT_SCHEMA))); }
From source file:colossal.pipe.ColAvroSerialization.java
License:Apache License
/** Returns the specified output serializer. */ public Serializer<AvroWrapper<T>> getSerializer(Class<AvroWrapper<T>> c) { Configuration conf = getConf(); // Here we must rely on mapred.task.is.map to tell whether the map output // or final output is needed. boolean isMap = conf.getBoolean("mapred.task.is.map", false); Schema schema = !isMap ? AvroJob.getOutputSchema(conf) : Schema.parse(AvroKey.class.isAssignableFrom(c) ? conf.get(ColPhase.MAP_OUT_KEY_SCHEMA) : conf.get(ColPhase.MAP_OUT_VALUE_SCHEMA)); return new AvroWrapperSerializer(new SpecificDatumWriter<T>(schema)); }
From source file:colossal.pipe.ColKeyComparator.java
License:Apache License
@Override public void setConf(Configuration conf) { super.setConf(conf); if (conf != null) { String schemaJson = conf.get(ColPhase.MAP_OUT_KEY_SCHEMA); schema = Schema.parse(schemaJson); }//from w w w . java 2 s. c o m }
From source file:com.aerospike.hadoop.mapreduce.AerospikeConfigUtil.java
License:Apache License
public static String getInputNamespace(Configuration conf) { String namespace = conf.get(INPUT_NAMESPACE); if (namespace == null) throw new UnsupportedOperationException("you must set the input namespace"); log.info("using " + INPUT_NAMESPACE + " = " + namespace); return namespace; }
From source file:com.aerospike.hadoop.mapreduce.AerospikeConfigUtil.java
License:Apache License
public static String getInputSetName(Configuration conf) { String setname = conf.get(INPUT_SETNAME); log.info("using " + INPUT_SETNAME + " = " + setname); return setname; }
From source file:com.aerospike.hadoop.mapreduce.AerospikeConfigUtil.java
License:Apache License
public static String[] getInputBinNames(Configuration conf) { String bins = conf.get(INPUT_BINNAMES); log.info("using " + INPUT_BINNAMES + " = " + bins); if (bins == null || bins.equals("")) return null; else//from ww w .j a v a2 s .c o m return bins.split(","); }
From source file:com.aerospike.hadoop.mapreduce.AerospikeConfigUtil.java
License:Apache License
public static String getInputNumRangeBin(Configuration conf) { String binname = conf.get(INPUT_NUMRANGE_BIN); log.info("using " + INPUT_NUMRANGE_BIN + " = " + binname); return binname; }
From source file:com.aerospike.hadoop.mapreduce.AerospikeConfigUtil.java
License:Apache License
public static String getOutputNamespace(Configuration conf) { String namespace = conf.get(OUTPUT_NAMESPACE); if (namespace == null) throw new UnsupportedOperationException("you must set the output namespace"); log.info("using " + OUTPUT_NAMESPACE + " = " + namespace); return namespace; }
From source file:com.aerospike.hadoop.mapreduce.AerospikeConfigUtil.java
License:Apache License
public static String getOutputSetName(Configuration conf) { String setname = conf.get(OUTPUT_SETNAME); log.info("using " + OUTPUT_SETNAME + " = " + setname); return setname; }