Search in sources :

Example 6 with WorkflowProgramInfo

use of co.cask.cdap.internal.app.runtime.workflow.WorkflowProgramInfo in project cdap by caskdata.

the class MapReduceContextConfig method getWorkflowProgramInfo.

/**
   * Returns the {@link WorkflowProgramInfo} if it is running inside Workflow or {@code null} if not.
   */
@Nullable
WorkflowProgramInfo getWorkflowProgramInfo() {
    String info = hConf.get(HCONF_ATTR_WORKFLOW_INFO);
    if (info == null) {
        return null;
    }
    WorkflowProgramInfo workflowProgramInfo = GSON.fromJson(info, WorkflowProgramInfo.class);
    workflowProgramInfo.getWorkflowToken().disablePut();
    return workflowProgramInfo;
}
Also used : WorkflowProgramInfo(co.cask.cdap.internal.app.runtime.workflow.WorkflowProgramInfo) Nullable(javax.annotation.Nullable)

Aggregations

WorkflowProgramInfo (co.cask.cdap.internal.app.runtime.workflow.WorkflowProgramInfo)6 MetricsCollectionService (co.cask.cdap.api.metrics.MetricsCollectionService)4 CConfiguration (co.cask.cdap.common.conf.CConfiguration)4 ProgramContextAware (co.cask.cdap.data.ProgramContextAware)4 DatasetFramework (co.cask.cdap.data2.dataset2.DatasetFramework)4 BasicProgramContext (co.cask.cdap.internal.app.runtime.BasicProgramContext)4 NameMappedDatasetFramework (co.cask.cdap.internal.app.runtime.workflow.NameMappedDatasetFramework)4 MessagingService (co.cask.cdap.messaging.MessagingService)4 PluginInstantiator (co.cask.cdap.internal.app.runtime.plugin.PluginInstantiator)3 ProgramId (co.cask.cdap.proto.id.ProgramId)3 Service (com.google.common.util.concurrent.Service)3 Configuration (org.apache.hadoop.conf.Configuration)3 RunId (org.apache.twill.api.RunId)3 ApplicationSpecification (co.cask.cdap.api.app.ApplicationSpecification)2 MapReduceSpecification (co.cask.cdap.api.mapreduce.MapReduceSpecification)2 DefaultProgram (co.cask.cdap.app.program.DefaultProgram)2 Program (co.cask.cdap.app.program.Program)2 Arguments (co.cask.cdap.app.runtime.Arguments)2 ProgramController (co.cask.cdap.app.runtime.ProgramController)2 InstantiatorFactory (co.cask.cdap.common.lang.InstantiatorFactory)2