use of org.janusgraph.diskstorage.util.MetricInstrumentedIndexProvider in project janusgraph by JanusGraph.
the class Backend method getIndexes.
private static Map<String, IndexProvider> getIndexes(Configuration config) {
Set<String> containedIndexNamespaces = config.getContainedNamespaces(INDEX_NS);
Map<String, IndexProvider> indexesMap = new HashMap<>(containedIndexNamespaces.size());
for (String index : containedIndexNamespaces) {
Preconditions.checkArgument(StringUtils.isNotBlank(index), "Invalid index name [%s]", index);
log.info("Configuring index [{}]", index);
IndexProvider provider = getImplementationClass(config.restrictTo(index), config.get(INDEX_BACKEND, index), StandardIndexProvider.getAllProviderClasses());
Preconditions.checkNotNull(provider);
if (config.get(BASIC_METRICS)) {
provider = new MetricInstrumentedIndexProvider(provider, METRICS_INDEX_PROVIDER_NAME + "." + index);
}
indexesMap.put(index, provider);
}
return Collections.unmodifiableMap(indexesMap);
}
Aggregations