System.clearProperty(XLearningConstants.Environment.HADOOP_USER_NAME.toString()); YarnConfiguration xlearningConf = new YarnConfiguration(); if (xlearningConf.getBoolean(XLearningConfiguration.XLEARNING_CLEANUP_ENABLE, XLearningConfiguration.DEFAULT_XLEARNING_CLEANUP_ENABLE)) { Path stagingDir = new Path(envs.get(XLearningConstants.Environment.XLEARNING_STAGING_LOCATION.toString())); try {
@Override public YarnClient get() { YarnClient client = YarnClient.createYarnClient(); if (yarnConfiguration.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, false)) { try { TimelineClient.createTimelineClient(); } catch (NoClassDefFoundError e) { logger.warn("createTimelineClient() error with {}", TimelineClient.class.getResource(TimelineClient.class.getSimpleName() + ".class"), e); yarnConfiguration.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, false); } } client.init(yarnConfiguration); client.start(); return client; } }
if (configuration.getBoolean(Constants.Explore.TIMELINE_SERVICE_ENABLED, false)) {
getConf()); boolean isHAEnabled = yarnConf.getBoolean(YarnConfiguration.RM_HA_ENABLED, YarnConfiguration.DEFAULT_RM_HA_ENABLED);
getConf()); boolean isHAEnabled = yarnConf.getBoolean(YarnConfiguration.RM_HA_ENABLED, YarnConfiguration.DEFAULT_RM_HA_ENABLED);
if (configuration.getBoolean(Constants.Explore.TIMELINE_SERVICE_ENABLED, false)) {
getConf()); boolean isHAEnabled = yarnConf.getBoolean(YarnConfiguration.RM_HA_ENABLED, YarnConfiguration.DEFAULT_RM_HA_ENABLED);
getConf()); boolean isHAEnabled = yarnConf.getBoolean(YarnConfiguration.RM_HA_ENABLED, YarnConfiguration.DEFAULT_RM_HA_ENABLED);
liveInfos = createLiveInfos(); boolean enableSecureStoreUpdate = yarnConfig.getBoolean(Configs.Keys.SECURE_STORE_UPDATE_LOCATION_ENABLED, true);
liveInfos = createLiveInfos(); boolean enableSecureStoreUpdate = yarnConfig.getBoolean(Configs.Keys.SECURE_STORE_UPDATE_LOCATION_ENABLED, true);
@Test public void testTimelineServiceIsDisabledByDefault(){ YarnController controller = Mockito.mock(YarnController.class); YarnService yarnService = new YarnService(new TestListener(), controller, Mockito.mock(NodeProvider.class)); Cluster cluster = new Cluster(); cluster.setState(ClusterState.CREATED); cluster.setId(new ClusterId(UUID.randomUUID().toString())); ClusterConfig clusterConfig = new ClusterConfig(); clusterConfig.setClusterSpec(new ClusterSpec(2, 4096, 4096, 2)); List<Property> propertyList = new ArrayList<>(); clusterConfig.setSubPropertyList(propertyList); RunId runId = RunIds.generate(); cluster.setClusterConfig(clusterConfig); cluster.setRunId(new com.dremio.provision.RunId(runId.toString())); YarnConfiguration yarnConfig = new YarnConfiguration(); // Test that it is false by default yarnConfig.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true); yarnService.updateYarnConfiguration(cluster, yarnConfig); assertFalse(yarnConfig.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true)); // Test that it can be overwritten yarnConfig.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, false); cluster.getClusterConfig().getSubPropertyList().add(new Property(YarnConfiguration.TIMELINE_SERVICE_ENABLED, "true")); yarnService.updateYarnConfiguration(cluster, yarnConfig); assertTrue(yarnConfig.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, false)); }