K
- Key typeS
- Single value typeR
- Reduced value typepublic class BasicMapReduce<K extends org.apache.hadoop.io.WritableComparable,S,R extends org.apache.hadoop.io.Writable> extends Object implements ReduceOperation<org.apache.commons.lang3.tuple.Pair<K,S>,Basic2ObjectMap<K,R>>
Constructor and Description |
---|
BasicMapReduce() |
BasicMapReduce(PrimitiveIdTypeOps<K> keyTypeOps,
PrimitiveTypeOps<R> typeOps,
ReduceOperation<S,R> elementReduceOp)
Create ReduceOperation that reduces BasicMaps by reducing individual
elements corresponding to the same key.
|
Modifier and Type | Method and Description |
---|---|
Basic2ObjectMap<K,R> |
createInitialValue()
Return new reduced value which is neutral to reduce operation.
|
static <K extends org.apache.hadoop.io.WritableComparable,S,R extends org.apache.hadoop.io.Writable> |
createLocalMapHandles(PrimitiveIdTypeOps<K> keyTypeOps,
PrimitiveTypeOps<R> typeOps,
ReduceOperation<S,R> elementReduceOp,
CreateReducersApi reduceApi)
Registers one new local reducer, that will reduce BasicMap,
by reducing individual elements corresponding to the same key
using
elementReduceOp . |
static <K extends org.apache.hadoop.io.WritableComparable,S,R extends org.apache.hadoop.io.Writable> |
createMapHandles(PrimitiveIdTypeOps<K> keyTypeOps,
PrimitiveTypeOps<R> typeOps,
ReduceOperation<S,R> elementReduceOp,
CreateReducersApi.CreateReducerFunctionApi createFunction)
Registers one new reducer, that will reduce BasicMap,
by reducing individual elements corresponding to the same key
using
elementReduceOp . |
void |
readFields(DataInput in) |
Basic2ObjectMap<K,R> |
reduce(Basic2ObjectMap<K,R> curValue,
org.apache.commons.lang3.tuple.Pair<K,S> valueToReduce)
Add a new value.
|
Basic2ObjectMap<K,R> |
reduceMerge(Basic2ObjectMap<K,R> curValue,
Basic2ObjectMap<K,R> valueToReduce)
Add partially reduced value to current partially reduced value.
|
void |
write(DataOutput out) |
public BasicMapReduce()
public BasicMapReduce(PrimitiveIdTypeOps<K> keyTypeOps, PrimitiveTypeOps<R> typeOps, ReduceOperation<S,R> elementReduceOp)
keyTypeOps
- TypeOps of keystypeOps
- TypeOps of individual elementselementReduceOp
- ReduceOperation for individual elementspublic static <K extends org.apache.hadoop.io.WritableComparable,S,R extends org.apache.hadoop.io.Writable> ReducerMapHandle<K,S,R> createLocalMapHandles(PrimitiveIdTypeOps<K> keyTypeOps, PrimitiveTypeOps<R> typeOps, ReduceOperation<S,R> elementReduceOp, CreateReducersApi reduceApi)
elementReduceOp
.
This function will return ReducerMapHandle, by which
individual elements can be manipulated separately.keyTypeOps
- TypeOps of keystypeOps
- TypeOps of individual elementselementReduceOp
- ReduceOperation for individual elementsreduceApi
- API for creating reducerspublic static <K extends org.apache.hadoop.io.WritableComparable,S,R extends org.apache.hadoop.io.Writable> ReducerMapHandle<K,S,R> createMapHandles(PrimitiveIdTypeOps<K> keyTypeOps, PrimitiveTypeOps<R> typeOps, ReduceOperation<S,R> elementReduceOp, CreateReducersApi.CreateReducerFunctionApi createFunction)
elementReduceOp
.
This function will return ReducerMapHandle, by which
individual elements can be manipulated separately.keyTypeOps
- TypeOps of keystypeOps
- TypeOps of individual elementselementReduceOp
- ReduceOperation for individual elementscreateFunction
- Function for creating a reducerpublic Basic2ObjectMap<K,R> createInitialValue()
ReduceOperation
createInitialValue
in interface ReduceOperation<org.apache.commons.lang3.tuple.Pair<K extends org.apache.hadoop.io.WritableComparable,S>,Basic2ObjectMap<K extends org.apache.hadoop.io.WritableComparable,R extends org.apache.hadoop.io.Writable>>
public Basic2ObjectMap<K,R> reduce(Basic2ObjectMap<K,R> curValue, org.apache.commons.lang3.tuple.Pair<K,S> valueToReduce)
ReduceOperation
reduce
in interface ReduceOperation<org.apache.commons.lang3.tuple.Pair<K extends org.apache.hadoop.io.WritableComparable,S>,Basic2ObjectMap<K extends org.apache.hadoop.io.WritableComparable,R extends org.apache.hadoop.io.Writable>>
curValue
- Partial value into which to reduce and store the resultvalueToReduce
- Single value to be reducedpublic Basic2ObjectMap<K,R> reduceMerge(Basic2ObjectMap<K,R> curValue, Basic2ObjectMap<K,R> valueToReduce)
ReduceOperation
reduceMerge
in interface ReduceOperation<org.apache.commons.lang3.tuple.Pair<K extends org.apache.hadoop.io.WritableComparable,S>,Basic2ObjectMap<K extends org.apache.hadoop.io.WritableComparable,R extends org.apache.hadoop.io.Writable>>
curValue
- Partial value into which to reduce and store the resultvalueToReduce
- Partial value to be reducedpublic void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.