use of com.emc.storageos.coordinator.client.service.impl.CoordinatorClientImpl in project coprhd-controller by CoprHD.
the class BackupOps method isDownloadInProgress.
public boolean isDownloadInProgress() {
try {
CoordinatorClientImpl client = (CoordinatorClientImpl) coordinatorClient;
String path = getDownloadOwnerPath();
log.info("Download zk path={}", path);
List<String> downloaders = client.getChildren(path);
return (downloaders != null) && (!downloaders.isEmpty());
} catch (KeeperException.NoNodeException e) {
// no downloading is running
return false;
} catch (Exception e) {
log.error("Failed to check downloading tasks e=", e);
throw BackupException.fatals.failedToReadZkInfo(e);
}
}
use of com.emc.storageos.coordinator.client.service.impl.CoordinatorClientImpl in project coprhd-controller by CoprHD.
the class BackupOps method registerDownloader.
public void registerDownloader() throws Exception {
String path = getMyDownloadingZKPath();
CoordinatorClientImpl client = (CoordinatorClientImpl) coordinatorClient;
log.info("register downloader: {}", path);
client.createEphemeralNode(path, null);
}
use of com.emc.storageos.coordinator.client.service.impl.CoordinatorClientImpl 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