Tabnine Logo
DefaultApplicationSpecification.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
co.cask.cdap.internal.app.DefaultApplicationSpecification
constructor

Best Java code snippets using co.cask.cdap.internal.app.DefaultApplicationSpecification.<init> (Showing top 11 results out of 315)

origin: cdapio/cdap

Map<String, Plugin> plugins = deserializeMap(jsonObj.get("plugins"), context, Plugin.class);
return new DefaultApplicationSpecification(name, appVersion, description, configuration, artifactId,
                      datasetModules, datasetInstances,
                      mapReduces, sparks,
origin: co.cask.cdap/cdap-app-fabric

Map<String, Plugin> plugins = deserializeMap(jsonObj.get("plugins"), context, Plugin.class);
return new DefaultApplicationSpecification(name, appVersion, description, configuration, artifactId, streams,
                      datasetModules, datasetInstances,
                      flows, mapReduces, sparks,
origin: cdapio/cdap

public ApplicationSpecification createSpecification(@Nullable String applicationName,
                          @Nullable String applicationVersion) {
 // applicationName can be null only for apps before 3.2 that were not upgraded
 ArtifactScope scope = artifactId.getNamespace().equals(Id.Namespace.SYSTEM)
  ? ArtifactScope.SYSTEM : ArtifactScope.USER;
 ArtifactId artifactId = new ArtifactId(this.artifactId.getName(), this.artifactId.getVersion(), scope);
 String namespace = deployNamespace.toEntityId().getNamespace();
 String appName = applicationName == null ? name : applicationName;
 String appVersion = applicationVersion == null ? ApplicationId.DEFAULT_VERSION : applicationVersion;
 Map<String, ScheduleCreationSpec> builtScheduleSpecs = new HashMap<>();
 for (Map.Entry<String, ScheduleCreationSpec> entry : scheduleSpecs.entrySet()) {
  // If the ScheduleCreationSpec is really a builder, then build the ScheduleCreationSpec
  if (entry.getValue() instanceof DefaultScheduleBuilder.ScheduleCreationBuilder) {
   DefaultScheduleBuilder.ScheduleCreationBuilder builder =
    (DefaultScheduleBuilder.ScheduleCreationBuilder) entry.getValue();
   builtScheduleSpecs.put(entry.getKey(), builder.build(namespace, appName, appVersion));
  } else {
   builtScheduleSpecs.put(entry.getKey(), entry.getValue());
  }
 }
 return new DefaultApplicationSpecification(appName, appVersion, description,
                       configuration, artifactId,
                       getDatasetModules(), getDatasetSpecs(),
                       mapReduces, sparks, workflows, services,
                       builtScheduleSpecs, workers, getPlugins());
}
origin: co.cask.cdap/cdap-app-fabric

public ApplicationSpecification createSpecification(@Nullable String applicationName,
                          @Nullable String applicationVersion) {
 // applicationName can be null only for apps before 3.2 that were not upgraded
 ArtifactScope scope = artifactId.getNamespace().equals(Id.Namespace.SYSTEM)
  ? ArtifactScope.SYSTEM : ArtifactScope.USER;
 ArtifactId artifactId = new ArtifactId(this.artifactId.getName(), this.artifactId.getVersion(), scope);
 String namespace = deployNamespace.toEntityId().getNamespace();
 String appName = applicationName == null ? name : applicationName;
 String appVersion = applicationVersion == null ? ApplicationId.DEFAULT_VERSION : applicationVersion;
 Map<String, ScheduleCreationSpec> builtScheduleSpecs = new HashMap<>();
 for (Map.Entry<String, ScheduleCreationSpec> entry : scheduleSpecs.entrySet()) {
  // If the ScheduleCreationSpec is really a builder, then build the ScheduleCreationSpec
  if (entry.getValue() instanceof DefaultScheduleBuilder.ScheduleCreationBuilder) {
   DefaultScheduleBuilder.ScheduleCreationBuilder builder =
    (DefaultScheduleBuilder.ScheduleCreationBuilder) entry.getValue();
   builtScheduleSpecs.put(entry.getKey(), builder.build(namespace, appName, appVersion));
  } else {
   builtScheduleSpecs.put(entry.getKey(), entry.getValue());
  }
 }
 return new DefaultApplicationSpecification(appName, appVersion, description,
                       configuration, artifactId, getStreams(),
                       getDatasetModules(), getDatasetSpecs(),
                       flows, mapReduces, sparks, workflows, services,
                       builtScheduleSpecs, workers, getPlugins());
}
origin: cdapio/cdap

              Collections.emptyMap());
ApplicationSpecification dummyAppSpec1 =
 new DefaultApplicationSpecification(APP1_ID.getApplication(), "dummy app", null,
                   ARTIFACT_ID1.toApiArtifactId(),
                   Collections.emptyMap(), Collections.emptyMap(),
              Collections.emptyMap());
ApplicationSpecification dummyAppSpec2 =
 new DefaultApplicationSpecification(APP2_ID.getApplication(), "dummy app", null,
                   ARTIFACT_ID2.toApiArtifactId(),
                   Collections.emptyMap(), Collections.emptyMap(),
origin: cdapio/cdap

@Test
public void testManyMacrosInAppSpec() {
 Configuration hConf = new Configuration();
 MapReduceContextConfig cfg = new MapReduceContextConfig(hConf);
 StringBuilder appCfg = new StringBuilder();
 for (int i = 0; i < 100; i++) {
  appCfg.append("${").append(i).append("}");
  hConf.setInt(String.valueOf(i), i);
 }
 ApplicationSpecification appSpec = new DefaultApplicationSpecification(
  "name", "desc", appCfg.toString(),
  new ArtifactId("artifact", new ArtifactVersion("1.0.0"), ArtifactScope.USER),
  Collections.emptyMap(),
  Collections.emptyMap(),
  Collections.emptyMap(),
  Collections.emptyMap(),
  Collections.emptyMap(),
  Collections.emptyMap(),
  Collections.emptyMap(),
  Collections.emptyMap(),
  Collections.emptyMap()
 );
 cfg.setApplicationSpecification(appSpec);
 Assert.assertEquals(appSpec.getConfiguration(), cfg.getApplicationSpecification().getConfiguration());
}
origin: cdapio/cdap

private TaskFields createTaskInfo(ProvisionerInfo provisionerInfo) {
 ProgramRunId programRunId = NamespaceId.DEFAULT.app("app").workflow("wf").run(RunIds.generate());
 Map<String, String> systemArgs = new HashMap<>();
 Map<String, String> userArgs = new HashMap<>();
 Profile profile = new Profile(ProfileId.NATIVE.getProfile(), "label", "desc", provisionerInfo);
 SystemArguments.addProfileArgs(systemArgs, profile);
 ProgramOptions programOptions = new SimpleProgramOptions(programRunId.getParent(),
                              new BasicArguments(systemArgs),
                              new BasicArguments(userArgs));
 ArtifactId artifactId = NamespaceId.DEFAULT.artifact("testArtifact", "1.0").toApiArtifactId();
 ApplicationSpecification appSpec = new DefaultApplicationSpecification(
  "name", "1.0.0", "desc", null, artifactId,
  Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(),
  Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(),
  Collections.emptyMap());
 ProgramDescriptor programDescriptor = new ProgramDescriptor(programRunId.getParent(), appSpec);
 return new TaskFields(programDescriptor, programOptions, programRunId);
}
origin: cdapio/cdap

@Test
public void testAppSpecNotRequiredToWriteState() throws Exception {
 ProgramId programId = NamespaceId.DEFAULT.app("someapp").program(ProgramType.SERVICE, "s");
 Map<String, String> systemArguments = new HashMap<>();
 systemArguments.put(ProgramOptionConstants.SKIP_PROVISIONING, Boolean.TRUE.toString());
 systemArguments.put(SystemArguments.PROFILE_NAME, ProfileId.NATIVE.getScopedName());
 ProgramOptions programOptions = new SimpleProgramOptions(programId, new BasicArguments(systemArguments),
                              new BasicArguments());
 ProgramRunId runId = programId.run(RunIds.generate());
 ArtifactId artifactId = NamespaceId.DEFAULT.artifact("testArtifact", "1.0").toApiArtifactId();
 ApplicationSpecification appSpec = new DefaultApplicationSpecification(
  "name", "1.0.0", "desc", null, artifactId,
  Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(),
  Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(),
  Collections.emptyMap());
 ProgramDescriptor programDescriptor = new ProgramDescriptor(programId, appSpec);
 programStateWriter.start(runId, programOptions, null, programDescriptor);
 Tasks.waitFor(ProgramRunStatus.STARTING, () -> txnl.execute(() -> {
         RunRecordMeta meta = metadataStoreDataset.getRun(runId);
         if (meta == null) {
          return null;
         }
         Assert.assertEquals(artifactId, meta.getArtifactId());
         return meta.getStatus();
        }),
        10, TimeUnit.SECONDS);
 programStateWriter.completed(runId);
}
origin: cdapio/cdap

ApplicationSpecification appSpec = new DefaultApplicationSpecification(
 AppWithMultipleSchedules.NAME, ApplicationId.DEFAULT_VERSION, "desc", null, artifactId,
 Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(),
origin: cdapio/cdap

ApplicationSpecification appSpec = new DefaultApplicationSpecification(
 "name", "1.0.0", "desc", null, artifactId,
 Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(),
origin: cdapio/cdap

ArtifactId artifactId = NamespaceId.DEFAULT.artifact("testArtifact", "1.0").toApiArtifactId();
ApplicationSpecification appSpec = new DefaultApplicationSpecification(
 "name", "1.0.0", "desc", null, artifactId,
 Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(),
co.cask.cdap.internal.appDefaultApplicationSpecification<init>

Popular methods of DefaultApplicationSpecification

    Popular in Java

    • Parsing JSON documents to java classes using gson
    • getSystemService (Context)
    • putExtra (Intent)
    • getApplicationContext (Context)
    • ConnectException (java.net)
      A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
    • Time (java.sql)
      Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
    • PriorityQueue (java.util)
      A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
    • TimeZone (java.util)
      TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
    • Reference (javax.naming)
    • Scheduler (org.quartz)
      This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
    • Top PhpStorm plugins
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now