use of com.emc.nas.vnxfile.xmlapi.VolumeSetStats.Sample in project coprhd-controller by CoprHD.
the class VNXVolumeStatsProcessor method processVolumeSampleList.
/**
* Process the each Volume sample list and inject
* bwIn, bwOut for each fileshare. We also have a one-to-one
* mapping between volume to Fileshare.
*
* @param sampleList : List of Sample objects of a volume
* @param keyMap : keyMap
* @param volFileMap : Volume-to-Fileshare Mapping
* @param statsList : StatsList to update.
*/
private void processVolumeSampleList(List<Sample> sampleList, Map<String, Object> keyMap, Map<String, String> volFileMap, List<Stat> statsList) {
Iterator<Sample> itemItr = sampleList.iterator();
while (itemItr.hasNext()) {
Sample volSample = itemItr.next();
List<Item> volItems = volSample.getItem();
Iterator<Item> volItemsItr = volItems.iterator();
while (volItemsItr.hasNext()) {
Item volItem = volItemsItr.next();
if (volFileMap.containsKey(volItem.getVolume())) {
String fileSystem = volFileMap.get(volItem.getVolume());
// No filesystem found for volume then skip
if (null != fileSystem) {
injectBWInOut(fileSystem, keyMap, volItem, statsList);
}
}
}
}
}
use of com.emc.nas.vnxfile.xmlapi.VolumeSetStats.Sample 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();
}
}
Aggregations