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


Java RefreshAdminAclsRequest类代码示例

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


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

示例1: refreshAdminAcls

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

示例2: testAdminAclsWithLocalConfigurationProvider

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

  try {
    rm.adminService.refreshAdminAcls(RefreshAdminAclsRequest.newInstance());
  } catch (Exception ex) {
    fail("Using localConfigurationProvider. Should not get any exception.");
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:TestRMAdminService.java

示例3: testAdminAclsWithFileSystemBasedConfigurationProvider

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshAdminAclsRequest; //导入依赖的package包/类
@Test
public void testAdminAclsWithFileSystemBasedConfigurationProvider()
    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");
  }

  String aclStringBefore =
      rm.adminService.getAccessControlList().getAclString().trim();

  YarnConfiguration yarnConf = new YarnConfiguration();
  yarnConf.set(YarnConfiguration.YARN_ADMIN_ACL, "world:anyone:rwcda");
  uploadConfiguration(yarnConf, "yarn-site.xml");

  rm.adminService.refreshAdminAcls(RefreshAdminAclsRequest.newInstance());

  String aclStringAfter =
      rm.adminService.getAccessControlList().getAclString().trim();

  Assert.assertTrue(!aclStringAfter.equals(aclStringBefore));
  Assert.assertEquals(aclStringAfter, "world:anyone:rwcda,"
      + UserGroupInformation.getCurrentUser().getShortUserName());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:34,代码来源:TestRMAdminService.java

示例4: refreshAdminAcls

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

示例5: testRefreshAdminAcls

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshAdminAclsRequest; //导入依赖的package包/类
/**
 * Test method refreshAdminAcls. This method is present and it works.
 */

@Test
public void testRefreshAdminAcls() throws Exception {
  RefreshAdminAclsRequest request = recordFactory
          .newRecordInstance(RefreshAdminAclsRequest.class);
  RefreshAdminAclsResponse response = client.refreshAdminAcls(request);
  assertNotNull(response);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:TestResourceManagerAdministrationProtocolPBClientImpl.java

示例6: testAdminAclsWithFileSystemBasedConfigurationProvider

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshAdminAclsRequest; //导入依赖的package包/类
@Test
public void testAdminAclsWithFileSystemBasedConfigurationProvider()
    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");
  }

  String aclStringBefore =
      rm.adminService.getAccessControlList().getAclString().trim();

  YarnConfiguration yarnConf = new YarnConfiguration();
  yarnConf.set(YarnConfiguration.YARN_ADMIN_ACL, "world:anyone:rwcda");
  uploadConfiguration(yarnConf, "yarn-site.xml");

  rm.adminService.refreshAdminAcls(RefreshAdminAclsRequest.newInstance());

  String aclStringAfter =
      rm.adminService.getAccessControlList().getAclString().trim();

  Assert.assertTrue(!aclStringAfter.equals(aclStringBefore));
  Assert.assertEquals(aclStringAfter, "world:anyone:rwcda," +
      UserGroupInformation.getCurrentUser().getShortUserName());
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:34,代码来源:TestRMAdminService.java

