Example usage for org.apache.hadoop.registry.client.types AddressTypes ADDRESS_URI

List of usage examples for org.apache.hadoop.registry.client.types AddressTypes ADDRESS_URI

Introduction

In this page you can find the example usage for org.apache.hadoop.registry.client.types AddressTypes ADDRESS_URI.

Prototype

String ADDRESS_URI

To view the source code for org.apache.hadoop.registry.client.types AddressTypes ADDRESS_URI.

Click Source Link

Document

URI entries: .

Usage

From source file:org.apache.slider.providers.AbstractProviderService.java

License:Apache License

@Override
public void buildEndpointDetails(Map<String, String> details) {
    ServiceRecord self = yarnRegistry.getSelfRegistration();

    List<Endpoint> externals = self.external;
    for (Endpoint endpoint : externals) {
        String addressType = endpoint.addressType;
        if (AddressTypes.ADDRESS_URI.equals(addressType)) {
            try {
                List<URL> urls = RegistryTypeUtils.retrieveAddressURLs(endpoint);
                if (!urls.isEmpty()) {
                    details.put(endpoint.api, urls.get(0).toString());
                }/*from   w w w . j  a v  a 2s.  c  o  m*/
            } catch (InvalidRecordException ignored) {
                // Ignored
            } catch (MalformedURLException ignored) {
                // ignored
            }

        }

    }
}