T - the data typepublic abstract class SlotDistributor<T extends org.apache.hadoop.io.Writable> extends MapperWithRuntimeResource<Object,T,SortableSlot,WritableSlot>
SlotSorter.| Modifier and Type | Field and Description |
|---|---|
static String |
NAME_SET_SLOT_SPEC
The method name of
setSlotSpec(Writable, SortableSlot). |
| Constructor and Description |
|---|
SlotDistributor() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
map(Object key,
T value,
org.apache.hadoop.mapreduce.Mapper.Context context) |
protected abstract void |
setSlotSpec(T value,
SortableSlot slot)
Sets sorting information into the target slot.
|
run, runInternalpublic static final String NAME_SET_SLOT_SPEC
setSlotSpec(Writable, SortableSlot).protected abstract void setSlotSpec(T value, SortableSlot slot) throws IOException
slot.begin(MY_SLOT_NUMBER);
slot.addWritable(value.getPrimaryKey());
slot.addWritable(value.getSecondaryKey());
...
value - the target valueslot - the target slotIOException - if failed to writeprotected void map(Object key, T value, org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException, InterruptedException
map in class org.apache.hadoop.mapreduce.Mapper<Object,T extends org.apache.hadoop.io.Writable,SortableSlot,WritableSlot>IOExceptionInterruptedExceptionCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.