Example usage for org.apache.hadoop.registry.client.binding RegistryPathUtils encodeForRegistry

List of usage examples for org.apache.hadoop.registry.client.binding RegistryPathUtils encodeForRegistry

Introduction

In this page you can find the example usage for org.apache.hadoop.registry.client.binding RegistryPathUtils encodeForRegistry.

Prototype

public static String encodeForRegistry(String element) 

Source Link

Document

Perform any formatting for the registry needed to convert non-simple-DNS elements

Usage

From source file:org.apache.slider.client.SliderClient.java

License:Apache License

/**
 * Look up an instance//from  w w w. j a v a  2s .c om
 * @return instance data
 * @throws SliderException other failures
 * @throws IOException IO problems or wrapped exceptions
 */
private ServiceRecord lookupServiceRecord(ActionRegistryArgs registryArgs) throws SliderException, IOException {
    String user;
    if (StringUtils.isNotEmpty(registryArgs.user)) {
        user = RegistryPathUtils.encodeForRegistry(registryArgs.user);
    } else {
        user = currentUser();
    }

    String path = servicePath(user, registryArgs.serviceType, registryArgs.name);
    return resolve(path);
}