public class POMultiQueryPackage extends POPackage
This operator is used when merging multiple Map-Reduce splittees into a Map-only splitter during multi-query optimization. The package operators of the reduce plans of the splittees form an indexed package list inside this operator. When this operator receives an input, it extracts the index from the key and calls the corresponding package to get the output data.
Due to the recursive nature of multi-query optimization, this operator may be contained in another multi-query packager.
The successor of this operator must be a PODemux operator which knows how to consume the output of this operator.
POPackage.PackageType
PhysicalOperator.OriginalLocation
distinct, isKeyCompound, isKeyTuple, keyAsTuple, keyInfo, mBagFactory, mTupleFactory
alias, illustrator, input, inputAttached, inputs, lineageTracer, outputs, parentPlan, pigLogger, requestedParallelism, res, resultType
Constructor and Description |
---|
POMultiQueryPackage(OperatorKey k)
Constructs an operator with the specified key.
|
POMultiQueryPackage(OperatorKey k,
int rp)
Constructs an operator with the specified key
and degree of parallelism.
|
POMultiQueryPackage(OperatorKey k,
int rp,
java.util.List<PhysicalOperator> inp)
Constructs an operator with the specified key,
degree of parallelism and inputs.
|
POMultiQueryPackage(OperatorKey k,
java.util.List<PhysicalOperator> inp)
Constructs an operator with the specified key and inputs.
|
Modifier and Type | Method and Description |
---|---|
void |
addIsKeyWrappedList(java.util.List<java.lang.Boolean> lst)
Adds a list of IsKeyWrapped boolean values
|
void |
addPackage(POPackage pack)
Appends the specified package object to the end of
the package list.
|
void |
addPackage(POPackage pack,
byte mapKeyType)
Appends the specified package object to the end of
the package list.
|
void |
attachInput(PigNullableWritable k,
java.util.Iterator<NullableTuple> inp)
Attaches the required inputs
|
void |
detachInput()
attachInput's better half!
|
java.util.List<java.lang.Boolean> |
getIsKeyWrappedList()
Returns the list of booleans that indicates if the
key needs to unwrapped for the corresponding plan.
|
Result |
getNextTuple()
Constructs the output tuple from the inputs.
|
java.util.List<POPackage> |
getPackages()
Returns the list of packages.
|
boolean |
isInCombiner() |
boolean |
isSameMapKeyType() |
java.lang.String |
name() |
void |
setInCombiner(boolean inCombiner) |
void |
setSameMapKeyType(boolean sameMapKeyType) |
boolean |
supportsMultipleInputs()
Indicates whether this operator supports multiple inputs.
|
boolean |
supportsMultipleOutputs()
Indicates whether this operator supports multiple outputs.
|
void |
visit(PhyPlanVisitor v)
Visit this node with the provided visitor.
|
clone, getInner, getKeyInfo, getKeyType, getNumInps, getPackageType, getValueTuple, illustratorMarkup, isDistinct, setDistinct, setInner, setKeyCompound, setKeyInfo, setKeyTuple, setKeyType, setNumInps, setPackageType, setUseSecondaryKey
addOriginalLocation, addOriginalLocation, attachInput, cloneHelper, getAlias, getAliasString, getIllustrator, getInputs, getLogger, getNext, getNextBigDecimal, getNextBigInteger, getNextBoolean, getNextDataBag, getNextDataByteArray, getNextDateTime, getNextDouble, getNextFloat, getNextInteger, getNextLong, getNextMap, getNextString, getOriginalLocations, getPigLogger, getReporter, getRequestedParallelism, getResultType, isAccumStarted, isAccumulative, isBlocking, isInputAttached, processInput, reset, setAccumEnd, setAccumStart, setAccumulative, setIllustrator, setInputs, setParentPlan, setPigLogger, setReporter, setRequestedParallelism, setResultType
compareTo, equals, getOperatorKey, getProjectionMap, hashCode, regenerateProjectionMap, rewire, toString, unsetProjectionMap
public POMultiQueryPackage(OperatorKey k)
k
- the operator keypublic POMultiQueryPackage(OperatorKey k, int rp)
k
- the operator keyrp
- the degree of parallelism requestedpublic POMultiQueryPackage(OperatorKey k, java.util.List<PhysicalOperator> inp)
k
- the operator keyinp
- the inputs that this operator will read data frompublic POMultiQueryPackage(OperatorKey k, int rp, java.util.List<PhysicalOperator> inp)
k
- the operator keyrp
- the degree of parallelism requestedinp
- the inputs that this operator will read data frompublic boolean supportsMultipleInputs()
Operator
supportsMultipleInputs
in class POPackage
public void visit(PhyPlanVisitor v) throws VisitorException
Operator
visit
in class POPackage
v
- Visitor to visit with.VisitorException
- if the visitor has a problem.public boolean supportsMultipleOutputs()
Operator
supportsMultipleOutputs
in class POPackage
public void attachInput(PigNullableWritable k, java.util.Iterator<NullableTuple> inp)
POPackage
attachInput
in class POPackage
k
- - the key being worked oninp
- - iterator of indexed tuples typically
obtained from Hadooppublic void detachInput()
POPackage
detachInput
in class POPackage
public void addPackage(POPackage pack)
pack
- package to be appended to the listpublic void addPackage(POPackage pack, byte mapKeyType)
pack
- package to be appended to the listmapKeyType
- the map key type associated with the packagepublic java.util.List<POPackage> getPackages()
public Result getNextTuple() throws ExecException
The output is consumed by for the demultiplexer operator (PODemux) in the format (key, {bag of tuples}) where key is an indexed WritableComparable, not the wrapped value as a pig type.
getNextTuple
in class POPackage
ExecException
public java.util.List<java.lang.Boolean> getIsKeyWrappedList()
public void addIsKeyWrappedList(java.util.List<java.lang.Boolean> lst)
lst
- the list of boolean values to addpublic void setInCombiner(boolean inCombiner)
public boolean isInCombiner()
public void setSameMapKeyType(boolean sameMapKeyType)
public boolean isSameMapKeyType()
Copyright © 2007-2012 The Apache Software Foundation