List of usage examples for org.apache.hadoop.registry.client.binding RegistryTypeUtils retrieveAddressURLs
public static List<URL> retrieveAddressURLs(Endpoint epr) throws InvalidRecordException, MalformedURLException
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()); }/* ww w .j av a 2s . c om*/ } catch (InvalidRecordException ignored) { // Ignored } catch (MalformedURLException ignored) { // ignored } } } }