public class CollapsingCombiner extends ObjectReducer implements DateRangeConfigurable, java.io.Serializable
AbstractPartitionCollapsingIncrementalJob
and its derived classes.
An implementation of Accumulator
is used to perform aggregation and produce the
intermediate value.
Constructor and Description |
---|
CollapsingCombiner() |
Modifier and Type | Method and Description |
---|---|
Accumulator<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> |
getAccumulator()
Gets the accumulator used to perform aggregation.
|
boolean |
getReuseOutput()
Gets whether previous output is being reused.
|
PartitionCollapsingSchemas |
getSchemas()
Gets the schemas.
|
void |
reduce(java.lang.Object keyObj,
java.lang.Iterable<java.lang.Object> values,
org.apache.hadoop.mapreduce.ReduceContext<java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object> context) |
void |
setAccumulator(Accumulator<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> acc)
Sets the accumulator used to perform aggregation.
|
void |
setOutputDateRange(DateRange dateRange)
Sets the date range for the output.
|
void |
setReuseOutput(boolean reuseOutput)
Sets whether previous output is being reused.
|
void |
setSchemas(PartitionCollapsingSchemas schemas)
Sets the schemas.
|
close, getContext, setContext
public void reduce(java.lang.Object keyObj, java.lang.Iterable<java.lang.Object> values, org.apache.hadoop.mapreduce.ReduceContext<java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object> context) throws java.io.IOException, java.lang.InterruptedException
reduce
in class ObjectReducer
java.io.IOException
java.lang.InterruptedException
public void setSchemas(PartitionCollapsingSchemas schemas)
schemas
- schemas used by the combinerpublic PartitionCollapsingSchemas getSchemas()
public boolean getReuseOutput()
public void setReuseOutput(boolean reuseOutput)
reuseOutput
- true if previous output is reusedpublic Accumulator<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> getAccumulator()
public void setAccumulator(Accumulator<org.apache.avro.generic.GenericRecord,org.apache.avro.generic.GenericRecord> acc)
acc
- The accumulatorpublic void setOutputDateRange(DateRange dateRange)
DateRangeConfigurable
setOutputDateRange
in interface DateRangeConfigurable
dateRange
- output date range