Search in sources :

Example 1 with FlowletSpecification

use of co.cask.cdap.api.flow.flowlet.FlowletSpecification in project cdap by caskdata.

the class DistributedFlowProgramRunner method setupLaunchConfig.

@Override
protected void setupLaunchConfig(LaunchConfig launchConfig, Program program, ProgramOptions options, CConfiguration cConf, Configuration hConf, File tempDir) {
    // Add runnables
    Map<String, String> args = options.getUserArguments().asMap();
    FlowSpecification flowSpec = getFlowSpecification(program);
    for (Map.Entry<String, FlowletDefinition> entry : flowSpec.getFlowlets().entrySet()) {
        FlowletDefinition flowletDefinition = entry.getValue();
        FlowletSpecification flowletSpec = flowletDefinition.getFlowletSpec();
        String flowletName = entry.getKey();
        Map<String, String> flowletArgs = RuntimeArguments.extractScope(FlowUtils.FLOWLET_SCOPE, flowletName, args);
        Resources resources = SystemArguments.getResources(flowletArgs, flowletSpec.getResources());
        launchConfig.addRunnable(entry.getKey(), new FlowletTwillRunnable(flowletName), resources, flowletDefinition.getInstances());
    }
}
Also used : FlowletDefinition(co.cask.cdap.api.flow.FlowletDefinition) FlowSpecification(co.cask.cdap.api.flow.FlowSpecification) FlowletSpecification(co.cask.cdap.api.flow.flowlet.FlowletSpecification) Resources(co.cask.cdap.api.Resources) Map(java.util.Map)

Aggregations

Resources (co.cask.cdap.api.Resources)1 FlowSpecification (co.cask.cdap.api.flow.FlowSpecification)1 FlowletDefinition (co.cask.cdap.api.flow.FlowletDefinition)1 FlowletSpecification (co.cask.cdap.api.flow.flowlet.FlowletSpecification)1 Map (java.util.Map)1