*/
public Flow runFlow(Pipe[] tails, Map<String, Fields> inputs, Fields[] outputs,
String[] outputPaths) {
Map<String, Tap> sources = new HashMap<String, Tap>();
for (Map.Entry<String, Fields> input : inputs.entrySet()) {
Tap tap = new Hfs(new SequenceFile(input.getValue()),
manageTemporaryPath(input.getKey()));
sources.put(input.getKey(), tap);
}
if (tails.length != outputs.length) {
System.err.println("size of tails should be same as outputs.");
return null;
}
int i = 0;
Map<String, Tap> sinks = new HashMap<String, Tap>();
for (Fields output : outputs) {
String sinkName = tails[i].getName();
Tap sink = new Hfs(new SequenceFile(output), outputPaths[i]);
sinks.put(sinkName, sink);
i++;
}
Flow f = mFlowConnector.connect(sources, sinks, tails);