Search in sources :

Example 1 with DataCollectionScanJob

use of com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionScanJob in project coprhd-controller by CoprHD.

the class BlockControllerImpl method scanStorageProviders.

/**
 * {@inheritDoc}
 */
@Override
public void scanStorageProviders(AsyncTask[] tasks) throws ControllerException {
    try {
        Map<String, DataCollectionScanJob> scanJobByInterfaceType = new HashMap<String, DataCollectionScanJob>();
        for (AsyncTask task : tasks) {
            ScanTaskCompleter completer = new ScanTaskCompleter(task);
            StorageProvider provider = _dbClient.queryObject(StorageProvider.class, completer.getId());
            if (provider != null && !provider.getInactive()) {
                if (scanJobByInterfaceType.get(provider.getInterfaceType()) == null) {
                    scanJobByInterfaceType.put(provider.getInterfaceType(), new DataCollectionScanJob());
                }
                scanJobByInterfaceType.get(provider.getInterfaceType()).addCompleter(completer);
            }
        }
        for (DataCollectionScanJob job : scanJobByInterfaceType.values()) {
            _util.scheduleScanningJobs(job);
        }
    } catch (Exception e) {
        throw ClientControllerException.fatals.unableToScanSMISProviders(tasks, "BlockController", e);
    }
}
Also used : HashMap(java.util.HashMap) AsyncTask(com.emc.storageos.volumecontroller.AsyncTask) ArrayAffinityAsyncTask(com.emc.storageos.volumecontroller.ArrayAffinityAsyncTask) ScanTaskCompleter(com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.ScanTaskCompleter) StorageProvider(com.emc.storageos.db.client.model.StorageProvider) DataCollectionScanJob(com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionScanJob) InternalException(com.emc.storageos.svcs.errorhandling.resources.InternalException) DatabaseException(com.emc.storageos.db.exceptions.DatabaseException) ControllerException(com.emc.storageos.volumecontroller.ControllerException) ClientControllerException(com.emc.storageos.exceptions.ClientControllerException) RetryableDatabaseException(com.emc.storageos.db.exceptions.RetryableDatabaseException)

Aggregations

StorageProvider (com.emc.storageos.db.client.model.StorageProvider)1 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)1 RetryableDatabaseException (com.emc.storageos.db.exceptions.RetryableDatabaseException)1 ClientControllerException (com.emc.storageos.exceptions.ClientControllerException)1 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)1 ArrayAffinityAsyncTask (com.emc.storageos.volumecontroller.ArrayAffinityAsyncTask)1 AsyncTask (com.emc.storageos.volumecontroller.AsyncTask)1 ControllerException (com.emc.storageos.volumecontroller.ControllerException)1 DataCollectionScanJob (com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionScanJob)1 ScanTaskCompleter (com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.ScanTaskCompleter)1 HashMap (java.util.HashMap)1