@Override public T next() { return iterMapFn.map(nextLine); } };
@Override public Map<String, T> map(Map<CharSequence, Object> input) { Map<String, T> out = Maps.newHashMap(); for (Map.Entry<CharSequence, Object> e : input.entrySet()) { out.put(e.getKey().toString(), mapFn.map(e.getValue())); } return out; } }
@Override public Map<Utf8, Object> map(Map<String, T> input) { Map<Utf8, Object> out = Maps.newHashMap(); for (Map.Entry<String, T> e : input.entrySet()) { out.put(new Utf8(e.getKey()), mapFn.map(e.getValue())); } return out; } }
@Override public Pair<K, V> map(V input) { return Pair.of(mapFn.map(input), input); } }
@Override public Map<String, T> map(TextMapWritable<Writable> input) { Map<String, T> out = Maps.newHashMap(); for (Map.Entry<Text, Writable> e : input.entrySet()) { out.put(e.getKey().toString(), mapFn.map(e.getValue())); } return out; } }
@Override public T next() { if (!nextChecked && !hasNext()) { return null; } nextChecked = false; return mapFn.map(value); } };
@Override public Pair<K, V> map(V input) { return Pair.of(mapFn.map(input), input); } }
@Override public T next() { return mapFn.map(reader.next()); } };
@Override public Map<Utf8, Object> map(Map<String, T> input) { Map<Utf8, Object> out = Maps.newHashMap(); for (Map.Entry<String, T> e : input.entrySet()) { out.put(new Utf8(e.getKey()), mapFn.map(e.getValue())); } return out; } }
@Override public Collection<T> map(GenericArrayWritable input) { Collection<T> collection = Lists.newArrayList(); for (Writable writable : input.get()) { collection.add(mapFn.map(writable)); } return collection; } }
@Override public Object call(Object o) throws Exception { if (!initialized) { ctxt.initialize(fn, null); initialized = true; } return fn.map(o); } }
@Override public TextMapWritable<Writable> map(Map<String, T> input) { TextMapWritable<Writable> tmw = new TextMapWritable<Writable>(clazz); for (Map.Entry<String, T> e : input.entrySet()) { tmw.put(new Text(e.getKey()), mapFn.map(e.getValue())); } return tmw; } }
@Override public GenericRecord map(Pair input) { if (keyValueSchema == null) { keyValueSchema = new Schema.Parser().parse(keyValueSchemaJson); } GenericRecord keyValueRecord = new GenericData.Record(keyValueSchema); keyValueRecord.put(AvroKeyValue.KEY_FIELD, keyMapFn.map(input.first())); keyValueRecord.put(AvroKeyValue.VALUE_FIELD, valueMapFn.map(input.second())); return keyValueRecord; } }
@Override public GenericArrayWritable map(Collection<T> input) { GenericArrayWritable arrayWritable = new GenericArrayWritable(clazz); Writable[] w = new Writable[input.size()]; int index = 0; for (T in : input) { w[index++] = ((Writable) mapFn.map(in)); } arrayWritable.set(w); return arrayWritable; } }
@Override public Tuple map(TupleWritable in) { for (int i = 0; i < values.length; i++) { if (in.has(i)) { values[i] = fns.get(i).map(in.get(i)); } else { values[i] = null; } } return tupleFactory.makeTuple(values); } }
@Override public Tuple map(TupleWritable in) { for (int i = 0; i < values.length; i++) { if (in.has(i)) { values[i] = fns.get(i).map(in.get(i)); } else { values[i] = null; } } return tupleFactory.makeTuple(values); } }
@Override public Pair<K, Iterable<V>> map(Pair<Object, Iterable<Object>> input) { return Pair.<K, Iterable<V>>of(keys.map(input.first()), new PTypeIterable(values, input.second())); } }
@Override public S call(Tuple2<K, V> kv) throws Exception { if (!initialized) { ctxt.initialize(fn, null); initialized = true; } return fn.map(Pair.of(kv._1(), kv._2())); } }