MyriadConfiguration { public Map<String, ServiceConfiguration> getServiceConfigurations() { return Optional.fromNullable(services).or(EMPTY_SERVICE_CONFIGURATION); } MyriadConfiguration(); String getMesosMaster(); Boolean isCheckpoint(); Optional<MyriadContainerConfiguration> getContainerInfo(); String getFrameworkRole(); String getFrameworkName(); Double getFrameworkFailoverTimeout(); Optional<String> getFrameworkUser(); Optional<String> getFrameworkSuperUser(); Map<String, Map<String, String>> getProfiles(); Map<String, Integer> getNmInstances(); Boolean isRebalancerEnabled(); Boolean isHAEnabled(); NodeManagerConfiguration getNodeManagerConfiguration(); Map<String, ServiceConfiguration> getServiceConfigurations(); Optional<ServiceConfiguration> getServiceConfiguration(String taskName); MyriadExecutorConfiguration getMyriadExecutorConfiguration(); String getNativeLibrary(); String getZkServers(); Integer getZkTimeout(); Integer getRestApiPort(); Map<String, String> getYarnEnvironment(); String getMesosAuthenticationSecretFilename(); String getMesosAuthenticationPrincipal(); Optional<String> getServedConfigPath(); Optional<String> getServedBinaryPath(); String getCGroupPath(); Boolean isCgroupEnabled(); static final Boolean DEFAULT_CHECKPOINT; static final Boolean DEFAULT_REBALANCER_ENABLED; static final Boolean DEFAULT_HA_ENABLED; static final Double DEFAULT_FRAMEWORK_FAILOVER_TIMEOUT_MS; static final String DEFAULT_FRAMEWORK_NAME; static final String DEFAULT_NATIVE_LIBRARY; static final Integer DEFAULT_ZK_TIMEOUT; static final Integer DEFAULT_REST_API_PORT; static final String DEFAULT_ROLE; static final String DEFAULT_ZK_SERVERS; static final String DEFAULT_CGROUP_PATH; static final Boolean DEFAULT_CGROUPS_ENABLED; static final Map<String, ServiceConfiguration> EMPTY_SERVICE_CONFIGURATION; }
@Test public void testServiceConfigurations() throws Exception { Map<String, ServiceConfiguration> confs = cfg.getServiceConfigurations(); Set<String> configKeys = Sets.newHashSet("jobhistory", "timelineserver"); assertEquals(configKeys, confs.keySet()); ServiceConfiguration sConfig = confs.get("jobhistory"); assertEquals(new Double(1.0), sConfig.getCpus()); assertEquals("jobhistory", sConfig.getTaskName()); }