Package org.apache.hadoop.yarn.api.records

Examples of org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport


      org.apache.hadoop.yarn.api.records.Token clientToAMToken = null;
      String trackingUrl = UNAVAILABLE;
      String host = UNAVAILABLE;
      String origTrackingUrl = UNAVAILABLE;
      int rpcPort = -1;
      ApplicationResourceUsageReport appUsageReport =
          DUMMY_APPLICATION_RESOURCE_USAGE_REPORT;
      FinalApplicationStatus finishState = getFinalApplicationStatus();
      String diags = UNAVAILABLE;
      float progress = 0.0f;
      org.apache.hadoop.yarn.api.records.Token amrmToken = null;
View Full Code Here


        UNAVAILABLE, appReport.getDiagnostics());
    Assert.assertEquals("Enemy should not see app tracking url!",
        UNAVAILABLE, appReport.getTrackingUrl());
    Assert.assertEquals("Enemy should not see app original tracking url!",
        UNAVAILABLE, appReport.getOriginalTrackingUrl());
    ApplicationResourceUsageReport usageReport =
        appReport.getApplicationResourceUsageReport();
    Assert.assertEquals("Enemy should not see app used containers",
        -1, usageReport.getNumUsedContainers());
    Assert.assertEquals("Enemy should not see app reserved containers",
        -1, usageReport.getNumReservedContainers());
    Assert.assertEquals("Enemy should not see app used resources",
        -1, usageReport.getUsedResources().getMemory());
    Assert.assertEquals("Enemy should not see app reserved resources",
        -1, usageReport.getReservedResources().getMemory());
    Assert.assertEquals("Enemy should not see app needed resources",
        -1, usageReport.getNeededResources().getMemory());
  }
View Full Code Here

      String clientToken = "N/A";
      String trackingUrl = "N/A";
      String host = "N/A";
      String origTrackingUrl = "N/A";
      int rpcPort = -1;
      ApplicationResourceUsageReport appUsageReport = null;
      FinalApplicationStatus finishState = getFinalApplicationStatus();
      if (this.currentAttempt != null) {
        trackingUrl = this.currentAttempt.getTrackingUrl();
        origTrackingUrl = this.currentAttempt.getOriginalTrackingUrl();
        clientToken = this.currentAttempt.getClientToken();
View Full Code Here

            reservedResources += rc.getContainer().getResource().getMemory();
          }
        }
      }
     
      ApplicationResourceUsageReport appResources =
          recordFactory.newRecordInstance(ApplicationResourceUsageReport.class);
      appResources.setNumUsedContainers(numUsedContainers);
      appResources.setNumReservedContainers(numReservedContainers);
      appResources.setUsedResources(
          Resources.createResource(currentConsumption));
      appResources.setReservedResources(
          Resources.createResource(reservedResources));
      appResources.setNeededResources(
          Resources.createResource(currentConsumption + reservedResources));
      return appResources;
    } finally {
      this.readLock.unlock();
    }
View Full Code Here

      org.apache.hadoop.yarn.api.records.Token clientToAMToken = null;
      String trackingUrl = UNAVAILABLE;
      String host = UNAVAILABLE;
      String origTrackingUrl = UNAVAILABLE;
      int rpcPort = -1;
      ApplicationResourceUsageReport appUsageReport =
          DUMMY_APPLICATION_RESOURCE_USAGE_REPORT;
      FinalApplicationStatus finishState = getFinalApplicationStatus();
      String diags = UNAVAILABLE;
      float progress = 0.0f;
      org.apache.hadoop.yarn.api.records.Token amrmToken = null;
View Full Code Here

  @Override
  public ApplicationResourceUsageReport getApplicationResourceUsageReport() {
    this.readLock.lock();
    try {
      ApplicationResourceUsageReport report =
          scheduler.getAppResourceUsageReport(this.getAppAttemptId());
      if (report == null) {
        Resource none = Resource.newInstance(0, 0);
        report = ApplicationResourceUsageReport.newInstance(0, 0, none, none,
            none);
View Full Code Here

                "/", app.getUser());
            this.amContainerLogs = url;
            this.amHostHttpAddress = masterContainer.getNodeHttpAddress();
          }
         
          ApplicationResourceUsageReport resourceReport = attempt
              .getApplicationResourceUsageReport();
          if (resourceReport != null) {
            Resource usedResources = resourceReport.getUsedResources();
            allocatedMB = usedResources.getMemory();
            allocatedVCores = usedResources.getVirtualCores();
            runningContainers = resourceReport.getNumUsedContainers();
          }
        }
      }
    }
  }
View Full Code Here

  private ApplicationReport getApplicationReport(
      YarnApplicationState yarnApplicationState,
      FinalApplicationStatus finalApplicationStatus) {
    ApplicationReport appReport = Mockito.mock(ApplicationReport.class);
    ApplicationResourceUsageReport appResources = Mockito
        .mock(ApplicationResourceUsageReport.class);
    Mockito.when(appReport.getApplicationId()).thenReturn(
        Records.newRecord(ApplicationId.class));
    Mockito.when(appResources.getNeededResources()).thenReturn(
        Records.newRecord(Resource.class));
    Mockito.when(appResources.getReservedResources()).thenReturn(
        Records.newRecord(Resource.class));
    Mockito.when(appResources.getUsedResources()).thenReturn(
        Records.newRecord(Resource.class));
    Mockito.when(appReport.getApplicationResourceUsageReport()).thenReturn(
        appResources);
    Mockito.when(appReport.getYarnApplicationState()).thenReturn(
        yarnApplicationState);
View Full Code Here

  @Override
  public ApplicationResourceUsageReport getApplicationResourceUsageReport() {
    this.readLock.lock();
    try {
      ApplicationResourceUsageReport report =
          scheduler.getAppResourceUsageReport(this.getAppAttemptId());
      if (report == null) {
        Resource none = Resource.newInstance(0, 0);
        report = ApplicationResourceUsageReport.newInstance(0, 0, none, none,
            none);
View Full Code Here

  private ApplicationReport getApplicationReport(
      YarnApplicationState yarnApplicationState,
      FinalApplicationStatus finalApplicationStatus) {
    ApplicationReport appReport = Mockito.mock(ApplicationReport.class);
    ApplicationResourceUsageReport appResources = Mockito
        .mock(ApplicationResourceUsageReport.class);
    Mockito.when(appReport.getApplicationId()).thenReturn(
        ApplicationId.newInstance(0, 0));
    Mockito.when(appResources.getNeededResources()).thenReturn(
        Records.newRecord(Resource.class));
    Mockito.when(appResources.getReservedResources()).thenReturn(
        Records.newRecord(Resource.class));
    Mockito.when(appResources.getUsedResources()).thenReturn(
        Records.newRecord(Resource.class));
    Mockito.when(appReport.getApplicationResourceUsageReport()).thenReturn(
        appResources);
    Mockito.when(appReport.getYarnApplicationState()).thenReturn(
        yarnApplicationState);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport

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.