Java Code Examples for org.apache.hadoop.registry.server.integration.RMRegistryOperationsService#initUserRegistryAsync()

The following examples show how to use org.apache.hadoop.registry.server.integration.RMRegistryOperationsService#initUserRegistryAsync() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: YarnZkRegistryBusiness.java    From PoseidonX with Apache License 2.0 6 votes vote down vote up
private static void initAndStart(){
    try{
        Configuration conf  = new YarnConfiguration();
        conf.set(RegistryConstants.KEY_REGISTRY_ZK_ROOT, YarnZkContant.ZK_AM_REGISTRY_ROOT);
        registryOperations = RegistryOperationsFactory.createInstance(YarnZkContant.ZK_AM_REGISTRY_JSTORM_YARN, conf);
        if (registryOperations instanceof RMRegistryOperationsService) {
            RMRegistryOperationsService rmRegOperations = (RMRegistryOperationsService) registryOperations;
            rmRegOperations.initUserRegistryAsync(StreamContant.HADOOP_USER_NAME);
        }
    }catch(Exception e){
    }
    if(registryOperations==null){
        throw new IllegalArgumentException("YarnZkClientBusiness registryOperations start is error,cann't connect yarn zk!!");
    }
    registryOperations.start();
}
 
Example 2
Source File: JstormMaster.java    From jstorm with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 3
Source File: Executor.java    From jstorm with Apache License 2.0 5 votes vote down vote up
/**
 * 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(RegistryUtils.currentUser());
    }
}
 
Example 4
Source File: RegistryClient.java    From PoseidonX with Apache License 2.0 4 votes vote down vote up
private void setupInitialRegistryPaths(String serviceUserName) throws IOException {
    if (registryOperations instanceof RMRegistryOperationsService) {
        RMRegistryOperationsService rmRegOperations = (RMRegistryOperationsService) registryOperations;
        rmRegOperations.initUserRegistryAsync(serviceUserName);
    }
}