Package org.apache.hadoop.yarn.api.protocolrecords

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


        // make sure failover has been triggered
        Assert.assertTrue(waittingForFailOver());

        // create GetApplicationsResponse with fake applicationList
        GetApplicationsResponse response =
            GetApplicationsResponse.newInstance(createFakeAppReports());
        return response;
      }
View Full Code Here


      @Override
      public List<ApplicationReport> doInYarn(ApplicationClientProtocol proxy) throws YarnException, IOException {
        GetApplicationsRequest request = Records.newRecord(GetApplicationsRequest.class);
        request.setApplicationStates(states);
        request.setApplicationTypes(types);
        GetApplicationsResponse response = proxy.getApplications(request);
        return response.getApplicationList();
      }
    });
  }
View Full Code Here

  public List<ApplicationReport> listApplications() {
    return execute(new YarnRpcCallback<List<ApplicationReport>, ApplicationClientProtocol>() {
      @Override
      public List<ApplicationReport> doInYarn(ApplicationClientProtocol proxy) throws YarnException, IOException {
        GetApplicationsRequest request = Records.newRecord(GetApplicationsRequest.class);
        GetApplicationsResponse response = proxy.getApplications(request);
        return response.getApplicationList();
      }
    });
  }
View Full Code Here

  public List<ApplicationReport> getApplications(Set<String> applicationTypes,
      EnumSet<YarnApplicationState> applicationStates) throws YarnException,
      IOException {
    GetApplicationsRequest request =
        GetApplicationsRequest.newInstance(applicationTypes, applicationStates);
    GetApplicationsResponse response = rmClient.getApplications(request);
    return response.getApplicationList();
  }
View Full Code Here

          e.getMessage().contains("Cannot add a duplicate!"));
    }

    GetApplicationsRequest getAllAppsRequest =
        GetApplicationsRequest.newInstance(new HashSet<String>());
    GetApplicationsResponse getAllApplicationsResponse =
        rmService.getApplications(getAllAppsRequest);
    Assert.assertEquals(5,
        getAllApplicationsResponse.getApplicationList().size());

    Set<String> appTypes = new HashSet<String>();
    appTypes.add("matchType");

    getAllAppsRequest = GetApplicationsRequest.newInstance(appTypes);
    getAllApplicationsResponse =
        rmService.getApplications(getAllAppsRequest);
    Assert.assertEquals(1,
        getAllApplicationsResponse.getApplicationList().size());
    Assert.assertEquals(appId2,
        getAllApplicationsResponse.getApplicationList()
            .get(0).getApplicationId());
  }
View Full Code Here

          ApplicationAccessType.VIEW_APP, application);
      reports.add(application.createAndGetApplicationReport(
          callerUGI.getUserName(), allowAccess));
    }

    GetApplicationsResponse response =
      recordFactory.newRecordInstance(GetApplicationsResponse.class);
    response.setApplicationList(reports);
    return response;
  }
View Full Code Here

  public List<ApplicationReport> getApplications(
      Set<String> applicationTypes) throws YarnException, IOException {
    GetApplicationsRequest request =
        applicationTypes == null ? GetApplicationsRequest.newInstance()
            : GetApplicationsRequest.newInstance(applicationTypes);
    GetApplicationsResponse response = rmClient.getApplications(request);
    return response.getApplicationList();
  }
View Full Code Here

              : GetApplicationsRequest.newInstance(applicationTypes);
      when(rmClient.getApplications(request))
          .thenReturn(
              getApplicationReports(reports,
                  request));
      GetApplicationsResponse response = rmClient.getApplications(request);
      return response.getApplicationList();
    }
View Full Code Here

            appReport.getApplicationType()))) {
          continue;
        }
        appReports.add(appReport);
      }
      GetApplicationsResponse response =
          GetApplicationsResponse.newInstance(appReports);
      return response;
    }
View Full Code Here

          e.getMessage().contains("Cannot add a duplicate!"));
    }

    GetApplicationsRequest getAllAppsRequest =
        GetApplicationsRequest.newInstance(new HashSet<String>());
    GetApplicationsResponse getAllApplicationsResponse =
        rmService.getApplications(getAllAppsRequest);
    Assert.assertEquals(5,
        getAllApplicationsResponse.getApplicationList().size());

    Set<String> appTypes = new HashSet<String>();
    appTypes.add("matchType");

    getAllAppsRequest = GetApplicationsRequest.newInstance(appTypes);
    getAllApplicationsResponse =
        rmService.getApplications(getAllAppsRequest);
    Assert.assertEquals(1,
        getAllApplicationsResponse.getApplicationList().size());
    Assert.assertEquals(appId2,
        getAllApplicationsResponse.getApplicationList()
            .get(0).getApplicationId());
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.api.protocolrecords.GetApplicationsResponse

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.