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

项目:hadoop    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException,
    IOException {
  GetQueueUserAclsInfoRequestProto requestProto =
      ((GetQueueUserAclsInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueUserAclsInfoResponsePBImpl(proxy.getQueueUserAcls(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop    文件:ClientRMService.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException {
  GetQueueUserAclsInfoResponse response = 
    recordFactory.newRecordInstance(GetQueueUserAclsInfoResponse.class);
  response.setUserAclsInfoList(scheduler.getQueueUserAclInfo());
  return response;
}
项目:hadoop    文件:ProtocolHATestBase.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException {
  resetStartFailoverFlag(true);

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

  // return fake queueUserAcls
  return GetQueueUserAclsInfoResponse
      .newInstance(createFakeQueueUserACLInfoList());
}
项目:aliyun-oss-hadoop-fs    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException,
    IOException {
  GetQueueUserAclsInfoRequestProto requestProto =
      ((GetQueueUserAclsInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueUserAclsInfoResponsePBImpl(proxy.getQueueUserAcls(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:aliyun-oss-hadoop-fs    文件:ClientRMService.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException {
  GetQueueUserAclsInfoResponse response = 
    recordFactory.newRecordInstance(GetQueueUserAclsInfoResponse.class);
  response.setUserAclsInfoList(scheduler.getQueueUserAclInfo());
  return response;
}
项目:aliyun-oss-hadoop-fs    文件:ProtocolHATestBase.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException {
  resetStartFailoverFlag(true);

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

  // return fake queueUserAcls
  return GetQueueUserAclsInfoResponse
      .newInstance(createFakeQueueUserACLInfoList());
}
项目:big-c    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException,
    IOException {
  GetQueueUserAclsInfoRequestProto requestProto =
      ((GetQueueUserAclsInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueUserAclsInfoResponsePBImpl(proxy.getQueueUserAcls(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:big-c    文件:ClientRMService.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException {
  GetQueueUserAclsInfoResponse response = 
    recordFactory.newRecordInstance(GetQueueUserAclsInfoResponse.class);
  response.setUserAclsInfoList(scheduler.getQueueUserAclInfo());
  return response;
}
项目:big-c    文件:ProtocolHATestBase.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException {
  resetStartFailoverFlag(true);

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

  // return fake queueUserAcls
  return GetQueueUserAclsInfoResponse
      .newInstance(createFakeQueueUserACLInfoList());
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException,
    IOException {
  GetQueueUserAclsInfoRequestProto requestProto =
      ((GetQueueUserAclsInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueUserAclsInfoResponsePBImpl(proxy.getQueueUserAcls(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ClientRMService.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException {
  GetQueueUserAclsInfoResponse response = 
    recordFactory.newRecordInstance(GetQueueUserAclsInfoResponse.class);
  response.setUserAclsInfoList(scheduler.getQueueUserAclInfo());
  return response;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ProtocolHATestBase.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException {
  resetStartFailoverFlag(true);

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

  // return fake queueUserAcls
  return GetQueueUserAclsInfoResponse
      .newInstance(createFakeQueueUserACLInfoList());
}
项目:hadoop-plus    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException,
    IOException {
  GetQueueUserAclsInfoRequestProto requestProto =
      ((GetQueueUserAclsInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueUserAclsInfoResponsePBImpl(proxy.getQueueUserAcls(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-plus    文件:ClientRMService.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException {
  GetQueueUserAclsInfoResponse response = 
    recordFactory.newRecordInstance(GetQueueUserAclsInfoResponse.class);
  response.setUserAclsInfoList(scheduler.getQueueUserAclInfo());
  return response;
}
项目:hops    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException,
    IOException {
  GetQueueUserAclsInfoRequestProto requestProto =
      ((GetQueueUserAclsInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueUserAclsInfoResponsePBImpl(proxy.getQueueUserAcls(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hops    文件:ClientRMService.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException {
  GetQueueUserAclsInfoResponse response = 
    recordFactory.newRecordInstance(GetQueueUserAclsInfoResponse.class);
  response.setUserAclsInfoList(scheduler.getQueueUserAclInfo());
  return response;
}
项目:hops    文件:ProtocolHATestBase.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException {
  resetStartFailoverFlag(true);

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

  // return fake queueUserAcls
  return GetQueueUserAclsInfoResponse
      .newInstance(createFakeQueueUserACLInfoList());
}
项目:hadoop-TCP    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException,
    IOException {
  GetQueueUserAclsInfoRequestProto requestProto =
      ((GetQueueUserAclsInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueUserAclsInfoResponsePBImpl(proxy.getQueueUserAcls(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-TCP    文件:ClientRMService.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException {
  GetQueueUserAclsInfoResponse response = 
    recordFactory.newRecordInstance(GetQueueUserAclsInfoResponse.class);
  response.setUserAclsInfoList(scheduler.getQueueUserAclInfo());
  return response;
}
项目:hardfs    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException,
    IOException {
  GetQueueUserAclsInfoRequestProto requestProto =
      ((GetQueueUserAclsInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueUserAclsInfoResponsePBImpl(proxy.getQueueUserAcls(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hardfs    文件:ClientRMService.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException {
  GetQueueUserAclsInfoResponse response = 
    recordFactory.newRecordInstance(GetQueueUserAclsInfoResponse.class);
  response.setUserAclsInfoList(scheduler.getQueueUserAclInfo());
  return response;
}
项目:hadoop-on-lustre2    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException,
    IOException {
  GetQueueUserAclsInfoRequestProto requestProto =
      ((GetQueueUserAclsInfoRequestPBImpl) request).getProto();
  try {
    return new GetQueueUserAclsInfoResponsePBImpl(proxy.getQueueUserAcls(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-on-lustre2    文件:ClientRMService.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException {
  GetQueueUserAclsInfoResponse response = 
    recordFactory.newRecordInstance(GetQueueUserAclsInfoResponse.class);
  response.setUserAclsInfoList(scheduler.getQueueUserAclInfo());
  return response;
}
项目:hadoop-on-lustre2    文件:ProtocolHATestBase.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException {
  resetStartFailoverFlag(true);

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

  // return fake queueUserAcls
  return GetQueueUserAclsInfoResponse
      .newInstance(createFakeQueueUserACLInfoList());
}
项目:hadoop    文件:TestYARNRunner.java   
@Test(timeout=20000)
public void testResourceMgrDelegate() throws Exception {
  /* we not want a mock of resource mgr delegate */
  final ApplicationClientProtocol clientRMProtocol = mock(ApplicationClientProtocol.class);
  ResourceMgrDelegate delegate = new ResourceMgrDelegate(conf) {
    @Override
    protected void serviceStart() throws Exception {
      assertTrue(this.client instanceof YarnClientImpl);
      ((YarnClientImpl) this.client).setRMClient(clientRMProtocol);
    }
  };
  /* make sure kill calls finish application master */
  when(clientRMProtocol.forceKillApplication(any(KillApplicationRequest.class)))
  .thenReturn(KillApplicationResponse.newInstance(true));
  delegate.killApplication(appId);
  verify(clientRMProtocol).forceKillApplication(any(KillApplicationRequest.class));

  /* make sure getalljobs calls get all applications */
  when(clientRMProtocol.getApplications(any(GetApplicationsRequest.class))).
  thenReturn(recordFactory.newRecordInstance(GetApplicationsResponse.class));
  delegate.getAllJobs();
  verify(clientRMProtocol).getApplications(any(GetApplicationsRequest.class));

  /* make sure getapplication report is called */
  when(clientRMProtocol.getApplicationReport(any(GetApplicationReportRequest.class)))
  .thenReturn(recordFactory.newRecordInstance(GetApplicationReportResponse.class));
  delegate.getApplicationReport(appId);
  verify(clientRMProtocol).getApplicationReport(any(GetApplicationReportRequest.class));

  /* make sure metrics is called */
  GetClusterMetricsResponse clusterMetricsResponse = recordFactory.newRecordInstance
      (GetClusterMetricsResponse.class);
  clusterMetricsResponse.setClusterMetrics(recordFactory.newRecordInstance(
      YarnClusterMetrics.class));
  when(clientRMProtocol.getClusterMetrics(any(GetClusterMetricsRequest.class)))
  .thenReturn(clusterMetricsResponse);
  delegate.getClusterMetrics();
  verify(clientRMProtocol).getClusterMetrics(any(GetClusterMetricsRequest.class));

  when(clientRMProtocol.getClusterNodes(any(GetClusterNodesRequest.class))).
  thenReturn(recordFactory.newRecordInstance(GetClusterNodesResponse.class));
  delegate.getActiveTrackers();
  verify(clientRMProtocol).getClusterNodes(any(GetClusterNodesRequest.class));

  GetNewApplicationResponse newAppResponse = recordFactory.newRecordInstance(
      GetNewApplicationResponse.class);
  newAppResponse.setApplicationId(appId);
  when(clientRMProtocol.getNewApplication(any(GetNewApplicationRequest.class))).
  thenReturn(newAppResponse);
  delegate.getNewJobID();
  verify(clientRMProtocol).getNewApplication(any(GetNewApplicationRequest.class));

  GetQueueInfoResponse queueInfoResponse = recordFactory.newRecordInstance(
      GetQueueInfoResponse.class);
  queueInfoResponse.setQueueInfo(recordFactory.newRecordInstance(QueueInfo.class));
  when(clientRMProtocol.getQueueInfo(any(GetQueueInfoRequest.class))).
  thenReturn(queueInfoResponse);
  delegate.getQueues();
  verify(clientRMProtocol).getQueueInfo(any(GetQueueInfoRequest.class));

  GetQueueUserAclsInfoResponse aclResponse = recordFactory.newRecordInstance(
      GetQueueUserAclsInfoResponse.class);
  when(clientRMProtocol.getQueueUserAcls(any(GetQueueUserAclsInfoRequest.class)))
  .thenReturn(aclResponse);
  delegate.getQueueAclsForCurrentUser();
  verify(clientRMProtocol).getQueueUserAcls(any(GetQueueUserAclsInfoRequest.class));
}
项目:hadoop    文件:TestClientRedirect.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws IOException {
  return null;
}
项目:scheduling-connector-for-hadoop    文件:HPCApplicationClientProtocolImpl.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException, IOException {
  return GetQueueUserAclsInfoResponse
      .newInstance(new ArrayList<QueueUserACLInfo>());
}
项目:aliyun-oss-hadoop-fs    文件:MockResourceManagerFacade.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException,
    IOException {
  throw new NotImplementedException();
}
项目:aliyun-oss-hadoop-fs    文件:TestYARNRunner.java   
@Test(timeout=20000)
public void testResourceMgrDelegate() throws Exception {
  /* we not want a mock of resource mgr delegate */
  final ApplicationClientProtocol clientRMProtocol = mock(ApplicationClientProtocol.class);
  ResourceMgrDelegate delegate = new ResourceMgrDelegate(conf) {
    @Override
    protected void serviceStart() throws Exception {
      assertTrue(this.client instanceof YarnClientImpl);
      ((YarnClientImpl) this.client).setRMClient(clientRMProtocol);
    }
  };
  /* make sure kill calls finish application master */
  when(clientRMProtocol.forceKillApplication(any(KillApplicationRequest.class)))
  .thenReturn(KillApplicationResponse.newInstance(true));
  delegate.killApplication(appId);
  verify(clientRMProtocol).forceKillApplication(any(KillApplicationRequest.class));

  /* make sure getalljobs calls get all applications */
  when(clientRMProtocol.getApplications(any(GetApplicationsRequest.class))).
  thenReturn(recordFactory.newRecordInstance(GetApplicationsResponse.class));
  delegate.getAllJobs();
  verify(clientRMProtocol).getApplications(any(GetApplicationsRequest.class));

  /* make sure getapplication report is called */
  when(clientRMProtocol.getApplicationReport(any(GetApplicationReportRequest.class)))
  .thenReturn(recordFactory.newRecordInstance(GetApplicationReportResponse.class));
  delegate.getApplicationReport(appId);
  verify(clientRMProtocol).getApplicationReport(any(GetApplicationReportRequest.class));

  /* make sure metrics is called */
  GetClusterMetricsResponse clusterMetricsResponse = recordFactory.newRecordInstance
      (GetClusterMetricsResponse.class);
  clusterMetricsResponse.setClusterMetrics(recordFactory.newRecordInstance(
      YarnClusterMetrics.class));
  when(clientRMProtocol.getClusterMetrics(any(GetClusterMetricsRequest.class)))
  .thenReturn(clusterMetricsResponse);
  delegate.getClusterMetrics();
  verify(clientRMProtocol).getClusterMetrics(any(GetClusterMetricsRequest.class));

  when(clientRMProtocol.getClusterNodes(any(GetClusterNodesRequest.class))).
  thenReturn(recordFactory.newRecordInstance(GetClusterNodesResponse.class));
  delegate.getActiveTrackers();
  verify(clientRMProtocol).getClusterNodes(any(GetClusterNodesRequest.class));

  GetNewApplicationResponse newAppResponse = recordFactory.newRecordInstance(
      GetNewApplicationResponse.class);
  newAppResponse.setApplicationId(appId);
  when(clientRMProtocol.getNewApplication(any(GetNewApplicationRequest.class))).
  thenReturn(newAppResponse);
  delegate.getNewJobID();
  verify(clientRMProtocol).getNewApplication(any(GetNewApplicationRequest.class));

  GetQueueInfoResponse queueInfoResponse = recordFactory.newRecordInstance(
      GetQueueInfoResponse.class);
  queueInfoResponse.setQueueInfo(recordFactory.newRecordInstance(QueueInfo.class));
  when(clientRMProtocol.getQueueInfo(any(GetQueueInfoRequest.class))).
  thenReturn(queueInfoResponse);
  delegate.getQueues();
  verify(clientRMProtocol).getQueueInfo(any(GetQueueInfoRequest.class));

  GetQueueUserAclsInfoResponse aclResponse = recordFactory.newRecordInstance(
      GetQueueUserAclsInfoResponse.class);
  when(clientRMProtocol.getQueueUserAcls(any(GetQueueUserAclsInfoRequest.class)))
  .thenReturn(aclResponse);
  delegate.getQueueAclsForCurrentUser();
  verify(clientRMProtocol).getQueueUserAcls(any(GetQueueUserAclsInfoRequest.class));
}
项目:aliyun-oss-hadoop-fs    文件:TestClientRedirect.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws IOException {
  return null;
}
项目:big-c    文件:TestYARNRunner.java   
@Test(timeout=20000)
public void testResourceMgrDelegate() throws Exception {
  /* we not want a mock of resource mgr delegate */
  final ApplicationClientProtocol clientRMProtocol = mock(ApplicationClientProtocol.class);
  ResourceMgrDelegate delegate = new ResourceMgrDelegate(conf) {
    @Override
    protected void serviceStart() throws Exception {
      assertTrue(this.client instanceof YarnClientImpl);
      ((YarnClientImpl) this.client).setRMClient(clientRMProtocol);
    }
  };
  /* make sure kill calls finish application master */
  when(clientRMProtocol.forceKillApplication(any(KillApplicationRequest.class)))
  .thenReturn(KillApplicationResponse.newInstance(true));
  delegate.killApplication(appId);
  verify(clientRMProtocol).forceKillApplication(any(KillApplicationRequest.class));

  /* make sure getalljobs calls get all applications */
  when(clientRMProtocol.getApplications(any(GetApplicationsRequest.class))).
  thenReturn(recordFactory.newRecordInstance(GetApplicationsResponse.class));
  delegate.getAllJobs();
  verify(clientRMProtocol).getApplications(any(GetApplicationsRequest.class));

  /* make sure getapplication report is called */
  when(clientRMProtocol.getApplicationReport(any(GetApplicationReportRequest.class)))
  .thenReturn(recordFactory.newRecordInstance(GetApplicationReportResponse.class));
  delegate.getApplicationReport(appId);
  verify(clientRMProtocol).getApplicationReport(any(GetApplicationReportRequest.class));

  /* make sure metrics is called */
  GetClusterMetricsResponse clusterMetricsResponse = recordFactory.newRecordInstance
      (GetClusterMetricsResponse.class);
  clusterMetricsResponse.setClusterMetrics(recordFactory.newRecordInstance(
      YarnClusterMetrics.class));
  when(clientRMProtocol.getClusterMetrics(any(GetClusterMetricsRequest.class)))
  .thenReturn(clusterMetricsResponse);
  delegate.getClusterMetrics();
  verify(clientRMProtocol).getClusterMetrics(any(GetClusterMetricsRequest.class));

  when(clientRMProtocol.getClusterNodes(any(GetClusterNodesRequest.class))).
  thenReturn(recordFactory.newRecordInstance(GetClusterNodesResponse.class));
  delegate.getActiveTrackers();
  verify(clientRMProtocol).getClusterNodes(any(GetClusterNodesRequest.class));

  GetNewApplicationResponse newAppResponse = recordFactory.newRecordInstance(
      GetNewApplicationResponse.class);
  newAppResponse.setApplicationId(appId);
  when(clientRMProtocol.getNewApplication(any(GetNewApplicationRequest.class))).
  thenReturn(newAppResponse);
  delegate.getNewJobID();
  verify(clientRMProtocol).getNewApplication(any(GetNewApplicationRequest.class));

  GetQueueInfoResponse queueInfoResponse = recordFactory.newRecordInstance(
      GetQueueInfoResponse.class);
  queueInfoResponse.setQueueInfo(recordFactory.newRecordInstance(QueueInfo.class));
  when(clientRMProtocol.getQueueInfo(any(GetQueueInfoRequest.class))).
  thenReturn(queueInfoResponse);
  delegate.getQueues();
  verify(clientRMProtocol).getQueueInfo(any(GetQueueInfoRequest.class));

  GetQueueUserAclsInfoResponse aclResponse = recordFactory.newRecordInstance(
      GetQueueUserAclsInfoResponse.class);
  when(clientRMProtocol.getQueueUserAcls(any(GetQueueUserAclsInfoRequest.class)))
  .thenReturn(aclResponse);
  delegate.getQueueAclsForCurrentUser();
  verify(clientRMProtocol).getQueueUserAcls(any(GetQueueUserAclsInfoRequest.class));
}
项目:big-c    文件:TestClientRedirect.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws IOException {
  return null;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestYARNRunner.java   
@Test(timeout=20000)
public void testResourceMgrDelegate() throws Exception {
  /* we not want a mock of resource mgr delegate */
  final ApplicationClientProtocol clientRMProtocol = mock(ApplicationClientProtocol.class);
  ResourceMgrDelegate delegate = new ResourceMgrDelegate(conf) {
    @Override
    protected void serviceStart() throws Exception {
      assertTrue(this.client instanceof YarnClientImpl);
      ((YarnClientImpl) this.client).setRMClient(clientRMProtocol);
    }
  };
  /* make sure kill calls finish application master */
  when(clientRMProtocol.forceKillApplication(any(KillApplicationRequest.class)))
  .thenReturn(KillApplicationResponse.newInstance(true));
  delegate.killApplication(appId);
  verify(clientRMProtocol).forceKillApplication(any(KillApplicationRequest.class));

  /* make sure getalljobs calls get all applications */
  when(clientRMProtocol.getApplications(any(GetApplicationsRequest.class))).
  thenReturn(recordFactory.newRecordInstance(GetApplicationsResponse.class));
  delegate.getAllJobs();
  verify(clientRMProtocol).getApplications(any(GetApplicationsRequest.class));

  /* make sure getapplication report is called */
  when(clientRMProtocol.getApplicationReport(any(GetApplicationReportRequest.class)))
  .thenReturn(recordFactory.newRecordInstance(GetApplicationReportResponse.class));
  delegate.getApplicationReport(appId);
  verify(clientRMProtocol).getApplicationReport(any(GetApplicationReportRequest.class));

  /* make sure metrics is called */
  GetClusterMetricsResponse clusterMetricsResponse = recordFactory.newRecordInstance
      (GetClusterMetricsResponse.class);
  clusterMetricsResponse.setClusterMetrics(recordFactory.newRecordInstance(
      YarnClusterMetrics.class));
  when(clientRMProtocol.getClusterMetrics(any(GetClusterMetricsRequest.class)))
  .thenReturn(clusterMetricsResponse);
  delegate.getClusterMetrics();
  verify(clientRMProtocol).getClusterMetrics(any(GetClusterMetricsRequest.class));

  when(clientRMProtocol.getClusterNodes(any(GetClusterNodesRequest.class))).
  thenReturn(recordFactory.newRecordInstance(GetClusterNodesResponse.class));
  delegate.getActiveTrackers();
  verify(clientRMProtocol).getClusterNodes(any(GetClusterNodesRequest.class));

  GetNewApplicationResponse newAppResponse = recordFactory.newRecordInstance(
      GetNewApplicationResponse.class);
  newAppResponse.setApplicationId(appId);
  when(clientRMProtocol.getNewApplication(any(GetNewApplicationRequest.class))).
  thenReturn(newAppResponse);
  delegate.getNewJobID();
  verify(clientRMProtocol).getNewApplication(any(GetNewApplicationRequest.class));

  GetQueueInfoResponse queueInfoResponse = recordFactory.newRecordInstance(
      GetQueueInfoResponse.class);
  queueInfoResponse.setQueueInfo(recordFactory.newRecordInstance(QueueInfo.class));
  when(clientRMProtocol.getQueueInfo(any(GetQueueInfoRequest.class))).
  thenReturn(queueInfoResponse);
  delegate.getQueues();
  verify(clientRMProtocol).getQueueInfo(any(GetQueueInfoRequest.class));

  GetQueueUserAclsInfoResponse aclResponse = recordFactory.newRecordInstance(
      GetQueueUserAclsInfoResponse.class);
  when(clientRMProtocol.getQueueUserAcls(any(GetQueueUserAclsInfoRequest.class)))
  .thenReturn(aclResponse);
  delegate.getQueueAclsForCurrentUser();
  verify(clientRMProtocol).getQueueUserAcls(any(GetQueueUserAclsInfoRequest.class));
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestClientRedirect.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws IOException {
  return null;
}
项目:hadoop-plus    文件:TestYARNRunner.java   
@Test(timeout=20000)
public void testResourceMgrDelegate() throws Exception {
  /* we not want a mock of resource mgr delegate */
  final ApplicationClientProtocol clientRMProtocol = mock(ApplicationClientProtocol.class);
  ResourceMgrDelegate delegate = new ResourceMgrDelegate(conf) {
    @Override
    protected void serviceStart() throws Exception {
      assertTrue(this.client instanceof YarnClientImpl);
      ((YarnClientImpl) this.client).setRMClient(clientRMProtocol);
    }
  };
  /* make sure kill calls finish application master */
  when(clientRMProtocol.forceKillApplication(any(KillApplicationRequest.class)))
  .thenReturn(null);
  delegate.killApplication(appId);
  verify(clientRMProtocol).forceKillApplication(any(KillApplicationRequest.class));

  /* make sure getalljobs calls get all applications */
  when(clientRMProtocol.getApplications(any(GetApplicationsRequest.class))).
  thenReturn(recordFactory.newRecordInstance(GetApplicationsResponse.class));
  delegate.getAllJobs();
  verify(clientRMProtocol).getApplications(any(GetApplicationsRequest.class));

  /* make sure getapplication report is called */
  when(clientRMProtocol.getApplicationReport(any(GetApplicationReportRequest.class)))
  .thenReturn(recordFactory.newRecordInstance(GetApplicationReportResponse.class));
  delegate.getApplicationReport(appId);
  verify(clientRMProtocol).getApplicationReport(any(GetApplicationReportRequest.class));

  /* make sure metrics is called */
  GetClusterMetricsResponse clusterMetricsResponse = recordFactory.newRecordInstance
      (GetClusterMetricsResponse.class);
  clusterMetricsResponse.setClusterMetrics(recordFactory.newRecordInstance(
      YarnClusterMetrics.class));
  when(clientRMProtocol.getClusterMetrics(any(GetClusterMetricsRequest.class)))
  .thenReturn(clusterMetricsResponse);
  delegate.getClusterMetrics();
  verify(clientRMProtocol).getClusterMetrics(any(GetClusterMetricsRequest.class));

  when(clientRMProtocol.getClusterNodes(any(GetClusterNodesRequest.class))).
  thenReturn(recordFactory.newRecordInstance(GetClusterNodesResponse.class));
  delegate.getActiveTrackers();
  verify(clientRMProtocol).getClusterNodes(any(GetClusterNodesRequest.class));

  GetNewApplicationResponse newAppResponse = recordFactory.newRecordInstance(
      GetNewApplicationResponse.class);
  newAppResponse.setApplicationId(appId);
  when(clientRMProtocol.getNewApplication(any(GetNewApplicationRequest.class))).
  thenReturn(newAppResponse);
  delegate.getNewJobID();
  verify(clientRMProtocol).getNewApplication(any(GetNewApplicationRequest.class));

  GetQueueInfoResponse queueInfoResponse = recordFactory.newRecordInstance(
      GetQueueInfoResponse.class);
  queueInfoResponse.setQueueInfo(recordFactory.newRecordInstance(QueueInfo.class));
  when(clientRMProtocol.getQueueInfo(any(GetQueueInfoRequest.class))).
  thenReturn(queueInfoResponse);
  delegate.getQueues();
  verify(clientRMProtocol).getQueueInfo(any(GetQueueInfoRequest.class));

  GetQueueUserAclsInfoResponse aclResponse = recordFactory.newRecordInstance(
      GetQueueUserAclsInfoResponse.class);
  when(clientRMProtocol.getQueueUserAcls(any(GetQueueUserAclsInfoRequest.class)))
  .thenReturn(aclResponse);
  delegate.getQueueAclsForCurrentUser();
  verify(clientRMProtocol).getQueueUserAcls(any(GetQueueUserAclsInfoRequest.class));
}
项目:hadoop-plus    文件:TestClientRedirect.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws IOException {
  return null;
}
项目:FlexMap    文件:TestYARNRunner.java   
@Test(timeout=20000)
public void testResourceMgrDelegate() throws Exception {
  /* we not want a mock of resource mgr delegate */
  final ApplicationClientProtocol clientRMProtocol = mock(ApplicationClientProtocol.class);
  ResourceMgrDelegate delegate = new ResourceMgrDelegate(conf) {
    @Override
    protected void serviceStart() throws Exception {
      assertTrue(this.client instanceof YarnClientImpl);
      ((YarnClientImpl) this.client).setRMClient(clientRMProtocol);
    }
  };
  /* make sure kill calls finish application master */
  when(clientRMProtocol.forceKillApplication(any(KillApplicationRequest.class)))
  .thenReturn(KillApplicationResponse.newInstance(true));
  delegate.killApplication(appId);
  verify(clientRMProtocol).forceKillApplication(any(KillApplicationRequest.class));

  /* make sure getalljobs calls get all applications */
  when(clientRMProtocol.getApplications(any(GetApplicationsRequest.class))).
  thenReturn(recordFactory.newRecordInstance(GetApplicationsResponse.class));
  delegate.getAllJobs();
  verify(clientRMProtocol).getApplications(any(GetApplicationsRequest.class));

  /* make sure getapplication report is called */
  when(clientRMProtocol.getApplicationReport(any(GetApplicationReportRequest.class)))
  .thenReturn(recordFactory.newRecordInstance(GetApplicationReportResponse.class));
  delegate.getApplicationReport(appId);
  verify(clientRMProtocol).getApplicationReport(any(GetApplicationReportRequest.class));

  /* make sure metrics is called */
  GetClusterMetricsResponse clusterMetricsResponse = recordFactory.newRecordInstance
      (GetClusterMetricsResponse.class);
  clusterMetricsResponse.setClusterMetrics(recordFactory.newRecordInstance(
      YarnClusterMetrics.class));
  when(clientRMProtocol.getClusterMetrics(any(GetClusterMetricsRequest.class)))
  .thenReturn(clusterMetricsResponse);
  delegate.getClusterMetrics();
  verify(clientRMProtocol).getClusterMetrics(any(GetClusterMetricsRequest.class));

  when(clientRMProtocol.getClusterNodes(any(GetClusterNodesRequest.class))).
  thenReturn(recordFactory.newRecordInstance(GetClusterNodesResponse.class));
  delegate.getActiveTrackers();
  verify(clientRMProtocol).getClusterNodes(any(GetClusterNodesRequest.class));

  GetNewApplicationResponse newAppResponse = recordFactory.newRecordInstance(
      GetNewApplicationResponse.class);
  newAppResponse.setApplicationId(appId);
  when(clientRMProtocol.getNewApplication(any(GetNewApplicationRequest.class))).
  thenReturn(newAppResponse);
  delegate.getNewJobID();
  verify(clientRMProtocol).getNewApplication(any(GetNewApplicationRequest.class));

  GetQueueInfoResponse queueInfoResponse = recordFactory.newRecordInstance(
      GetQueueInfoResponse.class);
  queueInfoResponse.setQueueInfo(recordFactory.newRecordInstance(QueueInfo.class));
  when(clientRMProtocol.getQueueInfo(any(GetQueueInfoRequest.class))).
  thenReturn(queueInfoResponse);
  delegate.getQueues();
  verify(clientRMProtocol).getQueueInfo(any(GetQueueInfoRequest.class));

  GetQueueUserAclsInfoResponse aclResponse = recordFactory.newRecordInstance(
      GetQueueUserAclsInfoResponse.class);
  when(clientRMProtocol.getQueueUserAcls(any(GetQueueUserAclsInfoRequest.class)))
  .thenReturn(aclResponse);
  delegate.getQueueAclsForCurrentUser();
  verify(clientRMProtocol).getQueueUserAcls(any(GetQueueUserAclsInfoRequest.class));
}
项目:FlexMap    文件:TestClientRedirect.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws IOException {
  return null;
}
项目:hops    文件:MockResourceManagerFacade.java   
@Override
public GetQueueUserAclsInfoResponse getQueueUserAcls(
    GetQueueUserAclsInfoRequest request) throws YarnException,
    IOException {
  throw new NotImplementedException();
}
项目:hops    文件:TestYARNRunner.java   
@Test(timeout=20000)
public void testResourceMgrDelegate() throws Exception {
  /* we not want a mock of resource mgr delegate */
  final ApplicationClientProtocol clientRMProtocol = mock(ApplicationClientProtocol.class);
  ResourceMgrDelegate delegate = new ResourceMgrDelegate(conf) {
    @Override
    protected void serviceStart() throws Exception {
      assertTrue(this.client instanceof YarnClientImpl);
      ((YarnClientImpl) this.client).setRMClient(clientRMProtocol);
    }
  };
  /* make sure kill calls finish application master */
  when(clientRMProtocol.forceKillApplication(any(KillApplicationRequest.class)))
  .thenReturn(KillApplicationResponse.newInstance(true));
  delegate.killApplication(appId);
  verify(clientRMProtocol).forceKillApplication(any(KillApplicationRequest.class));

  /* make sure getalljobs calls get all applications */
  when(clientRMProtocol.getApplications(any(GetApplicationsRequest.class))).
  thenReturn(recordFactory.newRecordInstance(GetApplicationsResponse.class));
  delegate.getAllJobs();
  verify(clientRMProtocol).getApplications(any(GetApplicationsRequest.class));

  /* make sure getapplication report is called */
  when(clientRMProtocol.getApplicationReport(any(GetApplicationReportRequest.class)))
  .thenReturn(recordFactory.newRecordInstance(GetApplicationReportResponse.class));
  delegate.getApplicationReport(appId);
  verify(clientRMProtocol).getApplicationReport(any(GetApplicationReportRequest.class));

  /* make sure metrics is called */
  GetClusterMetricsResponse clusterMetricsResponse = recordFactory.newRecordInstance
      (GetClusterMetricsResponse.class);
  clusterMetricsResponse.setClusterMetrics(recordFactory.newRecordInstance(
      YarnClusterMetrics.class));
  when(clientRMProtocol.getClusterMetrics(any(GetClusterMetricsRequest.class)))
  .thenReturn(clusterMetricsResponse);
  delegate.getClusterMetrics();
  verify(clientRMProtocol).getClusterMetrics(any(GetClusterMetricsRequest.class));

  when(clientRMProtocol.getClusterNodes(any(GetClusterNodesRequest.class))).
  thenReturn(recordFactory.newRecordInstance(GetClusterNodesResponse.class));
  delegate.getActiveTrackers();
  verify(clientRMProtocol).getClusterNodes(any(GetClusterNodesRequest.class));

  GetNewApplicationResponse newAppResponse = recordFactory.newRecordInstance(
      GetNewApplicationResponse.class);
  newAppResponse.setApplicationId(appId);
  when(clientRMProtocol.getNewApplication(any(GetNewApplicationRequest.class))).
  thenReturn(newAppResponse);
  delegate.getNewJobID();
  verify(clientRMProtocol).getNewApplication(any(GetNewApplicationRequest.class));

  GetQueueInfoResponse queueInfoResponse = recordFactory.newRecordInstance(
      GetQueueInfoResponse.class);
  queueInfoResponse.setQueueInfo(recordFactory.newRecordInstance(QueueInfo.class));
  when(clientRMProtocol.getQueueInfo(any(GetQueueInfoRequest.class))).
  thenReturn(queueInfoResponse);
  delegate.getQueues();
  verify(clientRMProtocol).getQueueInfo(any(GetQueueInfoRequest.class));

  GetQueueUserAclsInfoResponse aclResponse = recordFactory.newRecordInstance(
      GetQueueUserAclsInfoResponse.class);
  when(clientRMProtocol.getQueueUserAcls(any(GetQueueUserAclsInfoRequest.class)))
  .thenReturn(aclResponse);
  delegate.getQueueAclsForCurrentUser();
  verify(clientRMProtocol).getQueueUserAcls(any(GetQueueUserAclsInfoRequest.class));
}