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();
}
Aggregations