use of com.emc.storageos.coordinator.client.service.impl.CoordinatorClientInetAddressMap in project coprhd-controller by CoprHD.
the class BackupOps method initHosts.
private synchronized void initHosts() {
CoordinatorClientInetAddressMap addressMap = getInetAddressLookupMap();
hosts = new TreeMap<>();
for (String nodeId : addressMap.getControllerNodeIPLookupMap().keySet()) {
try {
String ipAddr = addressMap.getConnectableInternalAddress(nodeId);
DualInetAddress inetAddress = DualInetAddress.fromAddress(ipAddr);
String host = normalizeDualInetAddress(inetAddress);
hosts.put(nodeId, host);
} catch (Exception ex) {
throw BackupException.fatals.failedToGetHost(nodeId, ex);
}
}
quorumSize = hosts.size() / 2 + 1;
}
use of com.emc.storageos.coordinator.client.service.impl.CoordinatorClientInetAddressMap in project coprhd-controller by CoprHD.
the class ZkSimulator method connectClient.
/**
* Connects to Zookeeper server
*
* @return The instance of CoordinatorClient
* @throws IOException
*/
private CoordinatorClient connectClient() throws IOException {
CoordinatorClientImpl client = new CoordinatorClientImpl();
ZkConnection conn = new ZkConnection();
URI zkUri = URI.create(String.format("coordinator://localhost:%s", config.getClientPortAddress().getPort()));
conn.setServer(Arrays.asList(zkUri));
conn.setTimeoutMs(10 * 1000);
conn.setSiteIdFile("build/data/zk/siteIdFile");
log.info("Connecting with coordinator service...");
conn.build();
log.info("Connecting with coordinator service.");
client.setZkConnection(conn);
CoordinatorClientInetAddressMap inetAddressMap = new CoordinatorClientInetAddressMap();
inetAddressMap.setNodeId("standalone");
inetAddressMap.setDualInetAddress(DualInetAddress.fromAddress("127.0.0.1"));
inetAddressMap.setCoordinatorClient(client);
inetAddressMap.setControllerNodeIPLookupMap(new HashMap<String, DualInetAddress>());
client.setInetAddessLookupMap(inetAddressMap);
client.setSysSvcName("syssvc");
client.setSysSvcVersion("1");
client.setVdcShortId("vdc1");
Properties properties = new Properties();
properties.setProperty(BackupConstants.BACKUP_MAX_MANUAL_COPIES, "5");
client.setDefaultProperties(properties);
FileInputStream is = new FileInputStream(ovfPropsLocation);
Properties ovfProps = new Properties();
ovfProps.load(is);
is.close();
client.setOvfProperties(ovfProps);
client.start();
return client;
}
Aggregations