ArgumentChecker.notNull(getHtsMaster(), "historical timeseries master");
ArgumentChecker.notNull(getRedisConnector(), "redis connector");
}
private void updateTimeSeries(ExternalId externalId, Map<String, Double> lkv, AtomicLong tsCounter) {
HistoricalTimeSeriesMasterUtils htsMaster = new HistoricalTimeSeriesMasterUtils(getHtsMaster());
LocalDate today = LocalDate.now(OpenGammaClock.getInstance());
for (Entry<String, Double> lkvEntry : lkv.entrySet()) {
String fieldName = lkvEntry.getKey();
final Double value = lkvEntry.getValue();
if (haveDataFieldBlackList() && _dataFieldBlackList.getBlackList().contains(fieldName.toUpperCase())) {
continue;
}
if (value != null) {
String dataField = makeDataField(fieldName);
String dataProvider = externalId.getScheme().getName();
if ("SURF".equals(dataProvider.toUpperCase())) {
dataProvider = "TULLETTPREBON";
}
s_logger.debug("updating ts {}:{}/{}/{}/{} with {}:{}",
new Object[] {externalId, getDataSource(), dataProvider, dataField, getObservationTime(), today, value});
htsMaster.writeTimeSeriesPoint(makeDescription(externalId, dataField), getDataSource(), dataProvider,
dataField, getObservationTime(), ExternalIdBundle.of(externalId), today, value);
tsCounter.getAndAdd(1);
}
}
}