@Override
public void storeIncomingStatistics(String guiPath, String accountName, Long timeperiod, String value, ValueType valueType, UnitType unitType, Long count) {
Double valueDouble = LiveStatisticsUtil.parseDouble(value);
long hoursSince1970 = timeperiod / 240;
Bucket myBucket = null;
try {
myBucket = riakClient.fetchBucket(accountName + ";" + hoursSince1970).execute();
BasicMetricHour storedMetricHour = myBucket.fetch("" + guiPath, BasicMetricHour.class).execute();
if (storedMetricHour == null) {
storedMetricHour = new BasicMetricHour(guiPath, accountName, hoursSince1970, valueType.toString(), unitType.toString());
}
storedMetricHour.addStatistic(new BasicLiveStatistics(guiPath, accountName, timeperiod, valueDouble, valueType.value(), unitType.value(), count));
myBucket.store("" + guiPath, storedMetricHour).execute();
} catch (RiakRetryFailedException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}