use of org.apache.hadoop.hive.ql.plan.api.OperatorType in project ambrose by twitter.
the class HiveDAGTransformer method getFeatures.
/**
* Creates job feature list: consists of a tasktag and a set of operators
*
* @param ops
* @param taskTagId
* @return
*/
private String[] getFeatures(List<Operator<?>> ops, int taskTagId) {
if (ops == null) {
return EMPTY_ARR;
}
Set<String> features = Sets.newHashSet();
for (Operator<?> op : ops) {
OperatorType opType = op.getType();
// some operators are discarded
if (!skipType(opType)) {
features.add(opType.toString());
}
}
// if taskTag is other than 'NO_TAG', include it in the feature list
if (taskTagId == Task.NO_TAG) {
return features.toArray(new String[features.size()]);
}
String[] result = features.toArray(new String[features.size() + 1]);
result[result.length - 1] = TaskTag.get(taskTagId);
return result;
}
Aggregations