use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails in project ovirt-engine by oVirt.
the class VolumeGeoRepListModel method showGeoRepSessionDetails.
public void showGeoRepSessionDetails(GlusterGeoRepSession session) {
ArrayList<GlusterGeoRepSessionDetails> details = session.getSessionDetails();
if (getWindow() != null) {
return;
}
if (details == null || details.size() == 0) {
final UIConstants constants = ConstantsManager.getInstance().getConstants();
final ConfirmationModel cModel = new ConfirmationModel();
cModel.setTitle(constants.geoReplicationSessionDetailsTitle());
// $NON-NLS-1$
UICommand okCommand = new UICommand("closeConfirmWindow", this);
okCommand.setTitle(constants.ok());
okCommand.setIsCancel(true);
cModel.getCommands().add(okCommand);
setConfirmWindow(cModel);
cModel.setMessage(constants.geoRepSessionStatusDetailFetchFailed());
} else {
populateStatus(details);
}
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails in project ovirt-engine by oVirt.
the class GlusterGeoRepDaoImpl method saveOrUpdateDetailsInBatch.
@Override
public void saveOrUpdateDetailsInBatch(List<GlusterGeoRepSessionDetails> geoRepSessionDetailsObjs) {
List<GlusterGeoRepSessionDetails> insertList = new ArrayList<>();
List<GlusterGeoRepSessionDetails> updateList = new ArrayList<>();
for (GlusterGeoRepSessionDetails details : geoRepSessionDetailsObjs) {
if (getGeoRepSessionDetails(details.getSessionId(), details.getMasterBrickId()) == null) {
insertList.add(details);
} else {
updateList.add(details);
}
}
saveDetailsInBatch(insertList);
updateDetailsInBatch(updateList);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails in project ovirt-engine by oVirt.
the class GlusterGeoRepSyncJobTest method getSessionDetailsList.
private ArrayList<GlusterGeoRepSessionDetails> getSessionDetailsList() {
ArrayList<GlusterGeoRepSessionDetails> list = new ArrayList<>();
GlusterGeoRepSessionDetails details = new GlusterGeoRepSessionDetails();
details.setMasterBrickId(Guid.newGuid());
list.add(details);
return list;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails in project ovirt-engine by oVirt.
the class GlusterGeoRepDaoTest method testUpdateDetails.
@Test
public void testUpdateDetails() {
GlusterGeoRepSessionDetails sessionDetails = getGlusterGeoRepSessionDetails();
dao.saveDetails(sessionDetails);
Long entryOpsPending = 567888L;
Long dataOpsPending = 50L;
sessionDetails.setEntryOpsPending(entryOpsPending);
sessionDetails.setCheckPointStatus("NEW");
sessionDetails.setDataOpsPending(dataOpsPending);
dao.updateDetails(sessionDetails);
List<GlusterGeoRepSessionDetails> fetchedSessionDetails = dao.getGeoRepSessionDetails(FixturesTool.GLUSTER_GEOREP_SESSION_ID);
assertEquals(entryOpsPending, fetchedSessionDetails.get(0).getEntryOpsPending());
assertEquals(dataOpsPending, fetchedSessionDetails.get(0).getDataOpsPending());
assertEquals("NEW", fetchedSessionDetails.get(0).getCheckPointStatus());
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails in project ovirt-engine by oVirt.
the class GetGlusterVolumeGeoRepSessionsQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
List<GlusterGeoRepSession> geoRepSessions = glusterGeoRepDao.getGeoRepSessions(getParameters().getId());
/*
* If master volume has sessions, update the master server names in accordance with masterBrickId in sessionDetails.
*/
if (geoRepSessions != null) {
for (GlusterGeoRepSession currentSession : geoRepSessions) {
// For each session get corresponding session details.
List<GlusterGeoRepSessionDetails> geoRepSessionDetails = glusterGeoRepDao.getGeoRepSessionDetails(currentSession.getId());
/*
* Session details could be null, if they are not yet synced. possible if session detail command failed for some unexpected reason
* such as network failure even though the sessions in the cluster are synced(sessionListCommand)
*/
if (geoRepSessionDetails == null) {
continue;
}
/*
* If non null session detail, set masterBrick servername in accordance with that in brick
* as obtained by using masterbrickId
*/
for (GlusterGeoRepSessionDetails currentDetail : geoRepSessionDetails) {
if (currentDetail == null) {
continue;
}
Guid currentMasterBrickId = currentDetail.getMasterBrickId();
if (currentMasterBrickId == null) {
continue;
}
GlusterBrickEntity currentBrick = glusterBrickDao.getById(currentMasterBrickId);
if (currentBrick != null) {
currentDetail.setMasterBrickHostName(currentBrick.getServerName());
}
}
/*
* Finally set session details to the current session
*/
currentSession.setSessionDetails((ArrayList<GlusterGeoRepSessionDetails>) geoRepSessionDetails);
}
}
getQueryReturnValue().setReturnValue(geoRepSessions);
}
Aggregations