Search in sources :

Example 1 with ApplicationContext

use of co.cask.cdap.api.app.ApplicationContext in project cdap by caskdata.

the class DistributedProgramRunnerTxTimeoutTest method setup.

@BeforeClass
public static void setup() {
    Application app = new AppWithAllProgramTypes();
    DefaultAppConfigurer configurer = new DefaultAppConfigurer(Id.Namespace.DEFAULT, new Id.Artifact(Id.Namespace.DEFAULT, "artifact", new ArtifactVersion("0.1")), app);
    app.configure(configurer, new ApplicationContext() {

        @Override
        public Config getConfig() {
            return null;
        }
    });
    appSpec = configurer.createSpecification("app", "1.0");
    // System.out.println(new GsonBuilder().setPrettyPrinting().create().toJson(appSpec));
    cConf.setInt(TxConstants.Manager.CFG_TX_MAX_TIMEOUT, 60);
    flowRunner = new DistributedFlowProgramRunner(null, yConf, cConf, null, null, null, null, null);
    serviceRunner = new DistributedServiceProgramRunner(null, yConf, cConf, null, null);
    workerRunner = new DistributedWorkerProgramRunner(null, yConf, cConf, null, null);
    mapreduceRunner = new DistributedMapReduceProgramRunner(null, yConf, cConf, null, null);
    sparkRunner = new DistributedSparkProgramRunner(SparkCompat.SPARK1_2_10, null, yConf, cConf, null, null, null);
    workflowRunner = new DistributedWorkflowProgramRunner(null, yConf, cConf, null, null, null);
}
Also used : DefaultAppConfigurer(co.cask.cdap.app.DefaultAppConfigurer) Config(co.cask.cdap.api.Config) ApplicationContext(co.cask.cdap.api.app.ApplicationContext) ArtifactVersion(co.cask.cdap.api.artifact.ArtifactVersion) ProgramId(co.cask.cdap.proto.id.ProgramId) Id(co.cask.cdap.common.id.Id) Application(co.cask.cdap.api.app.Application) AbstractApplication(co.cask.cdap.api.app.AbstractApplication) DistributedSparkProgramRunner(co.cask.cdap.app.runtime.spark.distributed.DistributedSparkProgramRunner) BeforeClass(org.junit.BeforeClass)

Aggregations

Config (co.cask.cdap.api.Config)1 AbstractApplication (co.cask.cdap.api.app.AbstractApplication)1 Application (co.cask.cdap.api.app.Application)1 ApplicationContext (co.cask.cdap.api.app.ApplicationContext)1 ArtifactVersion (co.cask.cdap.api.artifact.ArtifactVersion)1 DefaultAppConfigurer (co.cask.cdap.app.DefaultAppConfigurer)1 DistributedSparkProgramRunner (co.cask.cdap.app.runtime.spark.distributed.DistributedSparkProgramRunner)1 Id (co.cask.cdap.common.id.Id)1 ProgramId (co.cask.cdap.proto.id.ProgramId)1 BeforeClass (org.junit.BeforeClass)1