|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hive.ql.exec.Operator<T>
public abstract class Operator<T extends Serializable>
Base operator implementation
Nested Class Summary | |
---|---|
static interface |
Operator.OperatorFunc
|
static class |
Operator.State
|
Field Summary | |
---|---|
protected String |
alias
|
protected List<Operator<? extends Serializable>> |
childOperators
|
protected Operator<? extends Serializable>[] |
childOperatorsArray
Cache childOperators in an array for faster access. |
protected int[] |
childOperatorsTag
|
protected Map<String,exprNodeDesc> |
colExprMap
A map of output column name to input expression map. |
protected T |
conf
|
protected boolean |
done
|
protected String |
id
|
protected ObjectInspector[] |
inputObjInspectors
|
protected org.apache.commons.logging.Log |
LOG
|
protected org.apache.hadoop.mapred.OutputCollector |
out
|
protected ObjectInspector |
outputObjInspector
|
protected List<Operator<? extends Serializable>> |
parentOperators
|
protected org.apache.hadoop.mapred.Reporter |
reporter
|
protected Operator.State |
state
|
protected HashMap<Enum<?>,org.apache.hadoop.io.LongWritable> |
statsMap
|
Constructor Summary | |
---|---|
Operator()
|
|
Operator(org.apache.hadoop.mapred.Reporter reporter)
Create an operator with a reporter. |
Method Summary | |
---|---|
protected boolean |
areAllParentsInitialized()
checks whether all parent operators are initialized or not |
void |
close(boolean abort)
|
protected void |
closeOp(boolean abort)
Operator specific close routine. |
String |
dump(int level)
|
void |
endGroup()
|
protected void |
forward(Object row,
ObjectInspector rowInspector)
|
List<Operator<? extends Serializable>> |
getChildOperators()
|
Vector<Node> |
getChildren()
Implements the getChildren function for the Node Interface. |
Map<String,exprNodeDesc> |
getColumnExprMap()
Returns a map of output column name to input expression map Note that currently it returns only key columns for ReduceSink and GroupBy operators |
T |
getConf()
|
boolean |
getDone()
|
String |
getIdentifier()
This function is not named getId(), to make sure java serialization does NOT serialize it. |
String |
getName()
Implements the getName function for the Node Interface. |
List<Operator<? extends Serializable>> |
getParentOperators()
|
RowSchema |
getSchema()
|
Map<Enum<?>,Long> |
getStats()
|
protected static ObjectInspector[] |
initEvaluators(ExprNodeEvaluator[] evals,
ObjectInspector rowInspector)
Initialize an array of ExprNodeEvaluator and return the result ObjectInspectors. |
protected static StructObjectInspector |
initEvaluatorsAndReturnStruct(ExprNodeEvaluator[] evals,
List<String> outputColName,
ObjectInspector rowInspector)
Initialize an array of ExprNodeEvaluator and put the return values into a StructObjectInspector with integer field names. |
void |
initialize(org.apache.hadoop.conf.Configuration hconf,
ObjectInspector[] inputOIs)
Initializes operators only if all parents have been initialized. |
protected void |
initializeChildren(org.apache.hadoop.conf.Configuration hconf)
Calls initialize on each of the children with outputObjetInspector as the output row format |
protected void |
initializeOp(org.apache.hadoop.conf.Configuration hconf)
Operator specific initialization. |
void |
jobClose(org.apache.hadoop.conf.Configuration conf,
boolean success)
Unlike other operator interfaces which are called from map or reduce task, jobClose is called from the jobclient side once the job has completed |
void |
logStats()
|
void |
preorderMap(Operator.OperatorFunc opFunc)
|
abstract void |
process(Object row,
int tag)
Process the row. |
void |
removeChild(Operator<? extends Serializable> child)
|
void |
replaceChild(Operator<? extends Serializable> child,
Operator<? extends Serializable> newChild)
Replace one child with another at the same position. |
void |
replaceParent(Operator<? extends Serializable> parent,
Operator<? extends Serializable> newParent)
Replace one parent with another at the same position. |
void |
resetStats()
|
void |
setAlias(String alias)
Store the alias this operator is working on behalf of |
void |
setChildOperators(List<Operator<? extends Serializable>> childOperators)
|
void |
setColumnExprMap(Map<String,exprNodeDesc> colExprMap)
|
void |
setConf(T conf)
|
void |
setDone(boolean done)
|
void |
setId(String id)
|
void |
setOutputCollector(org.apache.hadoop.mapred.OutputCollector out)
|
void |
setParentOperators(List<Operator<? extends Serializable>> parentOperators)
|
void |
setReporter(org.apache.hadoop.mapred.Reporter rep)
|
void |
setSchema(RowSchema rowSchema)
|
void |
startGroup()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected List<Operator<? extends Serializable>> childOperators
protected List<Operator<? extends Serializable>> parentOperators
protected transient Operator.State state
protected T extends Serializable conf
protected boolean done
protected transient HashMap<Enum<?>,org.apache.hadoop.io.LongWritable> statsMap
protected transient org.apache.hadoop.mapred.OutputCollector out
protected transient org.apache.commons.logging.Log LOG
protected transient String alias
protected transient org.apache.hadoop.mapred.Reporter reporter
protected transient String id
protected transient ObjectInspector[] inputObjInspectors
protected transient ObjectInspector outputObjInspector
protected transient Map<String,exprNodeDesc> colExprMap
protected transient Operator<? extends Serializable>[] childOperatorsArray
protected transient int[] childOperatorsTag
Constructor Detail |
---|
public Operator()
public Operator(org.apache.hadoop.mapred.Reporter reporter)
reporter
- Used to report progress of certain operators.Method Detail |
---|
public void setChildOperators(List<Operator<? extends Serializable>> childOperators)
public List<Operator<? extends Serializable>> getChildOperators()
public Vector<Node> getChildren()
getChildren
in interface Node
public void setParentOperators(List<Operator<? extends Serializable>> parentOperators)
public List<Operator<? extends Serializable>> getParentOperators()
public void setConf(T conf)
public T getConf()
public boolean getDone()
public void setDone(boolean done)
public void setSchema(RowSchema rowSchema)
public RowSchema getSchema()
public void setId(String id)
public String getIdentifier()
public void setReporter(org.apache.hadoop.mapred.Reporter rep)
public void setOutputCollector(org.apache.hadoop.mapred.OutputCollector out)
public void setAlias(String alias)
public Map<Enum<?>,Long> getStats()
protected boolean areAllParentsInitialized()
public void initialize(org.apache.hadoop.conf.Configuration hconf, ObjectInspector[] inputOIs) throws HiveException
hconf
- inputOIs
- input object inspector array indexes by tag id. null value is ignored.
HiveException
protected void initializeOp(org.apache.hadoop.conf.Configuration hconf) throws HiveException
HiveException
protected void initializeChildren(org.apache.hadoop.conf.Configuration hconf) throws HiveException
HiveException
public abstract void process(Object row, int tag) throws HiveException
row
- The object representing the row.tag
- The tag of the row usually means which parent this row comes from.
Rows with the same tag should have exactly the same rowInspector all the time.
HiveException
public void startGroup() throws HiveException
HiveException
public void endGroup() throws HiveException
HiveException
public void close(boolean abort) throws HiveException
HiveException
protected void closeOp(boolean abort) throws HiveException
HiveException
public void jobClose(org.apache.hadoop.conf.Configuration conf, boolean success) throws HiveException
conf
- Configuration with with which job was submittedsuccess
- whether the job was completed successfully or not
HiveException
public void replaceChild(Operator<? extends Serializable> child, Operator<? extends Serializable> newChild)
child
- the old childnewChild
- the new childpublic void removeChild(Operator<? extends Serializable> child)
public void replaceParent(Operator<? extends Serializable> parent, Operator<? extends Serializable> newParent)
parent
- the old parentnewParent
- the new parentprotected void forward(Object row, ObjectInspector rowInspector) throws HiveException
HiveException
public void resetStats()
public void preorderMap(Operator.OperatorFunc opFunc)
public void logStats()
public String getName()
getName
in interface Node
public Map<String,exprNodeDesc> getColumnExprMap()
public void setColumnExprMap(Map<String,exprNodeDesc> colExprMap)
public String dump(int level)
protected static ObjectInspector[] initEvaluators(ExprNodeEvaluator[] evals, ObjectInspector rowInspector) throws HiveException
HiveException
protected static StructObjectInspector initEvaluatorsAndReturnStruct(ExprNodeEvaluator[] evals, List<String> outputColName, ObjectInspector rowInspector) throws HiveException
HiveException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |