Java 类org.apache.hadoop.yarn.api.protocolrecords.GetQueueInfoRequest 实例源码

项目:hadoop-2.6.0-cdh5.4.3    文件:TestClientRMService.java   
@Test
public void testGetQueueInfo() throws Exception {
  YarnScheduler yarnScheduler = mock(YarnScheduler.class);
  RMContext rmContext = mock(RMContext.class);
  mockRMContext(yarnScheduler, rmContext);
  ClientRMService rmService = new ClientRMService(rmContext, yarnScheduler,
      null, null, null, null);
  GetQueueInfoRequest request = recordFactory
      .newRecordInstance(GetQueueInfoRequest.class);
  request.setQueueName("testqueue");
  request.setIncludeApplications(true);
  GetQueueInfoResponse queueInfo = rmService.getQueueInfo(request);
  List<ApplicationReport> applications = queueInfo.getQueueInfo()
      .getApplications();
  Assert.assertEquals(2, applications.size());
  request.setQueueName("nonexistentqueue");
  request.setIncludeApplications(true);
  // should not throw exception on nonexistent queue
  queueInfo = rmService.getQueueInfo(request);
}
项目:hadoop-plus    文件:TestClientRMService.java   
@Test
public void testGetQueueInfo() throws Exception {
  YarnScheduler yarnScheduler = mock(YarnScheduler.class);
  RMContext rmContext = mock(RMContext.class);
  mockRMContext(yarnScheduler, rmContext);
  ClientRMService rmService = new ClientRMService(rmContext, yarnScheduler,
      null, null, null);
  GetQueueInfoRequest request = recordFactory
      .newRecordInstance(GetQueueInfoRequest.class);
  request.setQueueName("testqueue");
  request.setIncludeApplications(true);
  GetQueueInfoResponse queueInfo = rmService.getQueueInfo(request);
  List<ApplicationReport> applications = queueInfo.getQueueInfo()
      .getApplications();
  Assert.assertEquals(2, applications.size());
  request.setQueueName("nonexistentqueue");
  request.setIncludeApplications(true);
  // should not throw exception on nonexistent queue
  queueInfo = rmService.getQueueInfo(request);
}
项目:hadoop-TCP    文件:TestClientRMService.java   
@Test
public void testGetQueueInfo() throws Exception {
  YarnScheduler yarnScheduler = mock(YarnScheduler.class);
  RMContext rmContext = mock(RMContext.class);
  mockRMContext(yarnScheduler, rmContext);
  ClientRMService rmService = new ClientRMService(rmContext, yarnScheduler,
      null, null, null, null);
  GetQueueInfoRequest request = recordFactory
      .newRecordInstance(GetQueueInfoRequest.class);
  request.setQueueName("testqueue");
  request.setIncludeApplications(true);
  GetQueueInfoResponse queueInfo = rmService.getQueueInfo(request);
  List<ApplicationReport> applications = queueInfo.getQueueInfo()
      .getApplications();
  Assert.assertEquals(2, applications.size());
  request.setQueueName("nonexistentqueue");
  request.setIncludeApplications(true);
  // should not throw exception on nonexistent queue
  queueInfo = rmService.getQueueInfo(request);
}
项目:hardfs    文件:TestClientRMService.java   
@Test
public void testGetQueueInfo() throws Exception {
  YarnScheduler yarnScheduler = mock(YarnScheduler.class);
  RMContext rmContext = mock(RMContext.class);
  mockRMContext(yarnScheduler, rmContext);
  ClientRMService rmService = new ClientRMService(rmContext, yarnScheduler,
      null, null, null, null);
  GetQueueInfoRequest request = recordFactory
      .newRecordInstance(GetQueueInfoRequest.class);
  request.setQueueName("testqueue");
  request.setIncludeApplications(true);
  GetQueueInfoResponse queueInfo = rmService.getQueueInfo(request);
  List<ApplicationReport> applications = queueInfo.getQueueInfo()
      .getApplications();
  Assert.assertEquals(2, applications.size());
  request.setQueueName("nonexistentqueue");
  request.setIncludeApplications(true);
  // should not throw exception on nonexistent queue
  queueInfo = rmService.getQueueInfo(request);
}
项目:hadoop-on-lustre2    文件:TestClientRMService.java   
@Test
public void testGetQueueInfo() throws Exception {
  YarnScheduler yarnScheduler = mock(YarnScheduler.class);
  RMContext rmContext = mock(RMContext.class);
  mockRMContext(yarnScheduler, rmContext);
  ClientRMService rmService = new ClientRMService(rmContext, yarnScheduler,
      null, null, null, null);
  GetQueueInfoRequest request = recordFactory
      .newRecordInstance(GetQueueInfoRequest.class);
  request.setQueueName("testqueue");
  request.setIncludeApplications(true);
  GetQueueInfoResponse queueInfo = rmService.getQueueInfo(request);
  List<ApplicationReport> applications = queueInfo.getQueueInfo()
      .getApplications();
  Assert.assertEquals(2, applications.size());
  request.setQueueName("nonexistentqueue");
  request.setIncludeApplications(true);
  // should not throw exception on nonexistent queue
  queueInfo = rmService.getQueueInfo(request);
}
项目:hadoop    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException, IOException {
  GetQueueInfoRequestProto requestProto =
      ((GetQueueInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueInfoResponsePBImpl(proxy.getQueueInfo(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop    文件:YarnClientImpl.java   
private GetQueueInfoRequest
    getQueueInfoRequest(String queueName, boolean includeApplications,
        boolean includeChildQueues, boolean recursive) {
  GetQueueInfoRequest request = Records.newRecord(GetQueueInfoRequest.class);
  request.setQueueName(queueName);
  request.setIncludeApplications(includeApplications);
  request.setIncludeChildQueues(includeChildQueues);
  request.setRecursive(recursive);
  return request;
}
项目:hadoop    文件:YarnClientImpl.java   
@Override
public QueueInfo getQueueInfo(String queueName) throws YarnException,
    IOException {
  GetQueueInfoRequest request =
      getQueueInfoRequest(queueName, true, false, false);
  Records.newRecord(GetQueueInfoRequest.class);
  return rmClient.getQueueInfo(request).getQueueInfo();
}
项目:hadoop    文件:ProtocolHATestBase.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException {
  resetStartFailoverFlag(true);

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

  // return fake QueueInfo
  return GetQueueInfoResponse.newInstance(createFakeQueueInfo());
}
项目:scheduling-connector-for-hadoop    文件:HPCApplicationClientProtocolImpl.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException, IOException {
  QueueInfo queueInfo = QueueInfo.newInstance("default", 10240, 10240, 10240,
      null, null, QueueState.RUNNING, null, null);
  GetQueueInfoResponse queueInfoResponse = GetQueueInfoResponse
      .newInstance(queueInfo);
  return queueInfoResponse;
}
项目:aliyun-oss-hadoop-fs    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException, IOException {
  GetQueueInfoRequestProto requestProto =
      ((GetQueueInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueInfoResponsePBImpl(proxy.getQueueInfo(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:aliyun-oss-hadoop-fs    文件:YarnClientImpl.java   
private GetQueueInfoRequest
    getQueueInfoRequest(String queueName, boolean includeApplications,
        boolean includeChildQueues, boolean recursive) {
  GetQueueInfoRequest request = Records.newRecord(GetQueueInfoRequest.class);
  request.setQueueName(queueName);
  request.setIncludeApplications(includeApplications);
  request.setIncludeChildQueues(includeChildQueues);
  request.setRecursive(recursive);
  return request;
}
项目:aliyun-oss-hadoop-fs    文件:YarnClientImpl.java   
@Override
public QueueInfo getQueueInfo(String queueName) throws YarnException,
    IOException {
  GetQueueInfoRequest request =
      getQueueInfoRequest(queueName, true, false, false);
  Records.newRecord(GetQueueInfoRequest.class);
  return rmClient.getQueueInfo(request).getQueueInfo();
}
项目:aliyun-oss-hadoop-fs    文件:ProtocolHATestBase.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException {
  resetStartFailoverFlag(true);

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

  // return fake QueueInfo
  return GetQueueInfoResponse.newInstance(createFakeQueueInfo());
}
项目:big-c    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException, IOException {
  GetQueueInfoRequestProto requestProto =
      ((GetQueueInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueInfoResponsePBImpl(proxy.getQueueInfo(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:big-c    文件:YarnClientImpl.java   
private GetQueueInfoRequest
    getQueueInfoRequest(String queueName, boolean includeApplications,
        boolean includeChildQueues, boolean recursive) {
  GetQueueInfoRequest request = Records.newRecord(GetQueueInfoRequest.class);
  request.setQueueName(queueName);
  request.setIncludeApplications(includeApplications);
  request.setIncludeChildQueues(includeChildQueues);
  request.setRecursive(recursive);
  return request;
}
项目:big-c    文件:YarnClientImpl.java   
@Override
public QueueInfo getQueueInfo(String queueName) throws YarnException,
    IOException {
  GetQueueInfoRequest request =
      getQueueInfoRequest(queueName, true, false, false);
  Records.newRecord(GetQueueInfoRequest.class);
  return rmClient.getQueueInfo(request).getQueueInfo();
}
项目:big-c    文件:ProtocolHATestBase.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException {
  resetStartFailoverFlag(true);

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

  // return fake QueueInfo
  return GetQueueInfoResponse.newInstance(createFakeQueueInfo());
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException, IOException {
  GetQueueInfoRequestProto requestProto =
      ((GetQueueInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueInfoResponsePBImpl(proxy.getQueueInfo(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ClientRMService.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException {
  GetQueueInfoResponse response =
    recordFactory.newRecordInstance(GetQueueInfoResponse.class);
  try {
    QueueInfo queueInfo = 
      scheduler.getQueueInfo(request.getQueueName(),  
          request.getIncludeChildQueues(), 
          request.getRecursive());
    List<ApplicationReport> appReports = EMPTY_APPS_REPORT;
    if (request.getIncludeApplications()) {
      List<ApplicationAttemptId> apps =
          scheduler.getAppsInQueue(request.getQueueName());
      appReports = new ArrayList<ApplicationReport>(apps.size());
      for (ApplicationAttemptId app : apps) {
        RMApp rmApp = rmContext.getRMApps().get(app.getApplicationId());
        appReports.add(rmApp.createAndGetApplicationReport(null, true));
      }
    }
    queueInfo.setApplications(appReports);
    response.setQueueInfo(queueInfo);
  } catch (IOException ioe) {
    LOG.info("Failed to getQueueInfo for " + request.getQueueName(), ioe);
  }

  return response;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:YarnClientImpl.java   
private GetQueueInfoRequest
    getQueueInfoRequest(String queueName, boolean includeApplications,
        boolean includeChildQueues, boolean recursive) {
  GetQueueInfoRequest request = Records.newRecord(GetQueueInfoRequest.class);
  request.setQueueName(queueName);
  request.setIncludeApplications(includeApplications);
  request.setIncludeChildQueues(includeChildQueues);
  request.setRecursive(recursive);
  return request;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:YarnClientImpl.java   
@Override
public QueueInfo getQueueInfo(String queueName) throws YarnException,
    IOException {
  GetQueueInfoRequest request =
      getQueueInfoRequest(queueName, true, false, false);
  Records.newRecord(GetQueueInfoRequest.class);
  return rmClient.getQueueInfo(request).getQueueInfo();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ProtocolHATestBase.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException {
  resetStartFailoverFlag(true);

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

  // return fake QueueInfo
  return GetQueueInfoResponse.newInstance(createFakeQueueInfo());
}
项目:hadoop-plus    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException, IOException {
  GetQueueInfoRequestProto requestProto =
      ((GetQueueInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueInfoResponsePBImpl(proxy.getQueueInfo(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-plus    文件:ClientRMService.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException {
  GetQueueInfoResponse response =
    recordFactory.newRecordInstance(GetQueueInfoResponse.class);
  try {
    QueueInfo queueInfo = 
      scheduler.getQueueInfo(request.getQueueName(),  
          request.getIncludeChildQueues(), 
          request.getRecursive());
    List<ApplicationReport> appReports = EMPTY_APPS_REPORT;
    if (request.getIncludeApplications()) {
      Collection<RMApp> apps = this.rmContext.getRMApps().values();
      appReports = new ArrayList<ApplicationReport>(
          apps.size());
      for (RMApp app : apps) {
        if (app.getQueue().equals(queueInfo.getQueueName())) {
          appReports.add(app.createAndGetApplicationReport(true));
        }
      }
    }
    queueInfo.setApplications(appReports);
    response.setQueueInfo(queueInfo);
  } catch (IOException ioe) {
    LOG.info("Failed to getQueueInfo for " + request.getQueueName(), ioe);
  }

  return response;
}
项目:hadoop-plus    文件:YarnClientImpl.java   
private GetQueueInfoRequest
    getQueueInfoRequest(String queueName, boolean includeApplications,
        boolean includeChildQueues, boolean recursive) {
  GetQueueInfoRequest request = Records.newRecord(GetQueueInfoRequest.class);
  request.setQueueName(queueName);
  request.setIncludeApplications(includeApplications);
  request.setIncludeChildQueues(includeChildQueues);
  request.setRecursive(recursive);
  return request;
}
项目:hadoop-plus    文件:YarnClientImpl.java   
@Override
public QueueInfo getQueueInfo(String queueName) throws YarnException,
    IOException {
  GetQueueInfoRequest request =
      getQueueInfoRequest(queueName, true, false, false);
  Records.newRecord(GetQueueInfoRequest.class);
  return rmClient.getQueueInfo(request).getQueueInfo();
}
项目:hops    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException, IOException {
  GetQueueInfoRequestProto requestProto =
      ((GetQueueInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueInfoResponsePBImpl(proxy.getQueueInfo(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hops    文件:YarnClientImpl.java   
private GetQueueInfoRequest
    getQueueInfoRequest(String queueName, boolean includeApplications,
        boolean includeChildQueues, boolean recursive) {
  GetQueueInfoRequest request = Records.newRecord(GetQueueInfoRequest.class);
  request.setQueueName(queueName);
  request.setIncludeApplications(includeApplications);
  request.setIncludeChildQueues(includeChildQueues);
  request.setRecursive(recursive);
  return request;
}
项目:hops    文件:YarnClientImpl.java   
@Override
public QueueInfo getQueueInfo(String queueName) throws YarnException,
    IOException {
  GetQueueInfoRequest request =
      getQueueInfoRequest(queueName, true, false, false);
  Records.newRecord(GetQueueInfoRequest.class);
  return rmClient.getQueueInfo(request).getQueueInfo();
}
项目:hops    文件:ProtocolHATestBase.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException {
  resetStartFailoverFlag(true);

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

  // return fake QueueInfo
  return GetQueueInfoResponse.newInstance(createFakeQueueInfo());
}
项目:hadoop-TCP    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException, IOException {
  GetQueueInfoRequestProto requestProto =
      ((GetQueueInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueInfoResponsePBImpl(proxy.getQueueInfo(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-TCP    文件:ClientRMService.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException {
  GetQueueInfoResponse response =
    recordFactory.newRecordInstance(GetQueueInfoResponse.class);
  try {
    QueueInfo queueInfo = 
      scheduler.getQueueInfo(request.getQueueName(),  
          request.getIncludeChildQueues(), 
          request.getRecursive());
    List<ApplicationReport> appReports = EMPTY_APPS_REPORT;
    if (request.getIncludeApplications()) {
      Collection<RMApp> apps = this.rmContext.getRMApps().values();
      appReports = new ArrayList<ApplicationReport>(
          apps.size());
      for (RMApp app : apps) {
        if (app.getQueue().equals(queueInfo.getQueueName())) {
          appReports.add(app.createAndGetApplicationReport(null, true));
        }
      }
    }
    queueInfo.setApplications(appReports);
    response.setQueueInfo(queueInfo);
  } catch (IOException ioe) {
    LOG.info("Failed to getQueueInfo for " + request.getQueueName(), ioe);
  }

  return response;
}
项目:hadoop-TCP    文件:YarnClientImpl.java   
private GetQueueInfoRequest
    getQueueInfoRequest(String queueName, boolean includeApplications,
        boolean includeChildQueues, boolean recursive) {
  GetQueueInfoRequest request = Records.newRecord(GetQueueInfoRequest.class);
  request.setQueueName(queueName);
  request.setIncludeApplications(includeApplications);
  request.setIncludeChildQueues(includeChildQueues);
  request.setRecursive(recursive);
  return request;
}
项目:hadoop-TCP    文件:YarnClientImpl.java   
@Override
public QueueInfo getQueueInfo(String queueName) throws YarnException,
    IOException {
  GetQueueInfoRequest request =
      getQueueInfoRequest(queueName, true, false, false);
  Records.newRecord(GetQueueInfoRequest.class);
  return rmClient.getQueueInfo(request).getQueueInfo();
}
项目:hardfs    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException, IOException {
  GetQueueInfoRequestProto requestProto =
      ((GetQueueInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueInfoResponsePBImpl(proxy.getQueueInfo(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hardfs    文件:ClientRMService.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException {
  GetQueueInfoResponse response =
    recordFactory.newRecordInstance(GetQueueInfoResponse.class);
  try {
    QueueInfo queueInfo = 
      scheduler.getQueueInfo(request.getQueueName(),  
          request.getIncludeChildQueues(), 
          request.getRecursive());
    List<ApplicationReport> appReports = EMPTY_APPS_REPORT;
    if (request.getIncludeApplications()) {
      Collection<RMApp> apps = this.rmContext.getRMApps().values();
      appReports = new ArrayList<ApplicationReport>(
          apps.size());
      for (RMApp app : apps) {
        if (app.getQueue().equals(queueInfo.getQueueName())) {
          appReports.add(app.createAndGetApplicationReport(null, true));
        }
      }
    }
    queueInfo.setApplications(appReports);
    response.setQueueInfo(queueInfo);
  } catch (IOException ioe) {
    LOG.info("Failed to getQueueInfo for " + request.getQueueName(), ioe);
  }

  return response;
}
项目:hardfs    文件:YarnClientImpl.java   
private GetQueueInfoRequest
    getQueueInfoRequest(String queueName, boolean includeApplications,
        boolean includeChildQueues, boolean recursive) {
  GetQueueInfoRequest request = Records.newRecord(GetQueueInfoRequest.class);
  request.setQueueName(queueName);
  request.setIncludeApplications(includeApplications);
  request.setIncludeChildQueues(includeChildQueues);
  request.setRecursive(recursive);
  return request;
}
项目:hardfs    文件:YarnClientImpl.java   
@Override
public QueueInfo getQueueInfo(String queueName) throws YarnException,
    IOException {
  GetQueueInfoRequest request =
      getQueueInfoRequest(queueName, true, false, false);
  Records.newRecord(GetQueueInfoRequest.class);
  return rmClient.getQueueInfo(request).getQueueInfo();
}
项目:hadoop-on-lustre2    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
    throws YarnException, IOException {
  GetQueueInfoRequestProto requestProto =
      ((GetQueueInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueInfoResponsePBImpl(proxy.getQueueInfo(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}