当前位置: 首页>>代码示例>>Java>>正文


Java RefreshQueuesRequest类代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest的典型用法代码示例。如果您正苦于以下问题:Java RefreshQueuesRequest类的具体用法?Java RefreshQueuesRequest怎么用?Java RefreshQueuesRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RefreshQueuesRequest类属于org.apache.hadoop.yarn.server.api.protocolrecords包,在下文中一共展示了RefreshQueuesRequest类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: refreshQueues

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest; //导入依赖的package包/类
@Override
public RefreshQueuesResponse refreshQueues(RefreshQueuesRequest request)
    throws YarnException, StandbyException {
  String argName = "refreshQueues";
  final String msg = "refresh queues.";
  UserGroupInformation user = checkAcls(argName);

  checkRMStatus(user.getShortUserName(), argName, msg);

  RefreshQueuesResponse response =
      recordFactory.newRecordInstance(RefreshQueuesResponse.class);
  try {
    rmContext.getScheduler().reinitialize(getConfig(), this.rmContext);
    // refresh the reservation system
    ReservationSystem rSystem = rmContext.getReservationSystem();
    if (rSystem != null) {
      rSystem.reinitialize(getConfig(), rmContext);
    }
    RMAuditLogger.logSuccess(user.getShortUserName(), argName,
        "AdminService");
    return response;
  } catch (IOException ioe) {
    throw logAndWrapException(ioe, user.getShortUserName(), argName, msg);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:AdminService.java

示例2: refreshAll

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest; //导入依赖的package包/类
private void refreshAll() throws ServiceFailedException {
  try {
    refreshQueues(RefreshQueuesRequest.newInstance());
    refreshNodes(RefreshNodesRequest.newInstance());
    refreshSuperUserGroupsConfiguration(
        RefreshSuperUserGroupsConfigurationRequest.newInstance());
    refreshUserToGroupsMappings(
        RefreshUserToGroupsMappingsRequest.newInstance());
    if (getConfig().getBoolean(
        CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION,
        false)) {
      refreshServiceAcls(RefreshServiceAclsRequest.newInstance());
    }
  } catch (Exception ex) {
    throw new ServiceFailedException(ex.getMessage());
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:AdminService.java

示例3: testAdminRefreshQueuesWithLocalConfigurationProvider

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest; //导入依赖的package包/类
@Test
public void testAdminRefreshQueuesWithLocalConfigurationProvider()
    throws IOException, YarnException {
  rm = new MockRM(configuration);
  rm.init(configuration);
  rm.start();

  CapacityScheduler cs =
      (CapacityScheduler) rm.getRMContext().getScheduler();
  int maxAppsBefore = cs.getConfiguration().getMaximumSystemApplications();

  try {
    rm.adminService.refreshQueues(RefreshQueuesRequest.newInstance());
    Assert.assertEquals(maxAppsBefore, cs.getConfiguration()
        .getMaximumSystemApplications());
  } catch (Exception ex) {
    fail("Using localConfigurationProvider. Should not get any exception.");
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:TestRMAdminService.java

示例4: testException

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest; //导入依赖的package包/类
@Test(timeout=500)
public void testException() throws Exception {
  PrintStream oldErrPrintStream = System.err;
  ByteArrayOutputStream dataErr = new ByteArrayOutputStream();
  System.setErr(new PrintStream(dataErr));
  try {
    when(admin.refreshQueues(any(RefreshQueuesRequest.class)))
        .thenThrow(new IOException("test exception"));
    String[] args = { "-refreshQueues" };

    assertEquals(-1, rmAdminCLI.run(args));
    verify(admin).refreshQueues(any(RefreshQueuesRequest.class));
    assertTrue(dataErr.toString().contains("refreshQueues: test exception"));
  } finally {
    System.setErr(oldErrPrintStream);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:TestRMAdminCLI.java

示例5: refreshAll

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest; //导入依赖的package包/类
private void refreshAll() throws ServiceFailedException {
  try {
    refreshQueues(RefreshQueuesRequest.newInstance());
    refreshNodes(RefreshNodesRequest.newInstance(DecommissionType.NORMAL));
    refreshSuperUserGroupsConfiguration(
        RefreshSuperUserGroupsConfigurationRequest.newInstance());
    refreshUserToGroupsMappings(
        RefreshUserToGroupsMappingsRequest.newInstance());
    if (getConfig().getBoolean(
        CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION,
        false)) {
      refreshServiceAcls(RefreshServiceAclsRequest.newInstance());
    }
    refreshClusterMaxPriority(RefreshClusterMaxPriorityRequest.newInstance());
  } catch (Exception ex) {
    throw new ServiceFailedException(ex.getMessage());
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:19,代码来源:AdminService.java

示例6: refreshQueues

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest; //导入依赖的package包/类
@Override
public RefreshQueuesResponse refreshQueues(RefreshQueuesRequest request)
    throws YarnException {
  UserGroupInformation user = checkAcls("refreshQueues");
  try {
    scheduler.reinitialize(conf, this.rmContext);
    RMAuditLogger.logSuccess(user.getShortUserName(), "refreshQueues", 
        "AdminService");
    return recordFactory.newRecordInstance(RefreshQueuesResponse.class);
  } catch (IOException ioe) {
    LOG.info("Exception refreshing queues ", ioe);
    RMAuditLogger.logFailure(user.getShortUserName(), "refreshQueues",
        adminAcl.toString(), "AdminService",
        "Exception refreshing queues");
    throw RPCUtil.getRemoteException(ioe);
  }
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:18,代码来源:AdminService.java

示例7: refreshQueues

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest; //导入依赖的package包/类
@Override
public RefreshQueuesResponse refreshQueues(RefreshQueuesRequest request)
    throws YarnException, StandbyException {
  final String operation = "refreshQueues";
  final String msg = "refresh queues.";
  UserGroupInformation user = checkAcls(operation);

  checkRMStatus(user.getShortUserName(), operation, msg);

  RefreshQueuesResponse response =
      recordFactory.newRecordInstance(RefreshQueuesResponse.class);
  try {
    rmContext.getScheduler().reinitialize(getConfig(), this.rmContext);
    // refresh the reservation system
    ReservationSystem rSystem = rmContext.getReservationSystem();
    if (rSystem != null) {
      rSystem.reinitialize(getConfig(), rmContext);
    }
    RMAuditLogger.logSuccess(user.getShortUserName(), operation,
        "AdminService");
    return response;
  } catch (IOException ioe) {
    throw logAndWrapException(ioe, user.getShortUserName(), operation, msg);
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:26,代码来源:AdminService.java

示例8: refreshAll

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest; //导入依赖的package包/类
private void refreshAll() throws ServiceFailedException {
  try {
    refreshQueues(RefreshQueuesRequest.newInstance());
    refreshNodes(RefreshNodesRequest.newInstance(DecommissionType.NORMAL));
    refreshSuperUserGroupsConfiguration(
        RefreshSuperUserGroupsConfigurationRequest.newInstance());
    refreshUserToGroupsMappings(
        RefreshUserToGroupsMappingsRequest.newInstance());
    if (getConfig().getBoolean(
        CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION,
        false)) {
      refreshServiceAcls(RefreshServiceAclsRequest.newInstance());
    }
    refreshClusterMaxPriority(RefreshClusterMaxPriorityRequest.newInstance());
  } catch (Exception ex) {
    throw new ServiceFailedException("RefreshAll operation failed", ex);
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:19,代码来源:AdminService.java

示例9: testException

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest; //导入依赖的package包/类
@Test
public void testException() throws Exception {
  PrintStream oldErrPrintStream = System.err;
  ByteArrayOutputStream dataErr = new ByteArrayOutputStream();
  System.setErr(new PrintStream(dataErr));
  try {
    when(admin.refreshQueues(any(RefreshQueuesRequest.class)))
        .thenThrow(new IOException("test exception"));
    String[] args = { "-refreshQueues" };

    assertEquals(-1, rmAdminCLI.run(args));
    verify(admin).refreshQueues(any(RefreshQueuesRequest.class));
    assertTrue(dataErr.toString().contains("refreshQueues: test exception"));
  } finally {
    System.setErr(oldErrPrintStream);
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:18,代码来源:TestRMAdminCLI.java

示例10: refreshQueues

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest; //导入依赖的package包/类
@Override
public RefreshQueuesResponse refreshQueues(RefreshQueuesRequest request)
    throws YarnException, IOException {
  RefreshQueuesRequestProto requestProto = 
    ((RefreshQueuesRequestPBImpl)request).getProto();
  try {
    return new RefreshQueuesResponsePBImpl(
        proxy.refreshQueues(null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:ResourceManagerAdministrationProtocolPBClientImpl.java

示例11: testAdminRefreshQueuesWithFileSystemBasedConfigurationProvider

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest; //导入依赖的package包/类
@Test
public void testAdminRefreshQueuesWithFileSystemBasedConfigurationProvider()
    throws IOException, YarnException {
  configuration.set(YarnConfiguration.RM_CONFIGURATION_PROVIDER_CLASS,
      "org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider");

  //upload default configurations
  uploadDefaultConfiguration();

  try {
    rm = new MockRM(configuration);
    rm.init(configuration);
    rm.start();
  } catch(Exception ex) {
    fail("Should not get any exceptions");
  }

  CapacityScheduler cs =
      (CapacityScheduler) rm.getRMContext().getScheduler();
  int maxAppsBefore = cs.getConfiguration().getMaximumSystemApplications();

  CapacitySchedulerConfiguration csConf =
      new CapacitySchedulerConfiguration();
  csConf.set("yarn.scheduler.capacity.maximum-applications", "5000");
  uploadConfiguration(csConf, "capacity-scheduler.xml");

  rm.adminService.refreshQueues(RefreshQueuesRequest.newInstance());

  int maxAppsAfter = cs.getConfiguration().getMaximumSystemApplications();
  Assert.assertEquals(maxAppsAfter, 5000);
  Assert.assertTrue(maxAppsAfter != maxAppsBefore);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:33,代码来源:TestRMAdminService.java

示例12: refreshQueues

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest; //导入依赖的package包/类
private int refreshQueues() throws IOException, YarnException {
  // Refresh the queue properties
  ResourceManagerAdministrationProtocol adminProtocol = createAdminProtocol();
  RefreshQueuesRequest request = 
    recordFactory.newRecordInstance(RefreshQueuesRequest.class);
  adminProtocol.refreshQueues(request);
  return 0;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:RMAdminCLI.java

示例13: testRefreshQueues

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest; //导入依赖的package包/类
/**
 * Test method refreshQueues. This method is present and it works.
 */
@Test
public void testRefreshQueues() throws Exception {

  RefreshQueuesRequest request = recordFactory
          .newRecordInstance(RefreshQueuesRequest.class);
  RefreshQueuesResponse response = client.refreshQueues(request);
  assertNotNull(response);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:TestResourceManagerAdministrationProtocolPBClientImpl.java

示例14: refreshQueues

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest; //导入依赖的package包/类
@Override
public RefreshQueuesResponse refreshQueues(RefreshQueuesRequest request)
    throws YarnException, StandbyException {
  String argName = "refreshQueues";
  UserGroupInformation user = checkAcls(argName);

  if (!isRMActive()) {
    RMAuditLogger.logFailure(user.getShortUserName(), argName,
        adminAcl.toString(), "AdminService",
        "ResourceManager is not active. Can not refresh queues.");
    throwStandbyException();
  }

  RefreshQueuesResponse response =
      recordFactory.newRecordInstance(RefreshQueuesResponse.class);
  try {
    rmContext.getScheduler().reinitialize(getConfig(), this.rmContext);
    // refresh the reservation system
    ReservationSystem rSystem = rmContext.getReservationSystem();
    if (rSystem != null) {
      rSystem.reinitialize(getConfig(), rmContext);
    }
    RMAuditLogger.logSuccess(user.getShortUserName(), argName,
        "AdminService");
    return response;
  } catch (IOException ioe) {
    LOG.info("Exception refreshing queues ", ioe);
    RMAuditLogger.logFailure(user.getShortUserName(), argName,
        adminAcl.toString(), "AdminService",
        "Exception refreshing queues");
    throw RPCUtil.getRemoteException(ioe);
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:34,代码来源:AdminService.java


注:本文中的org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。