Search in sources :

Example 1 with RetryableDatabaseException

use of com.emc.storageos.db.exceptions.RetryableDatabaseException in project coprhd-controller by CoprHD.

the class AbstractDiscoveredSystemController method queueTask.

protected void queueTask(DbClient dbClient, Class<? extends DiscoveredSystemObject> systemClazz, Dispatcher dispatcher, String methodName, Object... args) {
    final URI systemURI = (URI) args[0];
    _log.info("System {} received RMI request {}.", systemURI, methodName);
    try {
        // 1. select target device
        final DiscoveredSystemObject device = dbClient.queryObject(systemClazz, systemURI);
        final Controller controller = lookupDeviceController(device);
        // 2. queue request
        dispatcher.queue(device.getId(), device.getSystemType(), controller, methodName, args);
    } catch (RetryableDatabaseException e) {
        if (e.getServiceCode() == ServiceCode.DBSVC_CONNECTION_ERROR) {
            // netflix curator ConnectionException is not serializable
            // and thus should not be sent back to rmi client.
            _log.error("Failed to queue task due to dbsvc disconnected. Error: ", e);
            throw DatabaseException.retryables.connectionFailed();
        }
        throw e;
    }
}
Also used : DiscoveredSystemObject(com.emc.storageos.db.client.model.DiscoveredSystemObject) Controller(com.emc.storageos.Controller) URI(java.net.URI) RetryableDatabaseException(com.emc.storageos.db.exceptions.RetryableDatabaseException)

Example 2 with RetryableDatabaseException

use of com.emc.storageos.db.exceptions.RetryableDatabaseException in project coprhd-controller by CoprHD.

the class BlockControllerImpl method pauseNativeContinuousCopies.

@Override
public void pauseNativeContinuousCopies(URI storage, List<URI> mirrors, Boolean sync, String opId) throws InternalException {
    try {
        // Direct RMI call to expedite this call without any potential distribute-Q delay
        StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, storage);
        Controller controller = lookupDeviceController(storageSystem);
        BlockController blkcontroller = (BlockController) controller;
        blkcontroller.pauseNativeContinuousCopies(storage, mirrors, sync, opId);
    } catch (RetryableDatabaseException e) {
        if (e.getServiceCode() == ServiceCode.DBSVC_CONNECTION_ERROR) {
            // netflix curator ConnectionException is not serializable
            // and thus should not be sent back to rmi client.
            _log.error("Failed to queue task due to dbsvc disconnected. Error: {}", e.getMessage());
            _log.error(e.getMessage(), e);
            throw DatabaseException.retryables.connectionFailed();
        }
        throw e;
    }
}
Also used : BlockController(com.emc.storageos.volumecontroller.BlockController) Controller(com.emc.storageos.Controller) BlockController(com.emc.storageos.volumecontroller.BlockController) AbstractDiscoveredSystemController(com.emc.storageos.impl.AbstractDiscoveredSystemController) StorageSystem(com.emc.storageos.db.client.model.StorageSystem) RetryableDatabaseException(com.emc.storageos.db.exceptions.RetryableDatabaseException)

Example 3 with RetryableDatabaseException

use of com.emc.storageos.db.exceptions.RetryableDatabaseException in project coprhd-controller by CoprHD.

the class BlockControllerImpl method activateFullCopy.

@Override
public void activateFullCopy(URI storage, List<URI> fullCopy, String opId) {
    try {
        // Direct RMI call to expedite this call without any potential distribute-Q delay
        StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, storage);
        Controller controller = lookupDeviceController(storageSystem);
        BlockController blkcontroller = (BlockController) controller;
        blkcontroller.activateFullCopy(storage, fullCopy, opId);
    } catch (RetryableDatabaseException e) {
        if (e.getServiceCode() == ServiceCode.DBSVC_CONNECTION_ERROR) {
            // netflix curator ConnectionException is not serializable
            // and thus should not be sent back to rmi client.
            _log.error("Failed to queue task due to dbsvc disconnected. Error: {}", e.getMessage());
            _log.error(e.getMessage(), e);
            throw DatabaseException.retryables.connectionFailed();
        }
        throw e;
    }
}
Also used : BlockController(com.emc.storageos.volumecontroller.BlockController) Controller(com.emc.storageos.Controller) BlockController(com.emc.storageos.volumecontroller.BlockController) AbstractDiscoveredSystemController(com.emc.storageos.impl.AbstractDiscoveredSystemController) StorageSystem(com.emc.storageos.db.client.model.StorageSystem) RetryableDatabaseException(com.emc.storageos.db.exceptions.RetryableDatabaseException)

