use of com.emc.storageos.plugins.metering.smis.SMIPluginException in project coprhd-controller by CoprHD.
the class VolumeProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws SMIPluginException {
long timeinMilis;
try {
timeinMilis = (Long) keyMap.get(Constants._TimeCollected);
CIMArgument<?>[] outputArguments = (CIMArgument<?>[]) resultObj;
@SuppressWarnings("unchecked") List<Stat> metricsObjList = (List<Stat>) keyMap.get(Constants._Stats);
DbClient dbClient = (DbClient) keyMap.get(Constants.dbClient);
if ((null == outputArguments[0]) || ((String[]) outputArguments[0].getValue()).length == 0) {
_logger.warn("Empty Statistics response returned from Provider");
return;
}
String[] volumes = ((String[]) outputArguments[0].getValue())[0].split("\n");
List<String> metricSequence = (List<String>) keyMap.get(Constants.STORAGEOS_VOLUME_MANIFEST);
_logger.debug("volume metricNames Sequence {}", metricSequence);
for (String volume : volumes) {
if (volume.isEmpty()) {
_logger.debug("Empty Volume returned as part of Statistics Response");
continue;
}
if (null != metricSequence && !metricSequence.isEmpty()) {
addMetricstoMetricsObject(keyMap, volume, metricsObjList, timeinMilis, metricSequence, dbClient);
} else {
_logger.error("failed processing Volume Metric values as metric sequence is null.");
}
}
_zeroRecordGenerator.identifyRecordstobeZeroed(keyMap, metricsObjList, Volume.class);
} catch (Exception e) {
_logger.error("Failed while extracting Read & WriteIOs for Volumes : ", e);
}
resultObj = null;
}
use of com.emc.storageos.plugins.metering.smis.SMIPluginException in project coprhd-controller by CoprHD.
the class ConnectionManagerUtils method allowReaping.
public void allowReaping(Object profile, Object client) throws BaseCollectionException {
AccessProfile accessProfile = (AccessProfile) profile;
DbClient dbClient = (DbClient) client;
try {
final CIMConnectionFactory connectionFactory = (CIMConnectionFactory) accessProfile.getCimConnectionFactory();
StorageSystem storageSystem = dbClient.queryObject(StorageSystem.class, accessProfile.getSystemId());
connectionFactory.unsetKeepAliveForConnection(storageSystem);
} catch (final IllegalStateException ex) {
log.error("Not able to get CIMOM Client instance for ip {} due to ", accessProfile.getIpAddress(), ex);
throw new SMIPluginException(SMIPluginException.ERRORCODE_NO_WBEMCLIENT, ex.fillInStackTrace(), ex.getMessage());
}
}
Aggregations