Search in sources :

Example 16 with FlowletDefinition

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

the class DefaultStore method getFlowletInstances.

@Override
public int getFlowletInstances(ProgramId id, String flowletId) {
    return Transactionals.execute(transactional, context -> {
        ApplicationSpecification appSpec = getAppSpecOrFail(getAppMetadataStore(context), id);
        FlowSpecification flowSpec = getFlowSpecOrFail(id, appSpec);
        FlowletDefinition flowletDef = getFlowletDefinitionOrFail(flowSpec, flowletId, id);
        return flowletDef.getInstances();
    });
}
Also used : ApplicationSpecification(co.cask.cdap.api.app.ApplicationSpecification) ForwardingApplicationSpecification(co.cask.cdap.internal.app.ForwardingApplicationSpecification) FlowletDefinition(co.cask.cdap.api.flow.FlowletDefinition) FlowSpecification(co.cask.cdap.api.flow.FlowSpecification) ForwardingFlowSpecification(co.cask.cdap.internal.app.ForwardingFlowSpecification)

Aggregations

FlowletDefinition (co.cask.cdap.api.flow.FlowletDefinition)16 FlowSpecification (co.cask.cdap.api.flow.FlowSpecification)7 Map (java.util.Map)7 Set (java.util.Set)6 QueueSpecification (co.cask.cdap.app.queue.QueueSpecification)5 FlowletConnection (co.cask.cdap.api.flow.FlowletConnection)4 SimpleQueueSpecificationGenerator (co.cask.cdap.internal.app.queue.SimpleQueueSpecificationGenerator)4 ApplicationSpecification (co.cask.cdap.api.app.ApplicationSpecification)3 ApplicationId (co.cask.cdap.proto.id.ApplicationId)3 ImmutableSet (com.google.common.collect.ImmutableSet)3 HashMap (java.util.HashMap)3 Schema (co.cask.cdap.api.data.schema.Schema)2 FlowletSpecification (co.cask.cdap.api.flow.flowlet.FlowletSpecification)2 ProgramController (co.cask.cdap.app.runtime.ProgramController)2 ProgramOptions (co.cask.cdap.app.runtime.ProgramOptions)2 QueueName (co.cask.cdap.common.queue.QueueName)2 ConsumerGroupConfig (co.cask.cdap.data2.queue.ConsumerGroupConfig)2 ForwardingFlowSpecification (co.cask.cdap.internal.app.ForwardingFlowSpecification)2 AbstractProgramController (co.cask.cdap.internal.app.runtime.AbstractProgramController)2 SimpleProgramOptions (co.cask.cdap.internal.app.runtime.SimpleProgramOptions)2