Search in sources :

Example 1 with VolumeSetStats

use of com.emc.nas.vnxfile.xmlapi.VolumeSetStats in project coprhd-controller by CoprHD.

the class VNXVolumeStatsProcessor method processResult.

@SuppressWarnings("unchecked")
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
    final PostMethod result = (PostMethod) resultObj;
    _logger.info("processing volumeStats response" + resultObj);
    try {
        ResponsePacket responsePacket = (ResponsePacket) _unmarshaller.unmarshal(result.getResponseBodyAsStream());
        List<Object> volumeStats = getQueryStatsResponse(responsePacket);
        Iterator<Object> iterator = volumeStats.iterator();
        Map<String, String> volFileMap = (Map<String, String>) keyMap.get(VNXFileConstants.VOLFILESHAREMAP);
        List<Stat> statsList = (List<Stat>) keyMap.get(VNXFileConstants.STATS);
        // and proceed with rest of the Mover stats.
        while (iterator.hasNext()) {
            VolumeSetStats volStats = (VolumeSetStats) iterator.next();
            List<Sample> sampleList = volStats.getSample();
            processVolumeSampleList(sampleList, keyMap, volFileMap, statsList);
        }
    } catch (final Exception ex) {
        _logger.error("Exception occurred while processing the volume stats response due to {}", ex.getMessage());
    } finally {
        result.releaseConnection();
    }
}
Also used : PostMethod(org.apache.commons.httpclient.methods.PostMethod) Sample(com.emc.nas.vnxfile.xmlapi.VolumeSetStats.Sample) VolumeSetStats(com.emc.nas.vnxfile.xmlapi.VolumeSetStats) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException) Stat(com.emc.storageos.db.client.model.Stat) ResponsePacket(com.emc.nas.vnxfile.xmlapi.ResponsePacket) List(java.util.List) Map(java.util.Map)

Aggregations

ResponsePacket (com.emc.nas.vnxfile.xmlapi.ResponsePacket)1 VolumeSetStats (com.emc.nas.vnxfile.xmlapi.VolumeSetStats)1 Sample (com.emc.nas.vnxfile.xmlapi.VolumeSetStats.Sample)1 Stat (com.emc.storageos.db.client.model.Stat)1 BaseCollectionException (com.emc.storageos.plugins.BaseCollectionException)1 List (java.util.List)1 Map (java.util.Map)1 PostMethod (org.apache.commons.httpclient.methods.PostMethod)1