K
- Type of the keys.U
- Type of the first PTable
's valuesV
- Type of the second PTable
's valuespublic abstract class JoinFn<K,U,V> extends DoFn<Pair<Pair<K,Integer>,Iterable<Pair<U,V>>>,Pair<K,Pair<U,V>>>
DoFn
for performing joins.Constructor and Description |
---|
JoinFn(PType<K> keyType,
PType<U> leftValueType)
Instantiate with the PType of the value of the left side of the join (used for creating deep
copies of values).
|
Modifier and Type | Method and Description |
---|---|
abstract String |
getJoinType() |
void |
initialize()
Initialize this DoFn.
|
abstract void |
join(K key,
int id,
Iterable<Pair<U,V>> pairs,
Emitter<Pair<K,Pair<U,V>>> emitter)
Performs the actual joining.
|
void |
process(Pair<Pair<K,Integer>,Iterable<Pair<U,V>>> input,
Emitter<Pair<K,Pair<U,V>>> emitter)
Split up the input record to make coding a bit more manageable.
|
cleanup, configure, disableDeepCopy, scaleFactor, setConfiguration, setContext
public JoinFn(PType<K> keyType, PType<U> leftValueType)
keyType
- The PType of the value used as the key of the joinleftValueType
- The PType of the value type of the left side of the joinpublic void initialize()
DoFn
DoFn.process(Object, Emitter)
is triggered. Subclasses may override
this method to do appropriate initialization.
Called during the setup of the job instance this DoFn
is associated
with.
public abstract String getJoinType()
public abstract void join(K key, int id, Iterable<Pair<U,V>> pairs, Emitter<Pair<K,Pair<U,V>>> emitter)
key
- The key for this grouping of values.id
- The side that this group of values is from (0 -> left, 1 -> right).pairs
- The group of values associated with this key and id pair.emitter
- The emitter to send the output to.Copyright © 2016 The Apache Software Foundation. All rights reserved.