Examples of DAGClientAMProtocolBlockingPB


Examples of org.apache.tez.dag.api.client.rpc.DAGClientAMProtocolBlockingPB

  private DAGClientAMProtocolBlockingPB waitForProxy()
      throws IOException, TezException, InterruptedException {
    long startTime = System.currentTimeMillis();
    long endTime = startTime + (clientTimeout * 1000);
    DAGClientAMProtocolBlockingPB proxy = null;
    while (true) {
      proxy = TezClientUtils.getSessionAMProxy(yarnClient,
          sessionConfig.getYarnConfiguration(), applicationId);
      if (proxy != null) {
        break;
View Full Code Here

Examples of org.apache.tez.dag.api.client.rpc.DAGClientAMProtocolBlockingPB

      userUgi.addToken(token);
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("Connecting to Tez AM at " + serviceAddr);
    }
    DAGClientAMProtocolBlockingPB proxy = null;
    try {
      proxy = userUgi.doAs(new PrivilegedExceptionAction<DAGClientAMProtocolBlockingPB>() {
        @Override
        public DAGClientAMProtocolBlockingPB run() throws IOException {
          RPC.setProtocolEngine(conf, DAGClientAMProtocolBlockingPB.class, ProtobufRpcEngine.class);
View Full Code Here

Examples of org.apache.tez.dag.api.client.rpc.DAGClientAMProtocolBlockingPB

    if (additionalAmResources != null && !additionalAmResources.isEmpty()) {
      requestBuilder.setAdditionalAmResources(DagTypeConverters
          .convertFromLocalResources(additionalAmResources));
    }

    DAGClientAMProtocolBlockingPB proxy = waitForProxy();
    if (proxy == null) {
      try {
        LOG.warn("DAG submission to session timed out, stopping session");
        stop();
      } catch (Throwable t) {
        LOG.info("Got an exception when trying to stop session", t);
      }
      throw new DAGSubmissionTimedOut("Could not submit DAG to Tez Session"
          + ", timed out after " + clientTimeout + " seconds");
    }

    try {
      dagId = proxy.submitDAG(null, requestBuilder.build()).getDagId();
    } catch (ServiceException e) {
      throw new TezException(e);
    }
    LOG.info("Submitted dag to TezSession"
        + ", sessionName=" + sessionName
View Full Code Here

Examples of org.apache.tez.dag.api.client.rpc.DAGClientAMProtocolBlockingPB

    LOG.info("Shutting down Tez Session"
        + ", sessionName=" + sessionName
        + ", applicationId=" + applicationId);
    sessionStopped = true;
    try {
      DAGClientAMProtocolBlockingPB proxy = TezClientUtils.getSessionAMProxy(
          yarnClient, sessionConfig.getYarnConfiguration(), applicationId);
      if (proxy != null) {
        ShutdownSessionRequestProto request =
            ShutdownSessionRequestProto.newBuilder().build();
        proxy.shutdownSession(null, request);
        return;
      }
    } catch (TezException e) {
      LOG.info("Failed to shutdown Tez Session via proxy", e);
    } catch (ServiceException e) {
View Full Code Here

Examples of org.apache.tez.dag.api.client.rpc.DAGClientAMProtocolBlockingPB

      case FAILED:
      case KILLED:
        return TezSessionStatus.SHUTDOWN;
      case RUNNING:
        try {
          DAGClientAMProtocolBlockingPB proxy = TezClientUtils.getSessionAMProxy(
              yarnClient, sessionConfig.getYarnConfiguration(), applicationId);
          if (proxy == null) {
            return TezSessionStatus.INITIALIZING;
          }
          GetAMStatusResponseProto response = proxy.getAMStatus(null,
              GetAMStatusRequestProto.newBuilder().build());
          return DagTypeConverters.convertTezSessionStatusFromProto(
              response.getStatus());
        } catch (TezException e) {
          LOG.info("Failed to retrieve AM Status via proxy", e);
View Full Code Here

Examples of org.apache.tez.dag.api.client.rpc.DAGClientAMProtocolBlockingPB

  public void preWarm(PreWarmContext context)
      throws IOException, TezException, InterruptedException {
    verifySessionStateForSubmission();

    try {
      DAGClientAMProtocolBlockingPB proxy = waitForProxy();
      if (proxy == null) {
        throw new SessionNotRunning("Could not connect to Session within client"
            + " timeout interval, timeoutSecs=" + clientTimeout);
      }

      String classpath = TezClientUtils
        .getFrameworkClasspath(sessionConfig.getYarnConfiguration());
      Map<String, String> contextEnv = context.getEnvironment();
      TezYARNUtils.addToEnvironment(contextEnv,
        ApplicationConstants.Environment.CLASSPATH.name(),
        classpath, File.pathSeparator);

      DAGClientAMProtocolRPC.PreWarmRequestProto.Builder
        preWarmReqProtoBuilder =
          DAGClientAMProtocolRPC.PreWarmRequestProto.newBuilder();
      preWarmReqProtoBuilder.setPreWarmContext(
        DagTypeConverters.convertPreWarmContextToProto(context));
      proxy.preWarm(null, preWarmReqProtoBuilder.build());
      while (true) {
        try {
          Thread.sleep(1000);
          TezSessionStatus status = getSessionStatus();
          if (status.equals(TezSessionStatus.READY)) {
View Full Code Here

Examples of org.apache.tez.dag.api.client.rpc.DAGClientAMProtocolBlockingPB

  private DAGClientAMProtocolBlockingPB waitForProxy()
      throws IOException, TezException, InterruptedException {
    long startTime = System.currentTimeMillis();
    long endTime = startTime + (clientTimeout * 1000);
    DAGClientAMProtocolBlockingPB proxy = null;
    while (true) {
      proxy = TezClientUtils.getSessionAMProxy(yarnClient,
          sessionConfig.getYarnConfiguration(), applicationId);
      if (proxy != null) {
        break;
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.