Search in sources :

Example 1 with MetricInstrumentedIndexProvider

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);
}
Also used : MetricInstrumentedIndexProvider(org.janusgraph.diskstorage.util.MetricInstrumentedIndexProvider) IndexProvider(org.janusgraph.diskstorage.indexing.IndexProvider) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) MetricInstrumentedIndexProvider(org.janusgraph.diskstorage.util.MetricInstrumentedIndexProvider)

Aggregations

HashMap (java.util.HashMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 IndexProvider (org.janusgraph.diskstorage.indexing.IndexProvider)1 MetricInstrumentedIndexProvider (org.janusgraph.diskstorage.util.MetricInstrumentedIndexProvider)1