Example 4 with RetryableDatabaseException

use of com.emc.storageos.db.exceptions.RetryableDatabaseException in project coprhd-controller by CoprHD.

the class BlockControllerImpl method activateSnapshot.

@Override
public void activateSnapshot(URI storage, List<URI> snapshotList, String opId) throws InternalException {
    try {
        // Direct RMI call to expedite this call without any potential distribute-Q delay
        StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, storage);
        Controller controller = lookupDeviceController(storageSystem);
        BlockController blkcontroller = (BlockController) controller;
        blkcontroller.activateSnapshot(storage, snapshotList, opId);
    } catch (RetryableDatabaseException e) {
        if (e.getServiceCode() == ServiceCode.DBSVC_CONNECTION_ERROR) {
            // netflix curator ConnectionException is not serializable
            // and thus should not be sent back to rmi client.
            _log.error("Failed to queue task due to dbsvc disconnected. Error: {}", e.getMessage());
            _log.error(e.getMessage(), e);
            throw DatabaseException.retryables.connectionFailed();
        }
        throw e;
    }
}
Also used : BlockController(com.emc.storageos.volumecontroller.BlockController) Controller(com.emc.storageos.Controller) BlockController(com.emc.storageos.volumecontroller.BlockController) AbstractDiscoveredSystemController(com.emc.storageos.impl.AbstractDiscoveredSystemController) StorageSystem(com.emc.storageos.db.client.model.StorageSystem) RetryableDatabaseException(com.emc.storageos.db.exceptions.RetryableDatabaseException)

Example 5 with RetryableDatabaseException

use of com.emc.storageos.db.exceptions.RetryableDatabaseException in project coprhd-controller by CoprHD.

the class BlockControllerImpl method checkSyncProgress.

@Override
public Integer checkSyncProgress(URI storage, URI source, URI target, String opId) {
    try {
        StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, storage);
        Controller controller = lookupDeviceController(storageSystem);
        BlockController blkcontroller = (BlockController) controller;
        return blkcontroller.checkSyncProgress(storage, source, target, opId);
    } catch (RetryableDatabaseException e) {
        if (e.getServiceCode() == ServiceCode.DBSVC_CONNECTION_ERROR) {
            // netflix curator ConnectionException is not serializable
            // and thus should not be sent back to rmi client.
            _log.error("Failed to queue task due to dbsvc disconnected. Error: {}", e.getMessage());
            _log.error(e.getMessage(), e);
            throw DatabaseException.retryables.connectionFailed();
        }
        throw e;
    }
}
Also used : BlockController(com.emc.storageos.volumecontroller.BlockController) Controller(com.emc.storageos.Controller) BlockController(com.emc.storageos.volumecontroller.BlockController) AbstractDiscoveredSystemController(com.emc.storageos.impl.AbstractDiscoveredSystemController) StorageSystem(com.emc.storageos.db.client.model.StorageSystem) RetryableDatabaseException(com.emc.storageos.db.exceptions.RetryableDatabaseException)

Aggregations

RetryableDatabaseException (com.emc.storageos.db.exceptions.RetryableDatabaseException)6 Controller (com.emc.storageos.Controller)5 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)4 AbstractDiscoveredSystemController (com.emc.storageos.impl.AbstractDiscoveredSystemController)4 BlockController (com.emc.storageos.volumecontroller.BlockController)4 DbAuditLogRetriever (com.emc.storageos.api.service.impl.resource.utils.DbAuditLogRetriever)1 MarshallingExcetion (com.emc.storageos.api.service.impl.resource.utils.MarshallingExcetion)1 DummyDBClient (com.emc.storageos.api.service.utils.DummyDBClient)1 DiscoveredSystemObject (com.emc.storageos.db.client.model.DiscoveredSystemObject)1 AuditLogRequest (com.emc.storageos.security.audit.AuditLogRequest)1 URI (java.net.URI)1 MediaType (javax.ws.rs.core.MediaType)1 Test (org.junit.Test)1