Search in sources :

Example 16 with UnManagedVolumeRestRep

use of com.emc.storageos.model.block.UnManagedVolumeRestRep in project coprhd-controller by CoprHD.

the class IngestUnexportedUnmanagedVolumesService method execute.

@Override
public void execute() throws Exception {
    List<UnManagedVolumeRestRep> unmanagedVolumes = execute(new GetUnmanagedVolumes(storageSystem, virtualPool));
    if (ingestionMethod == null || ingestionMethod.isEmpty()) {
        ingestionMethod = IngestionMethodEnum.FULL.toString();
    }
    execute(new IngestUnexportedUnmanagedVolumes(virtualPool, virtualArray, project, uris(volumeIds), ingestionMethod));
    // Requery and produce a log of what was ingested or not
    int failed = execute(new GetUnmanagedVolumes(storageSystem, virtualPool)).size();
    logInfo("ingest.unexported.unmanaged.volume.service.ingested", unmanagedVolumes.size() - failed);
    logInfo("ingest.unexported.unmanaged.volume.service.skipped", failed);
}
Also used : GetUnmanagedVolumes(com.emc.sa.service.vipr.block.tasks.GetUnmanagedVolumes) IngestUnexportedUnmanagedVolumes(com.emc.sa.service.vipr.block.tasks.IngestUnexportedUnmanagedVolumes) UnManagedVolumeRestRep(com.emc.storageos.model.block.UnManagedVolumeRestRep)

Example 17 with UnManagedVolumeRestRep

use of com.emc.storageos.model.block.UnManagedVolumeRestRep in project coprhd-controller by CoprHD.

the class IngestExportedUnmanagedVolumes method executeChunks.

private Tasks<UnManagedVolumeRestRep> executeChunks(VolumeExportIngestParam ingest) {
    Tasks<UnManagedVolumeRestRep> results = new Tasks<UnManagedVolumeRestRep>(getClient().auth().getClient(), null, UnManagedVolumeRestRep.class);
    int i = 0;
    Iterator<URI> ids = unmanagedVolumeIds.iterator();
    while (ids.hasNext()) {
        i++;
        URI id = ids.next();
        ingest.getUnManagedVolumes().add(id);
        if (i == INGEST_CHUNK_SIZE || !ids.hasNext()) {
            Tasks<UnManagedVolumeRestRep> currentChunk = ingestVolumes(ingest);
            results.getTasks().addAll(currentChunk.getTasks());
            processBatch(currentChunk, i);
            ingest.getUnManagedVolumes().clear();
            i = 0;
        }
    }
    return results;
}
Also used : WaitForTasks(com.emc.sa.service.vipr.tasks.WaitForTasks) Tasks(com.emc.vipr.client.Tasks) UnManagedVolumeRestRep(com.emc.storageos.model.block.UnManagedVolumeRestRep) URI(java.net.URI)

Example 18 with UnManagedVolumeRestRep

use of com.emc.storageos.model.block.UnManagedVolumeRestRep in project coprhd-controller by CoprHD.

the class IngestUnexportedUnmanagedVolumes method executeChunks.

private Tasks<UnManagedVolumeRestRep> executeChunks(VolumeIngest ingest) {
    Tasks<UnManagedVolumeRestRep> results = null;
    int i = 0;
    for (Iterator<URI> ids = unmanagedVolumeIds.iterator(); ids.hasNext(); ) {
        i++;
        URI id = ids.next();
        ingest.getUnManagedVolumes().add(id);
        if (i == INGEST_CHUNK_SIZE || !ids.hasNext()) {
            Tasks<UnManagedVolumeRestRep> currentChunk = ingestVolumes(ingest);
            if (results == null) {
                results = currentChunk;
            } else {
                results.getTasks().addAll(currentChunk.getTasks());
            }
            ingest.getUnManagedVolumes().clear();
            i = 0;
        }
    }
    return results;
}
Also used : UnManagedVolumeRestRep(com.emc.storageos.model.block.UnManagedVolumeRestRep) URI(java.net.URI)

Aggregations

UnManagedVolumeRestRep (com.emc.storageos.model.block.UnManagedVolumeRestRep)18 URI (java.net.URI)9 ArrayList (java.util.ArrayList)8 Asset (com.emc.sa.asset.annotation.Asset)6 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)6 Volume (com.emc.storageos.db.client.model.Volume)6 Test (org.junit.Test)6 Ignore (org.junit.Ignore)5 AssetOption (com.emc.vipr.model.catalog.AssetOption)4 StringComparator (com.emc.sa.util.StringComparator)2 GetMobilityGroupClusters (com.emc.sa.service.vipr.block.tasks.GetMobilityGroupClusters)1 GetMobilityGroupHosts (com.emc.sa.service.vipr.block.tasks.GetMobilityGroupHosts)1 GetUnmanagedVolumes (com.emc.sa.service.vipr.block.tasks.GetUnmanagedVolumes)1 GetUnmanagedVolumesByHostOrCluster (com.emc.sa.service.vipr.block.tasks.GetUnmanagedVolumesByHostOrCluster)1 IngestExportedUnmanagedVolumes (com.emc.sa.service.vipr.block.tasks.IngestExportedUnmanagedVolumes)1 IngestUnexportedUnmanagedVolumes (com.emc.sa.service.vipr.block.tasks.IngestUnexportedUnmanagedVolumes)1 WaitForTasks (com.emc.sa.service.vipr.tasks.WaitForTasks)1 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 StringMapAdapter (com.emc.storageos.model.adapters.StringMapAdapter)1 StringSetMapAdapter (com.emc.storageos.model.adapters.StringSetMapAdapter)1