示例7: testRefreshAclWithDaemonUser

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshAdminAclsRequest; //导入依赖的package包/类
@Test
public void testRefreshAclWithDaemonUser() throws Exception {
  String daemonUser =
      UserGroupInformation.getCurrentUser().getShortUserName();
  configuration.set(YarnConfiguration.RM_CONFIGURATION_PROVIDER_CLASS,
      "org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider");

  uploadDefaultConfiguration();
  YarnConfiguration yarnConf = new YarnConfiguration();
  yarnConf.set(YarnConfiguration.YARN_ADMIN_ACL, daemonUser + "xyz");
  uploadConfiguration(yarnConf, "yarn-site.xml");

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

  assertEquals(daemonUser + "xyz," + daemonUser,
      rm.adminService.getAccessControlList().getAclString().trim());

  yarnConf = new YarnConfiguration();
  yarnConf.set(YarnConfiguration.YARN_ADMIN_ACL, daemonUser + "abc");
  uploadConfiguration(yarnConf, "yarn-site.xml");
  try {
    rm.adminService.refreshAdminAcls(RefreshAdminAclsRequest.newInstance());
  } catch (YarnException e) {
    if (e.getCause() != null &&
        e.getCause() instanceof AccessControlException) {
      fail("Refresh should not have failed due to incorrect ACL");
    }
    throw e;
  }

  assertEquals(daemonUser + "abc," + daemonUser,
      rm.adminService.getAccessControlList().getAclString().trim());
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:40,代码来源:TestRMAdminService.java

示例8: testRefreshAclWithDaemonUser

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshAdminAclsRequest; //导入依赖的package包/类
@Test
public void testRefreshAclWithDaemonUser() throws Exception {
  String daemonUser =
      UserGroupInformation.getCurrentUser().getShortUserName();
  configuration.set(YarnConfiguration.RM_CONFIGURATION_PROVIDER_CLASS,
      "org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider");

  uploadDefaultConfiguration();
  YarnConfiguration yarnConf = new YarnConfiguration();
  yarnConf.set(YarnConfiguration.YARN_ADMIN_ACL, daemonUser + "xyz");
  uploadConfiguration(yarnConf, "yarn-site.xml");

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

  Assert.assertEquals(daemonUser + "xyz," + daemonUser,
      rm.adminService.getAccessControlList().getAclString().trim());

  yarnConf = new YarnConfiguration();
  yarnConf.set(YarnConfiguration.YARN_ADMIN_ACL, daemonUser + "abc");
  uploadConfiguration(yarnConf, "yarn-site.xml");
  try {
    rm.adminService.refreshAdminAcls(RefreshAdminAclsRequest.newInstance());
  } catch (YarnException e) {
    if (e.getCause() != null &&
        e.getCause() instanceof AccessControlException) {
      fail("Refresh should not have failed due to incorrect ACL");
    }
    throw e;
  }

  Assert.assertEquals(daemonUser + "abc," + daemonUser,
      rm.adminService.getAccessControlList().getAclString().trim());
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:40,代码来源:TestRMAdminService.java

示例9: testAdminAclsWithFileSystemBasedConfigurationProvider

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshAdminAclsRequest; //导入依赖的package包/类
@Test
public void testAdminAclsWithFileSystemBasedConfigurationProvider()
    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");
  }

  String aclStringBefore =
      rm.adminService.getAccessControlList().getAclString().trim();

  YarnConfiguration yarnConf = new YarnConfiguration();
  yarnConf.set(YarnConfiguration.YARN_ADMIN_ACL, "world:anyone:rwcda");
  uploadConfiguration(yarnConf, "yarn-site.xml");

  rm.adminService.refreshAdminAcls(RefreshAdminAclsRequest.newInstance());

  String aclStringAfter =
      rm.adminService.getAccessControlList().getAclString().trim();

  Assert.assertTrue(!aclStringAfter.equals(aclStringBefore));
  Assert.assertEquals(aclStringAfter, "world:anyone:rwcda");
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:33,代码来源:TestRMAdminService.java

示例10: refreshAdminAcls

import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshAdminAclsRequest; //导入依赖的package包/类
@Override
public RefreshAdminAclsResponse refreshAdminAcls(
    RefreshAdminAclsRequest request) throws YarnException {
  UserGroupInformation user = checkAcls("refreshAdminAcls");
  
  Configuration conf = new Configuration();
  adminAcl = new AccessControlList(conf.get(
      YarnConfiguration.YARN_ADMIN_ACL,
      YarnConfiguration.DEFAULT_YARN_ADMIN_ACL));
  RMAuditLogger.logSuccess(user.getShortUserName(), "refreshAdminAcls", 
      "AdminService");

  return recordFactory.newRecordInstance(RefreshAdminAclsResponse.class);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:15,代码来源:AdminService.java


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