Search in sources :

Example 1 with TaskEnvCannotChange

use of com.mesosphere.sdk.config.validate.TaskEnvCannotChange in project dcos-commons by mesosphere.

the class Main method createSchedulerBuilder.

private static SchedulerBuilder createSchedulerBuilder(File yamlSpecFile) throws Exception {
    SchedulerConfig schedulerConfig = SchedulerConfig.fromEnv();
    RawServiceSpec rawServiceSpec = RawServiceSpec.newBuilder(yamlSpecFile).build();
    List<String> localSeeds = CassandraSeedUtils.getLocalSeeds(rawServiceSpec.getName(), schedulerConfig);
    return DefaultScheduler.newBuilder(DefaultServiceSpec.newGenerator(rawServiceSpec, schedulerConfig, yamlSpecFile.getParentFile()).setAllPodsEnv("LOCAL_SEEDS", Joiner.on(',').join(localSeeds)).build(), schedulerConfig).setCustomConfigValidators(Arrays.asList(new CassandraZoneValidator(), new TaskEnvCannotChange("node", "server", "CASSANDRA_LOCATION_DATA_CENTER", TaskEnvCannotChange.Rule.ALLOW_UNSET_TO_SET))).setPlansFrom(rawServiceSpec).setCustomResources(getResources(localSeeds)).setRecoveryManagerFactory(new CassandraRecoveryPlanOverriderFactory()).withSingleRegionConstraint();
}
Also used : TaskEnvCannotChange(com.mesosphere.sdk.config.validate.TaskEnvCannotChange) RawServiceSpec(com.mesosphere.sdk.specification.yaml.RawServiceSpec) SchedulerConfig(com.mesosphere.sdk.scheduler.SchedulerConfig)

Aggregations

TaskEnvCannotChange (com.mesosphere.sdk.config.validate.TaskEnvCannotChange)1 SchedulerConfig (com.mesosphere.sdk.scheduler.SchedulerConfig)1 RawServiceSpec (com.mesosphere.sdk.specification.yaml.RawServiceSpec)1