use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession in project ovirt-engine by oVirt.
the class GeoRepSessionCommandTest method getGeoRepSession.
protected GlusterGeoRepSession getGeoRepSession(Guid gSessionId, GeoRepSessionStatus status) {
GlusterGeoRepSession session = new GlusterGeoRepSession();
session.setStatus(status);
session.setId(gSessionId);
return session;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession in project ovirt-engine by oVirt.
the class GlusterVolumeGeoRepStatus method getSession.
protected GlusterGeoRepSession getSession(String masterVolumeName, Map<String, Object> innerMap) {
GlusterGeoRepSession geoRepSession = new GlusterGeoRepSession();
// sessionKey in the form - the uuid is the gluster server uuid on master
// <sessionKey>11ae7a03-e793-4270-8fc4-b42def8b3051:ssh://192.168.122.14::slave2:bd52ddf1-9659-4168-8197-c62e9f3e855c</sessionKey>
String sessionKey = (String) innerMap.get(SESSION_KEY);
String[] sessSplit = sessionKey.split("([://]+)");
// Older gluster versions doesn't have slave volume ID in the sessionKey, it is added in Glusterfs 3.7.12
String slaveNode = sessSplit[2];
if (slaveNode.contains("@")) {
String[] hostComponents = slaveNode.split("@");
slaveNode = hostComponents[hostComponents.length - 1];
geoRepSession.setUserName(hostComponents[0]);
}
String slaveVolume = (String) innerMap.get(REMOTE_VOL_NAME);
geoRepSession.setSlaveHostName(slaveNode);
geoRepSession.setSlaveVolumeName(slaveVolume);
geoRepSession.setSessionKey(sessionKey);
geoRepSession.setMasterVolumeName(masterVolumeName);
return geoRepSession;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession in project ovirt-engine by oVirt.
the class GlusterStorageDomainDRSyncJob method syncData.
@OnTimerMethodAnnotation("syncData")
public void syncData(String storageDomainId, String geoRepSessionId) {
try {
// Get storage domain and georep session
StorageDomain storageDomain = storageDomainDao.get(new Guid(storageDomainId));
if (storageDomain == null) {
log.error("No storage domain found for id '{}'", storageDomainId);
return;
}
GlusterGeoRepSession session = geoRepDao.getById(new Guid(geoRepSessionId));
if (session == null) {
log.error("No geo-replication session found for id '{}'", geoRepSessionId);
return;
}
backend.runInternalAction(ActionType.GlusterStorageSync, new GlusterStorageSyncCommandParameters(storageDomain.getId(), session.getId()), ExecutionHandler.createInternalJobContext());
} catch (Exception e) {
log.error("Error running dr sync", e);
}
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession in project ovirt-engine by oVirt.
the class GlusterGeoRepDaoTest method testSave.
@Test
public void testSave() {
GlusterGeoRepSession newSession = getGlusterGeoRepSession();
dao.save(newSession);
GlusterGeoRepSession session = dao.getById(newSession.getId());
assertEquals(newSession, session);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession in project ovirt-engine by oVirt.
the class GlusterGeoRepDaoTest method testGetBySlaveHostAndVolume.
@Test
public void testGetBySlaveHostAndVolume() {
GlusterGeoRepSession session = dao.getGeoRepSession(FixturesTool.GLUSTER_VOLUME_UUID1, new Guid("44f645f6-3fe9-4b35-a30c-be0d1a835ea8"), "slave-replica");
assertNotNull(session);
assertEquals(FixturesTool.GLUSTER_GEOREP_SESSION_ID, session.getId());
}
Aggregations