org.apache.hadoop.hive.ql.optimizer
Class GenMapRedUtils

java.lang.Object
  extended by org.apache.hadoop.hive.ql.optimizer.GenMapRedUtils

public class GenMapRedUtils
extends Object

General utility common functions for the Processor to convert operator into map-reduce tasks


Constructor Summary
GenMapRedUtils()
           
 
Method Summary
static mapredWork getMapRedWork()
          create a new plan and return
static void initPlan(ReduceSinkOperator op, GenMRProcContext opProcCtx)
          Initialize the current plan by adding it to root tasks
static void initUnionPlan(GenMRProcContext opProcCtx, Task<? extends Serializable> currTask)
           
static void initUnionPlan(ReduceSinkOperator op, GenMRProcContext opProcCtx)
          Initialize the current union plan.
static void joinPlan(ReduceSinkOperator op, Task<? extends Serializable> oldTask, Task<? extends Serializable> task, GenMRProcContext opProcCtx)
          Merge the current task with the task for the current reducer
static void setKeyAndValueDesc(mapredWork plan, Operator<? extends Serializable> topOp)
          set key and value descriptor
static void setTaskPlan(String alias_id, Operator<? extends Serializable> topOp, mapredWork plan, boolean local, GenMRProcContext opProcCtx)
          set the current task in the mapredWork
static void splitPlan(ReduceSinkOperator op, GenMRProcContext opProcCtx)
          Split the current plan by creating a temporary destination
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenMapRedUtils

public GenMapRedUtils()
Method Detail

initPlan

public static void initPlan(ReduceSinkOperator op,
                            GenMRProcContext opProcCtx)
                     throws SemanticException
Initialize the current plan by adding it to root tasks

Parameters:
op - the reduce sink operator encountered
opProcCtx - processing context
Throws:
SemanticException

initUnionPlan

public static void initUnionPlan(ReduceSinkOperator op,
                                 GenMRProcContext opProcCtx)
                          throws SemanticException
Initialize the current union plan.

Parameters:
op - the reduce sink operator encountered
opProcCtx - processing context
Throws:
SemanticException

initUnionPlan

public static void initUnionPlan(GenMRProcContext opProcCtx,
                                 Task<? extends Serializable> currTask)

joinPlan

public static void joinPlan(ReduceSinkOperator op,
                            Task<? extends Serializable> oldTask,
                            Task<? extends Serializable> task,
                            GenMRProcContext opProcCtx)
                     throws SemanticException
Merge the current task with the task for the current reducer

Parameters:
task - for the old task for the current reducer
opProcCtx - processing context
Throws:
SemanticException

splitPlan

public static void splitPlan(ReduceSinkOperator op,
                             GenMRProcContext opProcCtx)
                      throws SemanticException
Split the current plan by creating a temporary destination

Parameters:
op - the reduce sink operator encountered
opProcCtx - processing context
Throws:
SemanticException

setTaskPlan

public static void setTaskPlan(String alias_id,
                               Operator<? extends Serializable> topOp,
                               mapredWork plan,
                               boolean local,
                               GenMRProcContext opProcCtx)
                        throws SemanticException
set the current task in the mapredWork

Parameters:
alias_id - current alias
topOp - the top operator of the stack
plan - current plan
local - whether you need to add to map-reduce or local work
opProcCtx - processing context
Throws:
SemanticException

setKeyAndValueDesc

public static void setKeyAndValueDesc(mapredWork plan,
                                      Operator<? extends Serializable> topOp)
set key and value descriptor

Parameters:
plan - current plan
topOp - current top operator in the path

getMapRedWork

public static mapredWork getMapRedWork()
create a new plan and return

Returns:
the new plan


Copyright © 2009 The Apache Software Foundation