use of org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters in project ovirt-engine by oVirt.
the class GlusterGeoRepSyncJob method getSessionsFromCLI.
private Map<String, GlusterGeoRepSession> getSessionsFromCLI(Cluster cluster, GlusterVolumeEntity volume) {
VDS upServer = glusterUtil.getRandomUpServer(cluster.getId());
if (upServer == null) {
log.debug("No UP server found in cluster '{}' for geo-rep monitoring", cluster.getName());
return null;
}
String volName = volume != null ? volume.getName() : null;
// get details of geo-rep sessions in cluster
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeGeoRepSessionList, new GlusterVolumeGeoRepSessionVDSParameters(upServer.getId(), volName));
if (returnValue.getSucceeded()) {
List<GlusterGeoRepSession> sessions = (List<GlusterGeoRepSession>) returnValue.getReturnValue();
HashMap<String, GlusterGeoRepSession> sessionsMap = new HashMap<>();
if (sessions == null) {
return sessionsMap;
}
for (GlusterGeoRepSession session : sessions) {
sessionsMap.put(session.getSessionKey(), session);
}
return sessionsMap;
} else {
log.error("VDS error {}", returnValue.getVdsError().getMessage());
log.debug("VDS error", returnValue.getVdsError());
return null;
}
}
Aggregations