Package org.apache.hadoop.yarn.exceptions

Examples of org.apache.hadoop.yarn.exceptions.YarnException


    if (durationToTrackStoppedContainers < 0) {
      String message = "Invalid configuration for "
        + YARN_NODEMANAGER_DURATION_TO_TRACK_STOPPED_CONTAINERS + " default "
          + "value is 10Min(600000).";
      LOG.error(message);
      throw new YarnException(message);
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug(YARN_NODEMANAGER_DURATION_TO_TRACK_STOPPED_CONTAINERS + " :"
        + durationToTrackStoppedContainers);
    }
View Full Code Here


      protected void doUnregistration()
          throws YarnException, IOException, InterruptedException {
        if (crushUnregistration) {
          app.successfullyUnregistered.set(true);
        } else {
          throw new YarnException("test exception");
        }
      }
View Full Code Here

        // container
        // launch. A finished Application will not launch containers.
        metrics.launchedContainer();
        metrics.allocateContainer(containerTokenIdentifier.getResource());
      } else {
        throw new YarnException("Container start failed as the NodeManager is "
            + "in the process of shutting down");
      }
    } finally {
      this.readLock.unlock();
    }
View Full Code Here

      @Override
      protected void authorizeGetAndStopContainerRequest(ContainerId containerId,
          Container container, boolean stopRequest, NMTokenIdentifier identifier) throws YarnException {
        if(container == null || container.getUser().equals("Fail")){
          throw new YarnException("Reject this container");
        }
      }
    };
  }
View Full Code Here

    Configuration conf = new Configuration();
    TestCallbackHandler callbackHandler = new TestCallbackHandler();
    @SuppressWarnings("unchecked")
    AMRMClient<ContainerRequest> client = mock(AMRMClientImpl.class);
    String exStr = "TestException";
    YarnException mockException = mock(YarnException.class);
    when(mockException.getMessage()).thenReturn(exStr);
    when(client.allocate(anyFloat())).thenThrow(mockException);

    AMRMClientAsync<ContainerRequest> asyncClient =
        AMRMClientAsync.createAMRMClientAsync(client, 20, callbackHandler);
    asyncClient.init(conf);
View Full Code Here

  public void launchAM(ApplicationAttemptId attemptId)
    throws IOException, YarnException {
    ApplicationReport report =
      rmClient.getApplicationReport(attemptId.getApplicationId());
    if (report.getYarnApplicationState() != YarnApplicationState.ACCEPTED) {
      throw new YarnException(
          "Umanaged AM must be in ACCEPTED state before launching");
    }
    Credentials credentials = new Credentials();
    Token<AMRMTokenIdentifier> token =
        rmClient.getAMRMToken(attemptId.getApplicationId());
View Full Code Here

      }

      @Override
      protected void doUnregistration()
          throws YarnException, IOException, InterruptedException {
        throw new YarnException("test exception");
      }
View Full Code Here

      }

      long elapsedMillis = System.currentTimeMillis() - startTime;
      if (enforceAsyncAPITimeout() &&
          elapsedMillis >= asyncApiPollTimeoutMillis) {
        throw new YarnException("Timed out while waiting for application " +
          applicationId + " to be submitted successfully");
      }

      // Notify the client through the log every 10 poll, in case the client
      // is blocked here too long.
View Full Code Here

        }

        long elapsedMillis = System.currentTimeMillis() - startTime;
        if (enforceAsyncAPITimeout() &&
            elapsedMillis >= this.asyncApiPollTimeoutMillis) {
          throw new YarnException("Timed out while waiting for application " +
            applicationId + " to be killed.");
        }

        if (++pollCount % 10 == 0) {
          LOG.info("Waiting for application " + applicationId + " to be killed.");
View Full Code Here

   */
  public static List<File> getContainerLogDirs(ContainerId containerId,
      String remoteUser, Context context) throws YarnException {
    Container container = context.getContainers().get(containerId);
    if (container == null) {
      throw new YarnException("Container does not exist.");
    }

    Application application = getApplicationForContainer(containerId, context);
    checkAccess(remoteUser, application, context);
    checkState(container.getContainerState());
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.exceptions.YarnException

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.