Package org.apache.hadoop.yarn.server.nodemanager.containermanager.application

Examples of org.apache.hadoop.yarn.server.nodemanager.containermanager.application.Application


    RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(conf);
    String user = "nobody";
    long clusterTimeStamp = 1234;
    ApplicationId appId = BuilderUtils.newApplicationId(recordFactory,
        clusterTimeStamp, 1);
    Application app = mock(Application.class);
    when(app.getUser()).thenReturn(user);
    when(app.getAppId()).thenReturn(appId);
    ApplicationAttemptId appAttemptId = BuilderUtils.newApplicationAttemptId(
        appId, 1);
    ContainerId container1 = BuilderUtils.newContainerId(recordFactory, appId,
        appAttemptId, 0);
    nmContext.getApplications().put(appId, app);
View Full Code Here


      RecordFactory recordFactory =
          RecordFactoryProvider.getRecordFactory(conf);
      long clusterTimeStamp = 1234;
      ApplicationId appId =
          BuilderUtils.newApplicationId(recordFactory, clusterTimeStamp, 1);
      Application app = mock(Application.class);
      when(app.getAppId()).thenReturn(appId);

      // Making sure that application returns a random user. This is required
      // for SecureIOUtils' file owner check.
      when(app.getUser()).thenReturn(user);

      ApplicationAttemptId appAttemptId =
          BuilderUtils.newApplicationAttemptId(appId, 1);
      ContainerId container1 =
          BuilderUtils.newContainerId(recordFactory, appId, appAttemptId, 0);
View Full Code Here

  }

  public void testNodeHelper(String path, String media) throws JSONException,
      Exception {
    WebResource r = resource();
    Application app = new MockApp(1);
    nmContext.getApplications().put(app.getAppId(), app);
    addAppContainers(app);
    Application app2 = new MockApp(2);
    nmContext.getApplications().put(app2.getAppId(), app2);
    addAppContainers(app2);

    ClientResponse response = r.path("ws").path("v1").path("node").path(path)
        .accept(media).get(ClientResponse.class);
    assertEquals(MediaType.APPLICATION_JSON_TYPE, response.getType());
View Full Code Here

  }

  public void testNodeSingleContainersHelper(String media)
      throws JSONException, Exception {
    WebResource r = resource();
    Application app = new MockApp(1);
    nmContext.getApplications().put(app.getAppId(), app);
    HashMap<String, String> hash = addAppContainers(app);
    Application app2 = new MockApp(2);
    nmContext.getApplications().put(app2.getAppId(), app2);
    addAppContainers(app2);

    for (String id : hash.keySet()) {
      ClientResponse response = r.path("ws").path("v1").path("node")
          .path("containers").path(id).accept(media).get(ClientResponse.class);
View Full Code Here

  }

  @Test
  public void testSingleContainerInvalid() throws JSONException, Exception {
    WebResource r = resource();
    Application app = new MockApp(1);
    nmContext.getApplications().put(app.getAppId(), app);
    addAppContainers(app);
    Application app2 = new MockApp(2);
    nmContext.getApplications().put(app2.getAppId(), app2);
    addAppContainers(app2);
    try {
      r.path("ws").path("v1").path("node").path("containers")
          .path("container_foo_1234").accept(MediaType.APPLICATION_JSON)
          .get(JSONObject.class);
View Full Code Here

  }

  @Test
  public void testSingleContainerInvalid2() throws JSONException, Exception {
    WebResource r = resource();
    Application app = new MockApp(1);
    nmContext.getApplications().put(app.getAppId(), app);
    addAppContainers(app);
    Application app2 = new MockApp(2);
    nmContext.getApplications().put(app2.getAppId(), app2);
    addAppContainers(app2);
    try {
      r.path("ws").path("v1").path("node").path("containers")
          .path("container_1234_0001").accept(MediaType.APPLICATION_JSON)
          .get(JSONObject.class);
View Full Code Here

  }

  @Test
  public void testSingleContainerWrong() throws JSONException, Exception {
    WebResource r = resource();
    Application app = new MockApp(1);
    nmContext.getApplications().put(app.getAppId(), app);
    addAppContainers(app);
    Application app2 = new MockApp(2);
    nmContext.getApplications().put(app2.getAppId(), app2);
    addAppContainers(app2);
    try {
      r.path("ws").path("v1").path("node").path("containers")
          .path("container_1234_0001_01_000005")
          .accept(MediaType.APPLICATION_JSON).get(JSONObject.class);
View Full Code Here

  }

  @Test
  public void testNodeSingleContainerXML() throws JSONException, Exception {
    WebResource r = resource();
    Application app = new MockApp(1);
    nmContext.getApplications().put(app.getAppId(), app);
    HashMap<String, String> hash = addAppContainers(app);
    Application app2 = new MockApp(2);
    nmContext.getApplications().put(app2.getAppId(), app2);
    addAppContainers(app2);

    for (String id : hash.keySet()) {
      ClientResponse response = r.path("ws").path("v1").path("node")
          .path("containers").path(id).accept(MediaType.APPLICATION_XML)
View Full Code Here

  }

  @Test
  public void testNodeContainerXML() throws JSONException, Exception {
    WebResource r = resource();
    Application app = new MockApp(1);
    nmContext.getApplications().put(app.getAppId(), app);
    addAppContainers(app);
    Application app2 = new MockApp(2);
    nmContext.getApplications().put(app2.getAppId(), app2);
    addAppContainers(app2);

    ClientResponse response = r.path("ws").path("v1").path("node")
        .path("containers").accept(MediaType.APPLICATION_XML)
        .get(ClientResponse.class);
View Full Code Here

        return;
      }

      ApplicationId applicationId = containerId.getApplicationAttemptId()
          .getApplicationId();
      Application application = this.nmContext.getApplications().get(
          applicationId);
      Container container = this.nmContext.getContainers().get(containerId);

      if (application == null) {
        html.h1(
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.server.nodemanager.containermanager.application.Application

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.