YARN-1962. Changed Timeline Service client configuration to be off by default given the non-readiness of the feature yet. Contributed by Mohammad Kamrul Islam.

svn merge --ignore-ancestry -c 1593750 ../../trunk/


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1593751 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vinod Kumar Vavilapalli 2014-05-11 00:15:48 +00:00
parent 914c871296
commit a098b692f4
4 changed files with 28 additions and 3 deletions

View File

@ -98,6 +98,10 @@ Release 2.4.1 - UNRELEASED
YARN-1701. Improved default paths of the timeline store and the generic YARN-1701. Improved default paths of the timeline store and the generic
history store. (Tsuyoshi Ozawa via zjshen) history store. (Tsuyoshi Ozawa via zjshen)
YARN-1962. Changed Timeline Service client configuration to be off by default
given the non-readiness of the feature yet. (Mohammad Kamrul Islam via
vinodkv)
OPTIMIZATIONS OPTIMIZATIONS
BUG FIXES BUG FIXES

View File

@ -1105,7 +1105,7 @@ public class YarnConfiguration extends Configuration {
/** The setting that controls whether timeline service is enabled or not. */ /** The setting that controls whether timeline service is enabled or not. */
public static final String TIMELINE_SERVICE_ENABLED = public static final String TIMELINE_SERVICE_ENABLED =
TIMELINE_SERVICE_PREFIX + "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. */ /** host:port address for timeline service RPC APIs. */
public static final String TIMELINE_SERVICE_ADDRESS = public static final String TIMELINE_SERVICE_ADDRESS =

View File

@ -49,7 +49,9 @@ public class TestTimelineClient {
@Before @Before
public void setup() { public void setup() {
client = createTimelineClient(new YarnConfiguration()); YarnConfiguration conf = new YarnConfiguration();
conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true);
client = createTimelineClient(conf);
} }
@After @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, private static ClientResponse mockClientResponse(TimelineClientImpl client,
ClientResponse.Status status, boolean hasError, boolean hasRuntimeError) { ClientResponse.Status status, boolean hasError, boolean hasRuntimeError) {
ClientResponse response = mock(ClientResponse.class); ClientResponse response = mock(ClientResponse.class);

View File

@ -1112,7 +1112,7 @@
If enabled, clients will put entities and events to the timeline server. If enabled, clients will put entities and events to the timeline server.
</description> </description>
<name>yarn.timeline-service.enabled</name> <name>yarn.timeline-service.enabled</name>
<value>true</value> <value>false</value>
</property> </property>
<property> <property>