ConfigurationDao.lastFetchTime = currentTime;
}
private Configuration loadConfiguration() {
try {
Configuration config = new Configuration();
RangeSlicesQuery<String, String, String> rangeSlicesQuery = HFactory
.createRangeSlicesQuery(this.getKeyspace(), StringSerializer.get(),
StringSerializer.get(), StringSerializer.get());
rangeSlicesQuery.setColumnFamily(COLUMN_FAMILY);
rangeSlicesQuery.setKeys("", "");
rangeSlicesQuery.setRange("", "", false, 2000); // MAX_COLUMNS
rangeSlicesQuery.setRowCount(2000); // MAX_ROWS
QueryResult<OrderedRows<String, String, String>> result = rangeSlicesQuery.execute();
OrderedRows<String, String, String> orderedRows = result.get();
for (Row<String, String, String> r : orderedRows) {
ColumnSlice<String, String> slice = r.getColumnSlice();
String indexName = r.getKey();
Map<String, String> indexProperties = new HashMap<String, String>();
for (HColumn<String, String> column : slice.getColumns()) {
if(logger.isDebugEnabled()) {
logger.debug("got " + COLUMN_FAMILY + "['" + r.getKey()
+ "']" + "['" + column.getName() + "'] = '"
+ column.getValue() + "';");
}
indexProperties.put(column.getName(), column.getValue());
}
config.addIndex(indexName, indexProperties);
}
return config;
} catch (Exception ex) {
throw new RuntimeException("Failed to load indexing configuration: " + KEYSPACE + ":" + COLUMN_FAMILY, ex);
}