use of org.apache.hadoop.yarn.api.records.timeline.TimelineAbout in project hadoop by apache.
the class TimelineUtils method createTimelineAbout.
public static TimelineAbout createTimelineAbout(String about) {
TimelineAbout tsInfo = new TimelineAbout(about);
tsInfo.setHadoopBuildVersion(VersionInfo.getBuildVersion());
tsInfo.setHadoopVersion(VersionInfo.getVersion());
tsInfo.setHadoopVersionBuiltOn(VersionInfo.getDate());
tsInfo.setTimelineServiceBuildVersion(YarnVersionInfo.getBuildVersion());
tsInfo.setTimelineServiceVersion(YarnVersionInfo.getVersion());
tsInfo.setTimelineServiceVersionBuiltOn(YarnVersionInfo.getDate());
return tsInfo;
}
use of org.apache.hadoop.yarn.api.records.timeline.TimelineAbout in project hadoop by apache.
the class TestTimelineReaderWebServices method testAbout.
@Test
public void testAbout() throws Exception {
URI uri = URI.create("http://localhost:" + serverPort + "/ws/v2/timeline/");
Client client = createClient();
try {
ClientResponse resp = getResponse(client, uri);
TimelineAbout about = resp.getEntity(TimelineAbout.class);
Assert.assertNotNull(about);
Assert.assertEquals("Timeline Reader API", about.getAbout());
} finally {
client.destroy();
}
}
use of org.apache.hadoop.yarn.api.records.timeline.TimelineAbout in project hadoop by apache.
the class AboutBlock method render.
@Override
protected void render(Block html) {
TimelineAbout tsInfo = TimelineUtils.createTimelineAbout("Timeline Server - Generic History Service UI");
info("Timeline Server Overview")._("Timeline Server Version:", tsInfo.getTimelineServiceBuildVersion() + " on " + tsInfo.getTimelineServiceVersionBuiltOn())._("Hadoop Version:", tsInfo.getHadoopBuildVersion() + " on " + tsInfo.getHadoopVersionBuiltOn());
html._(InfoBlock.class);
}
use of org.apache.hadoop.yarn.api.records.timeline.TimelineAbout in project hadoop by apache.
the class TestAHSWebServices method testAbout.
@Test
public void testAbout() throws Exception {
WebResource r = resource();
ClientResponse response = r.path("ws").path("v1").path("applicationhistory").path("about").queryParam("user.name", USERS[round]).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
assertEquals(MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, response.getType().toString());
TimelineAbout actualAbout = response.getEntity(TimelineAbout.class);
TimelineAbout expectedAbout = TimelineUtils.createTimelineAbout("Generic History Service API");
Assert.assertNotNull("Timeline service about response is null", actualAbout);
Assert.assertEquals(expectedAbout.getAbout(), actualAbout.getAbout());
Assert.assertEquals(expectedAbout.getTimelineServiceVersion(), actualAbout.getTimelineServiceVersion());
Assert.assertEquals(expectedAbout.getTimelineServiceBuildVersion(), actualAbout.getTimelineServiceBuildVersion());
Assert.assertEquals(expectedAbout.getTimelineServiceVersionBuiltOn(), actualAbout.getTimelineServiceVersionBuiltOn());
Assert.assertEquals(expectedAbout.getHadoopVersion(), actualAbout.getHadoopVersion());
Assert.assertEquals(expectedAbout.getHadoopBuildVersion(), actualAbout.getHadoopBuildVersion());
Assert.assertEquals(expectedAbout.getHadoopVersionBuiltOn(), actualAbout.getHadoopVersionBuiltOn());
}
use of org.apache.hadoop.yarn.api.records.timeline.TimelineAbout in project hadoop by apache.
the class TestTimelineWebServices method testAbout.
@Test
public void testAbout() throws Exception {
WebResource r = resource();
ClientResponse response = r.path("ws").path("v1").path("timeline").accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
assertEquals(MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, response.getType().toString());
TimelineAbout actualAbout = response.getEntity(TimelineAbout.class);
TimelineAbout expectedAbout = TimelineUtils.createTimelineAbout("Timeline API");
Assert.assertNotNull("Timeline service about response is null", actualAbout);
Assert.assertEquals(expectedAbout.getAbout(), actualAbout.getAbout());
Assert.assertEquals(expectedAbout.getTimelineServiceVersion(), actualAbout.getTimelineServiceVersion());
Assert.assertEquals(expectedAbout.getTimelineServiceBuildVersion(), actualAbout.getTimelineServiceBuildVersion());
Assert.assertEquals(expectedAbout.getTimelineServiceVersionBuiltOn(), actualAbout.getTimelineServiceVersionBuiltOn());
Assert.assertEquals(expectedAbout.getHadoopVersion(), actualAbout.getHadoopVersion());
Assert.assertEquals(expectedAbout.getHadoopBuildVersion(), actualAbout.getHadoopBuildVersion());
Assert.assertEquals(expectedAbout.getHadoopVersionBuiltOn(), actualAbout.getHadoopVersionBuiltOn());
}
Aggregations