opRules.put(new RuleRegExp("R2", "GBY%.*FS%"), new FileSinkProcessor());
// The dispatcher fires the processor corresponding to the closest
// matching rule and passes the context along
Dispatcher disp = new DefaultRuleDispatcher(null, opRules, walkerCtx);
GraphWalker ogw = new PreOrderWalker(disp);
// Create a list of topOp nodes
ArrayList<Node> topNodes = new ArrayList<Node>();
// Get the top Nodes for this map-reduce task
for (Operator<? extends Serializable>
workOperator : topOperators) {
if (parseContext.getTopOps().values().contains(workOperator)) {
topNodes.add(workOperator);
}
}
if (task.getReducer() != null) {
topNodes.add(task.getReducer());
}
ogw.startWalking(topNodes, null);
LOG.info(String.format("Found %d metadata only table scans",
walkerCtx.getMetadataOnlyTableScans().size()));
Iterator<TableScanOperator> iterator
= walkerCtx.getMetadataOnlyTableScans().iterator();