Examples of StartContainerRequest


Examples of org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest

    containerLaunchContext.setResource(
        recordFactory.newRecordInstance(Resource.class));
//    containerLaunchContext.env = new HashMap<CharSequence, CharSequence>();
//    containerLaunchContext.command = new ArrayList<CharSequence>();
   
    StartContainerRequest scRequest =
        recordFactory.newRecordInstance(StartContainerRequest.class);
    scRequest.setContainerLaunchContext(containerLaunchContext);
    proxy.startContainer(scRequest);
   
    GetContainerStatusRequest gcsRequest =
        recordFactory.newRecordInstance(GetContainerStatusRequest.class);
    gcsRequest.setContainerId(containerLaunchContext.getContainerId());
View Full Code Here

Examples of org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest

      application.getSubmissionContext();
    LOG.info("Setting up container " + application.getMasterContainer()
        + " for AM " + application.getAppAttemptId())
    ContainerLaunchContext launchContext =
        createAMContainerLaunchContext(applicationContext, masterContainerID);
    StartContainerRequest request =
        recordFactory.newRecordInstance(StartContainerRequest.class);
    request.setContainerLaunchContext(launchContext);
    containerMgrProxy.startContainer(request);
    LOG.info("Done launching container " + application.getMasterContainer()
        + " for AM " + application.getAppAttemptId());
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest

                .createSocketAddr(allocatedContainer.getNodeId().toString()),
            conf);

        LOG.info("Going to contact NM with expired token");
        ContainerLaunchContext context = createContainerLaunchContextForTest(newTokenId);
        StartContainerRequest request = Records.newRecord(StartContainerRequest.class);
        request.setContainerLaunchContext(context);

        //Calling startContainer with an expired token.
        try {
          client.startContainer(request);
          fail("Connection initiation with expired "
              + "token is expected to fail.");
        } catch (Throwable t) {
          LOG.info("Got exception : ", t);
          Assert.assertTrue(t.getMessage().contains(
                  "This token is expired. current time is"));
        }

        // Try stopping a container - should not get an expiry error.
        StopContainerRequest stopRequest = Records.newRecord(StopContainerRequest.class);
        stopRequest.setContainerId(newTokenId.getContainerID());
        try {
          client.stopContainer(stopRequest);
        } catch (Throwable t) {
          fail("Stop Container call should have succeeded");
        }
       
        return null;
      }
    });
    /////////// End of testing calls with expired tokens

    KillApplicationRequest request = Records
        .newRecord(KillApplicationRequest.class);
    request.setApplicationId(appID);
    resourceManager.getClientRMService().forceKillApplication(request);
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest

    }
  }

  void callWithIllegalResource(ContainerManager client,
      ContainerTokenIdentifier tokenId) {
    StartContainerRequest request = recordFactory
        .newRecordInstance(StartContainerRequest.class);
    // Authenticated but unauthorized, due to wrong resource
    ContainerLaunchContext context =
        createContainerLaunchContextForTest(tokenId);
    context.getResource().setMemory(2048); // Set a different resource size.
    request.setContainerLaunchContext(context);
    try {
      client.startContainer(request);
      fail("Connection initiation with unauthorized "
          + "access is expected to fail.");
    } catch (YarnRemoteException e) {
View Full Code Here

Examples of org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest

    }
  }

  void callWithIllegalUserName(ContainerManager client,
      ContainerTokenIdentifier tokenId) {
    StartContainerRequest request = recordFactory
        .newRecordInstance(StartContainerRequest.class);
    // Authenticated but unauthorized, due to wrong resource
    ContainerLaunchContext context =
        createContainerLaunchContextForTest(tokenId);
    context.setUser("Saruman"); // Set a different user-name.
    request.setContainerLaunchContext(context);
    try {
      client.startContainer(request);
      fail("Connection initiation with unauthorized "
          + "access is expected to fail.");
    } catch (YarnRemoteException e) {
View Full Code Here

Examples of org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest

      List<String> commands = new ArrayList<String>();
      commands.add(command.toString());
      ctx.setCommands(commands);

      StartContainerRequest startReq = Records.newRecord(StartContainerRequest.class);
      startReq.setContainerLaunchContext(ctx);
      try {
        cm.startContainer(startReq);
      } catch (YarnRemoteException e) {
        LOG.info("Start container failed for :"
            + ", containerId=" + container.getId());
View Full Code Here

Examples of org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest

        // Construct the actual Container
        ContainerLaunchContext containerLaunchContext =
          event.getContainerLaunchContext();

        // Now launch the actual container
        StartContainerRequest startRequest = Records
          .newRecord(StartContainerRequest.class);
        startRequest.setContainerToken(event.getContainerToken());
        startRequest.setContainerLaunchContext(containerLaunchContext);

        StartContainersResponse response =
            proxy.getContainerManagementProtocol().startContainers(
                StartContainersRequest.newInstance(
                    Collections.singletonList(startRequest)));
View Full Code Here

Examples of org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest

        // Construct the actual Container
        ContainerLaunchContext containerLaunchContext =
          event.getContainer();

        // Now launch the actual container
        StartContainerRequest startRequest = Records
          .newRecord(StartContainerRequest.class);
        startRequest.setContainerLaunchContext(containerLaunchContext);
        StartContainerResponse response = proxy.startContainer(startRequest);

        ByteBuffer portInfo = response
          .getServiceResponse(ShuffleHandler.MAPREDUCE_SHUFFLE_SERVICEID);
        int port = -1;
View Full Code Here

Examples of org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest

    commands.add(scriptFile.getAbsolutePath());
    containerLaunchContext.setCommands(commands);
    containerLaunchContext.setResource(recordFactory
        .newRecordInstance(Resource.class));
    containerLaunchContext.getResource().setMemory(8 * 1024 * 1024);
    StartContainerRequest startRequest =
        recordFactory.newRecordInstance(StartContainerRequest.class);
    startRequest.setContainerLaunchContext(containerLaunchContext);
    containerManager.startContainer(startRequest);

    int timeoutSecs = 0;
    while (!processStartFile.exists() && timeoutSecs++ < 20) {
      Thread.sleep(1000);
View Full Code Here

Examples of org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest

    List<String> commands = new ArrayList<String>();
    containerLaunchContext.setCommands(commands);
    containerLaunchContext.setResource(Records
        .newRecord(Resource.class));
    containerLaunchContext.getResource().setMemory(1024);
    StartContainerRequest startRequest =
        Records.newRecord(StartContainerRequest.class);
    startRequest.setContainerLaunchContext(containerLaunchContext);
    containerManager.startContainer(startRequest);

    GetContainerStatusRequest request =
        Records.newRecord(GetContainerStatusRequest.class);
    request.setContainerId(cId);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.