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);
}
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;
}
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;
}
Aggregations