本文整理汇总了Java中org.apache.hadoop.registry.server.integration.RMRegistryOperationsService类的典型用法代码示例。如果您正苦于以下问题:Java RMRegistryOperationsService类的具体用法?Java RMRegistryOperationsService怎么用?Java RMRegistryOperationsService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RMRegistryOperationsService类属于org.apache.hadoop.registry.server.integration包,在下文中一共展示了RMRegistryOperationsService类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: startRMRegistryOperations
import org.apache.hadoop.registry.server.integration.RMRegistryOperationsService; //导入依赖的package包/类
/**
* Create the RM registry operations as the current user
* @return the service
* @throws LoginException
* @throws FileNotFoundException
*/
public RMRegistryOperationsService startRMRegistryOperations() throws
LoginException, IOException, InterruptedException {
// kerberos
secureConf.set(KEY_REGISTRY_CLIENT_AUTH,
REGISTRY_CLIENT_AUTH_KERBEROS);
secureConf.set(KEY_REGISTRY_CLIENT_JAAS_CONTEXT, ZOOKEEPER_CLIENT_CONTEXT);
RMRegistryOperationsService registryOperations = zookeeperUGI.doAs(
new PrivilegedExceptionAction<RMRegistryOperationsService>() {
@Override
public RMRegistryOperationsService run() throws Exception {
RMRegistryOperationsService operations
= new RMRegistryOperationsService("rmregistry", secureZK);
addToTeardown(operations);
operations.init(secureConf);
LOG.info(operations.bindingDiagnosticDetails());
operations.start();
return operations;
}
});
return registryOperations;
}
开发者ID:naver,项目名称:hadoop,代码行数:30,代码来源:TestSecureRMRegistryOperations.java
示例2: testUserHomedirsPermissionsRestricted
import org.apache.hadoop.registry.server.integration.RMRegistryOperationsService; //导入依赖的package包/类
@Test
public void testUserHomedirsPermissionsRestricted() throws Throwable {
// test that the /users/$user permissions are restricted
RMRegistryOperationsService rmRegistryOperations =
startRMRegistryOperations();
// create Alice's dir, so it should have an ACL for Alice
final String home = rmRegistryOperations.initUserRegistry(ALICE);
List<ACL> acls = rmRegistryOperations.zkGetACLS(home);
ACL aliceACL = null;
for (ACL acl : acls) {
LOG.info(RegistrySecurity.aclToString(acl));
Id id = acl.getId();
if (id.getScheme().equals(ZookeeperConfigOptions.SCHEME_SASL)
&& id.getId().startsWith(ALICE)) {
aliceACL = acl;
break;
}
}
assertNotNull(aliceACL);
assertEquals(RegistryAdminService.USER_HOMEDIR_ACL_PERMISSIONS,
aliceACL.getPerms());
}
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:TestSecureRMRegistryOperations.java
示例3: testZookeeperCanWriteUnderSystem
import org.apache.hadoop.registry.server.integration.RMRegistryOperationsService; //导入依赖的package包/类
/**
* test that ZK can write as itself
* @throws Throwable
*/
@Test
public void testZookeeperCanWriteUnderSystem() throws Throwable {
RMRegistryOperationsService rmRegistryOperations =
startRMRegistryOperations();
RegistryOperations operations = rmRegistryOperations;
operations.mknode(PATH_SYSTEM_SERVICES + "hdfs",
false);
ZKPathDumper pathDumper = rmRegistryOperations.dumpPath(true);
LOG.info(pathDumper.toString());
}
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:TestSecureRMRegistryOperations.java
示例4: testAnonReadAccess
import org.apache.hadoop.registry.server.integration.RMRegistryOperationsService; //导入依赖的package包/类
@Test
public void testAnonReadAccess() throws Throwable {
RMRegistryOperationsService rmRegistryOperations =
startRMRegistryOperations();
describe(LOG, "testAnonReadAccess");
RegistryOperations operations =
RegistryOperationsFactory.createAnonymousInstance(zkClientConf);
addToTeardown(operations);
operations.start();
assertFalse("RegistrySecurity.isClientSASLEnabled()==true",
RegistrySecurity.isClientSASLEnabled());
operations.list(PATH_SYSTEM_SERVICES);
}
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:TestSecureRMRegistryOperations.java
示例5: testAnonNoWriteAccess
import org.apache.hadoop.registry.server.integration.RMRegistryOperationsService; //导入依赖的package包/类
@Test
public void testAnonNoWriteAccess() throws Throwable {
RMRegistryOperationsService rmRegistryOperations =
startRMRegistryOperations();
describe(LOG, "testAnonNoWriteAccess");
RegistryOperations operations =
RegistryOperationsFactory.createAnonymousInstance(zkClientConf);
addToTeardown(operations);
operations.start();
String servicePath = PATH_SYSTEM_SERVICES + "hdfs";
expectMkNodeFailure(operations, servicePath);
}
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:TestSecureRMRegistryOperations.java
示例6: testAnonNoWriteAccessOffRoot
import org.apache.hadoop.registry.server.integration.RMRegistryOperationsService; //导入依赖的package包/类
@Test
public void testAnonNoWriteAccessOffRoot() throws Throwable {
RMRegistryOperationsService rmRegistryOperations =
startRMRegistryOperations();
describe(LOG, "testAnonNoWriteAccessOffRoot");
RegistryOperations operations =
RegistryOperationsFactory.createAnonymousInstance(zkClientConf);
addToTeardown(operations);
operations.start();
assertFalse("mknode(/)", operations.mknode("/", false));
expectMkNodeFailure(operations, "/sub");
expectDeleteFailure(operations, PATH_SYSTEM_SERVICES, true);
}
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:TestSecureRMRegistryOperations.java
示例7: testAlicePathRestrictedAnonAccess
import org.apache.hadoop.registry.server.integration.RMRegistryOperationsService; //导入依赖的package包/类
@Test
public void testAlicePathRestrictedAnonAccess() throws Throwable {
RMRegistryOperationsService rmRegistryOperations =
startRMRegistryOperations();
String aliceHome = rmRegistryOperations.initUserRegistry(ALICE);
describe(LOG, "Creating anonymous accessor");
RegistryOperations anonOperations =
RegistryOperationsFactory.createAnonymousInstance(zkClientConf);
addToTeardown(anonOperations);
anonOperations.start();
anonOperations.list(aliceHome);
expectMkNodeFailure(anonOperations, aliceHome + "/anon");
expectDeleteFailure(anonOperations, aliceHome, true);
}
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:TestSecureRMRegistryOperations.java
示例8: setupRegistry
import org.apache.hadoop.registry.server.integration.RMRegistryOperationsService; //导入依赖的package包/类
@Before
public void setupRegistry() throws IOException {
registry = new RMRegistryOperationsService("yarnRegistry");
operations = registry;
registry.init(createRegistryConfiguration());
registry.start();
operations.delete("/", true);
registry.createRootRegistryPaths();
addToTeardown(registry);
}
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:AbstractRegistryTest.java
注:本文中的org.apache.hadoop.registry.server.integration.RMRegistryOperationsService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论