ProgramType processorType = program.getType();
Preconditions.checkNotNull(processorType, "Missing processor type.");
Preconditions.checkArgument(processorType == ProgramType.FLOW, "Only FLOW process type is supported.");
try {
FlowSpecification flowSpec = appSpec.getFlows().get(program.getName());
Preconditions.checkNotNull(flowSpec, "Missing FlowSpecification for %s", program.getName());
LOG.info("Configuring flowlets queues");
Multimap<String, QueueName> flowletQueues = FlowUtils.configureQueue(program, flowSpec, streamAdmin, queueAdmin);
// Launch flowlet program runners
LOG.info("Launching distributed flow: " + program.getName() + ":" + flowSpec.getName());
TwillController controller = launcher.launch(new FlowTwillApplication(program, flowSpec,
hConfFile, cConfFile, eventHandler));
DistributedFlowletInstanceUpdater instanceUpdater = new DistributedFlowletInstanceUpdater(program, controller,
queueAdmin, streamAdmin,