public class OperatorUtils extends Object
Constructor and Description |
---|
OperatorUtils() |
Modifier and Type | Method and Description |
---|---|
static com.google.common.collect.Multimap<Class<? extends Operator<?>>,Operator<?>> |
classifyOperators(Operator<?> start,
Set<Class<? extends Operator<?>>> classes)
Given an operator and a set of classes, it classifies the operators it finds
in the stream depending on the classes they instantiate.
|
static com.google.common.collect.Multimap<Class<? extends Operator<?>>,Operator<?>> |
classifyOperatorsUpstream(Operator<?> start,
Set<Class<? extends Operator<?>>> classes)
Given an operator and a set of classes, it classifies the operators it finds
upstream depending on the classes it instantiates.
|
static <T> T |
findLastOperator(Operator<?> op,
Class<T> clazz)
Starting at the input operator, finds the last operator in the stream that
is an instance of the input class.
|
static <T> T |
findLastOperatorUpstream(Operator<?> op,
Class<T> clazz)
Starting at the input operator, finds the last operator upstream that is
an instance of the input class.
|
static <T> Set<T> |
findOperators(Collection<Operator<?>> starts,
Class<T> clazz) |
static <T> Set<T> |
findOperators(Operator<?> start,
Class<T> clazz) |
static <T> Set<T> |
findOperatorsUpstream(Collection<Operator<?>> starts,
Class<T> clazz) |
static <T> Set<T> |
findOperatorsUpstream(Operator<?> start,
Class<T> clazz) |
static <T> Set<T> |
findOperatorsUpstreamJoinAccounted(Operator<?> start,
Class<T> clazz,
Set<T> found) |
static <T> T |
findSingleOperator(Operator<?> start,
Class<T> clazz) |
static <T> T |
findSingleOperatorUpstream(Operator<?> start,
Class<T> clazz) |
static <T> T |
findSingleOperatorUpstreamJoinAccounted(Operator<?> start,
Class<T> clazz) |
static void |
iterateParents(Operator<?> operator,
NodeUtils.Function<Operator<?>> function) |
static boolean |
sameRowSchema(Operator<?> operator1,
Operator<?> operator2) |
static void |
setChildrenCollector(List<Operator<? extends OperatorDesc>> childOperators,
Map<String,org.apache.hadoop.mapred.OutputCollector> outMap) |
static void |
setChildrenCollector(List<Operator<? extends OperatorDesc>> childOperators,
org.apache.hadoop.mapred.OutputCollector out) |
public static <T> Set<T> findOperators(Collection<Operator<?>> starts, Class<T> clazz)
public static <T> Set<T> findOperatorsUpstream(Operator<?> start, Class<T> clazz)
public static <T> T findSingleOperatorUpstream(Operator<?> start, Class<T> clazz)
public static <T> T findSingleOperatorUpstreamJoinAccounted(Operator<?> start, Class<T> clazz)
public static <T> Set<T> findOperatorsUpstream(Collection<Operator<?>> starts, Class<T> clazz)
public static <T> Set<T> findOperatorsUpstreamJoinAccounted(Operator<?> start, Class<T> clazz, Set<T> found)
public static void setChildrenCollector(List<Operator<? extends OperatorDesc>> childOperators, org.apache.hadoop.mapred.OutputCollector out)
public static void setChildrenCollector(List<Operator<? extends OperatorDesc>> childOperators, Map<String,org.apache.hadoop.mapred.OutputCollector> outMap)
public static <T> T findLastOperator(Operator<?> op, Class<T> clazz)
op
- the starting operatorclazz
- the class that the operator that we are looking for instantiatespublic static <T> T findLastOperatorUpstream(Operator<?> op, Class<T> clazz)
op
- the starting operatorclazz
- the class that the operator that we are looking for instantiatespublic static void iterateParents(Operator<?> operator, NodeUtils.Function<Operator<?>> function)
public static com.google.common.collect.Multimap<Class<? extends Operator<?>>,Operator<?>> classifyOperators(Operator<?> start, Set<Class<? extends Operator<?>>> classes)
start
- the start operatorclasses
- the set of classespublic static com.google.common.collect.Multimap<Class<? extends Operator<?>>,Operator<?>> classifyOperatorsUpstream(Operator<?> start, Set<Class<? extends Operator<?>>> classes)
start
- the start operatorclasses
- the set of classesCopyright © 2017 The Apache Software Foundation. All rights reserved.