diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java index 0a11948..fe3c1e1 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java @@ -1105,7 +1105,7 @@ /** The setting that controls whether timeline service is enabled or not. */ public static final String TIMELINE_SERVICE_ENABLED = TIMELINE_SERVICE_PREFIX + "enabled"; - public static final boolean DEFAULT_TIMELINE_SERVICE_ENABLED = true; + public static final boolean DEFAULT_TIMELINE_SERVICE_ENABLED = false; /** host:port address for timeline service RPC APIs. */ public static final String TIMELINE_SERVICE_ADDRESS = diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestTimelineClient.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestTimelineClient.java index 8f61a05..3c5272a 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestTimelineClient.java +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestTimelineClient.java @@ -49,7 +49,9 @@ @Before public void setup() { - client = createTimelineClient(new YarnConfiguration()); + YarnConfiguration conf = new YarnConfiguration(); + conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true); + client = createTimelineClient(conf); } @After @@ -127,6 +129,25 @@ public void testPostEntitiesTimelineServiceNotEnabled() throws Exception { } } + @Test + public void testPostEntitiesTimelineServiceDefaultNotEnabled() + throws Exception { + YarnConfiguration conf = new YarnConfiguration(); + // Unset the timeline service's enabled properties. + // Make sure default value is pickup up + conf.unset(YarnConfiguration.TIMELINE_SERVICE_ENABLED); + TimelineClientImpl client = createTimelineClient(conf); + mockClientResponse(client, ClientResponse.Status.INTERNAL_SERVER_ERROR, + false, false); + try { + TimelinePutResponse response = client.putEntities(generateEntity()); + Assert.assertEquals(0, response.getErrors().size()); + } catch (YarnException e) { + Assert + .fail("putEntities should already return before throwing the exception"); + } + } + private static ClientResponse mockClientResponse(TimelineClientImpl client, ClientResponse.Status status, boolean hasError, boolean hasRuntimeError) { ClientResponse response = mock(ClientResponse.class); diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml index 4a9b03a..d86d7e4 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml @@ -1105,7 +1105,7 @@ If enabled, clients will put entities and events to the timeline server. yarn.timeline-service.enabled - true + false