use of org.apache.hadoop.registry.server.integration.RMRegistryOperationsService in project hadoop by apache.
the class AbstractRegistryTest method setupRegistry.
@Before
public void setupRegistry() throws IOException {
registry = new RMRegistryOperationsService("yarnRegistry");
operations = registry;
registry.init(createRegistryConfiguration());
registry.start();
operations.delete("/", true);
registry.createRootRegistryPaths();
addToTeardown(registry);
}
use of org.apache.hadoop.registry.server.integration.RMRegistryOperationsService in project hadoop by apache.
the class TestSecureRMRegistryOperations method startRMRegistryOperations.
/**
* 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;
}
use of org.apache.hadoop.registry.server.integration.RMRegistryOperationsService in project hadoop by apache.
the class TestSecureRMRegistryOperations method testAlicePathRestrictedAnonAccess.
@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);
}
use of org.apache.hadoop.registry.server.integration.RMRegistryOperationsService in project hadoop by apache.
the class TestSecureRMRegistryOperations method testAnonNoWriteAccess.
@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);
}
use of org.apache.hadoop.registry.server.integration.RMRegistryOperationsService in project jstorm by alibaba.
the class JstormMaster method setupInitialRegistryPaths.
/**
* TODO: purge this once RM is doing the work
*
* @throws IOException
*/
protected void setupInitialRegistryPaths() throws IOException {
if (registryOperations instanceof RMRegistryOperationsService) {
RMRegistryOperationsService rmRegOperations = (RMRegistryOperationsService) registryOperations;
rmRegOperations.initUserRegistryAsync(jstormMasterContext.service_user_name);
}
}
Aggregations