use of com.emc.storageos.coordinator.exceptions.RetryableCoordinatorException in project coprhd-controller by CoprHD.
the class HostSupplierImpl method internalGet.
public List<Host> internalGet() {
try {
_log.debug("getting hosts for " + dbSvcName + "; version = " + _version);
boolean isGeodb = Constants.GEODBSVC_NAME.equals(dbSvcName);
List<Service> service = _coordinator.locateAllServices(dbSvcName, _version, (String) null, null);
List<Host> hostList = new ArrayList<Host>(service.size());
for (int i = 0; i < service.size(); i++) {
Service svc = service.get(i);
if (isGeodb && isDbReinitializing(svc)) {
_log.debug("Ignore host {} because its geodb is reinitialzing", svc.getId());
continue;
}
URI hostUri = svc.getEndpoint();
_log.debug("Found " + svc.getName() + "; host = " + hostUri.getHost() + "; port = " + hostUri.getPort());
hostList.add(new Host(String.format("%1$s:%2$d", hostUri.getHost(), hostUri.getPort()), hostUri.getPort()));
}
_log.debug("dbsvc endpoint refreshed");
return hostList;
} catch (RetryableCoordinatorException e) {
_log.warn("no dbsvc instance running. Coordinator exception message: {}", e.getMessage());
} catch (Exception e) {
_log.error("dbsvc lookup failure", e);
}
return Collections.emptyList();
}
Aggregations