Search in sources :

Example 16 with UnManagedConsistencyGroup

use of com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedConsistencyGroup in project coprhd-controller by CoprHD.

the class BlockVolumeIngestionContext method commit.

/*
     * (non-Javadoc)
     * 
     * @see com.emc.storageos.api.service.impl.resource.blockingestorchestration.context.VolumeIngestionContext#commit()
     */
@Override
public void commit() {
    for (UnManagedConsistencyGroup umcg : getUmCGObjectsToUpdate()) {
        if (umcg.getInactive()) {
            _logger.info("Deleting UnManagedConsistencyGroup {} (hash {})", umcg.forDisplay(), umcg.hashCode());
        } else {
            _logger.info("Updating UnManagedConsistencyGroup {} (hash {})", umcg.forDisplay(), umcg.hashCode());
        }
        _dbClient.updateObject(umcg);
    }
    for (BlockConsistencyGroup bcg : getCGObjectsToCreateMap().values()) {
        _logger.info("Creating BlockConsistencyGroup {} (hash {})", bcg.forDisplay(), bcg.hashCode());
        _dbClient.createObject(bcg);
    }
}
Also used : UnManagedConsistencyGroup(com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedConsistencyGroup) BlockConsistencyGroup(com.emc.storageos.db.client.model.BlockConsistencyGroup)

Example 17 with UnManagedConsistencyGroup

use of com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedConsistencyGroup in project coprhd-controller by CoprHD.

the class VplexVolumeIngestionContext method commit.

/*
     * (non-Javadoc)
     *
     * @see com.emc.storageos.api.service.impl.resource.blockingestorchestration.context.VolumeIngestionContext#commit()
     */
@Override
public void commit() {
    _logger.info("persisting VPLEX backend for virtual volume " + getUnmanagedVolume().forDisplay());
    setFlagsAndUpdateExportMasks();
    createVplexMirrorObjects();
    _dbClient.createObject(getCreatedVplexMirrors());
    _dbClient.createObject(getCreatedSnapshotMap().values());
    // commit the basic IngestionRequestContext collections
    for (BlockObject bo : getObjectsIngestedByExportProcessing()) {
        _logger.info("Creating BlockObject {} (hash {})", bo.forDisplay(), bo.hashCode());
        _dbClient.createObject(bo);
    }
    for (BlockObject bo : getBlockObjectsToBeCreatedMap().values()) {
        _logger.info("Creating BlockObject {} (hash {})", bo.forDisplay(), bo.hashCode());
        _dbClient.createObject(bo);
    }
    for (Set<DataObject> createdObjects : getDataObjectsToBeCreatedMap().values()) {
        if (createdObjects != null && !createdObjects.isEmpty()) {
            for (DataObject dob : createdObjects) {
                _logger.info("Creating DataObject {} (hash {})", dob.forDisplay(), dob.hashCode());
                _dbClient.createObject(dob);
            }
        }
    }
    for (Set<DataObject> updatedObjects : getDataObjectsToBeUpdatedMap().values()) {
        if (updatedObjects != null && !updatedObjects.isEmpty()) {
            for (DataObject dob : updatedObjects) {
                if (dob.getInactive()) {
                    _logger.info("Deleting DataObject {} (hash {})", dob.forDisplay(), dob.hashCode());
                } else {
                    _logger.info("Updating DataObject {} (hash {})", dob.forDisplay(), dob.hashCode());
                }
                _dbClient.updateObject(dob);
            }
        }
    }
    for (UnManagedVolume umv : getUnManagedVolumesToBeDeleted()) {
        _logger.info("Deleting UnManagedVolume {} (hash {})", umv.forDisplay(), umv.hashCode());
        _dbClient.updateObject(umv);
    }
    for (Entry<BlockObject, ExportGroup> entry : getVplexBackendExportGroupMap().entrySet()) {
        BlockObject volume = entry.getKey();
        ExportGroup exportGroup = entry.getValue();
        ExportGroup egInDb = _dbClient.queryObject(ExportGroup.class, exportGroup.getId());
        exportGroup.addVolume(volume.getId(), ExportGroup.LUN_UNASSIGNED);
        if (null == egInDb) {
            _logger.info("Creating VPLEX backend ExportGroup {} for Volume {}", exportGroup.forDisplay(), volume.forDisplay());
            _dbClient.createObject(exportGroup);
        } else {
            _logger.info("Updating VPLEX backend ExportGroup {} for Volume {}", exportGroup.forDisplay(), volume.forDisplay());
            _dbClient.updateObject(exportGroup);
        }
    }
    for (UnManagedConsistencyGroup umcg : getUmCGObjectsToUpdate()) {
        if (umcg.getInactive()) {
            _logger.info("Deleting UnManagedConsistencyGroup {} (hash {})", umcg.forDisplay(), umcg.hashCode());
        } else {
            _logger.info("Updating UnManagedConsistencyGroup {} (hash {})", umcg.forDisplay(), umcg.hashCode());
        }
        _dbClient.updateObject(umcg);
    }
    for (BlockConsistencyGroup bcg : getCGObjectsToCreateMap().values()) {
        _logger.info("Creating BlockConsistencyGroup {} (hash {})", bcg.forDisplay(), bcg.hashCode());
        _dbClient.createObject(bcg);
    }
}
Also used : ExportGroup(com.emc.storageos.db.client.model.ExportGroup) DataObject(com.emc.storageos.db.client.model.DataObject) UnManagedConsistencyGroup(com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedConsistencyGroup) UnManagedVolume(com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedVolume) BlockObject(com.emc.storageos.db.client.model.BlockObject) BlockConsistencyGroup(com.emc.storageos.db.client.model.BlockConsistencyGroup)

Aggregations

UnManagedConsistencyGroup (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedConsistencyGroup)17 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)5 UnManagedVolume (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedVolume)4 URI (java.net.URI)4 ArrayList (java.util.ArrayList)4 BlockConsistencyGroup (com.emc.storageos.db.client.model.BlockConsistencyGroup)3 BlockObject (com.emc.storageos.db.client.model.BlockObject)3 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)3 HashMap (java.util.HashMap)3 HashSet (java.util.HashSet)3 List (java.util.List)3 BlockSnapshot (com.emc.storageos.db.client.model.BlockSnapshot)2 DataObject (com.emc.storageos.db.client.model.DataObject)2 StoragePool (com.emc.storageos.db.client.model.StoragePool)2 StringSet (com.emc.storageos.db.client.model.StringSet)2 StringSetMap (com.emc.storageos.db.client.model.StringSetMap)2 Volume (com.emc.storageos.db.client.model.Volume)2 VolumeIngestionContext (com.emc.storageos.api.service.impl.resource.blockingestorchestration.context.VolumeIngestionContext)1 DiscoveredDataObject (com.emc.storageos.db.client.model.DiscoveredDataObject)1 ExportGroup (com.emc.storageos.db.client.model.ExportGroup)1