Search in sources :

Example 1 with GlusterVolumeGeoRepSessionConfigParameters

use of org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionConfigParameters in project ovirt-engine by oVirt.

the class GlusterStorageGeoRepSyncInternalCommand method executeCommand.

@Override
protected void executeCommand() {
    if (getSession().getStatus() != GeoRepSessionStatus.ACTIVE) {
        // Start geo-replication
        Future<ActionReturnValue> geoRepCmd = commandCoordinatorUtil.executeAsyncCommand(ActionType.StartGlusterVolumeGeoRep, new GlusterVolumeGeoRepSessionParameters(getSession().getMasterVolumeId(), getSession().getId()), cloneContext());
        ActionReturnValue result;
        try {
            result = geoRepCmd.get();
            if (!result.getSucceeded()) {
                propagateFailure(result);
                return;
            }
        } catch (InterruptedException | ExecutionException e) {
            log.error("Exception", e);
            return;
        }
    }
    // checkpoint the replication session
    GlusterVolumeGeoRepSessionConfigParameters configParams = new GlusterVolumeGeoRepSessionConfigParameters(getSession().getMasterVolumeId(), getSession().getId(), GlusterConstants.GEOREP_CHECKPOINT_OPTION, GlusterConstants.GEOREP_CHECKPOINT_VALUE);
    ActionReturnValue result = runInternalAction(ActionType.SetGeoRepConfig, configParams);
    if (!result.getSucceeded()) {
        propagateFailure(result);
        return;
    }
    setSucceeded(true);
}
Also used : GlusterVolumeGeoRepSessionConfigParameters(org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionConfigParameters) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) GlusterVolumeGeoRepSessionParameters(org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

ExecutionException (java.util.concurrent.ExecutionException)1 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 GlusterVolumeGeoRepSessionConfigParameters (org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionConfigParameters)1 GlusterVolumeGeoRepSessionParameters (org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters)1