Search in sources :

Example 1 with TimelineAbout

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;
}
Also used : TimelineAbout(org.apache.hadoop.yarn.api.records.timeline.TimelineAbout)

Example 2 with TimelineAbout

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();
    }
}
Also used : ClientResponse(com.sun.jersey.api.client.ClientResponse) TimelineAbout(org.apache.hadoop.yarn.api.records.timeline.TimelineAbout) Client(com.sun.jersey.api.client.Client) URI(java.net.URI) Test(org.junit.Test)

Example 3 with TimelineAbout

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);
}
Also used : TimelineAbout(org.apache.hadoop.yarn.api.records.timeline.TimelineAbout)

Example 4 with TimelineAbout

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());
}
Also used : ClientResponse(com.sun.jersey.api.client.ClientResponse) TimelineAbout(org.apache.hadoop.yarn.api.records.timeline.TimelineAbout) WebResource(com.sun.jersey.api.client.WebResource) Test(org.junit.Test)

Example 5 with TimelineAbout

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());
}
Also used : ClientResponse(com.sun.jersey.api.client.ClientResponse) TimelineAbout(org.apache.hadoop.yarn.api.records.timeline.TimelineAbout) WebResource(com.sun.jersey.api.client.WebResource) Test(org.junit.Test)

Aggregations

TimelineAbout (org.apache.hadoop.yarn.api.records.timeline.TimelineAbout)5 ClientResponse (com.sun.jersey.api.client.ClientResponse)3 Test (org.junit.Test)3 WebResource (com.sun.jersey.api.client.WebResource)2 Client (com.sun.jersey.api.client.Client)1 URI (java.net.URI)1