All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opensearch.common.cache.settings.CacheSettings Maven / Gradle / Ivy

There is a newer version: 2.18.0
Show newest version
/*
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 */

package org.opensearch.common.cache.settings;

import org.opensearch.common.annotation.ExperimentalApi;
import org.opensearch.common.cache.CacheType;
import org.opensearch.common.settings.Setting;

/**
 * Settings related to cache.
 */
@ExperimentalApi
public class CacheSettings {

    /**
     * Used to store cache store name for desired cache types within OpenSearch.
     * Setting pattern: {cache_type}.store.name
     * Example: indices.request.cache.store.name
     */
    public static final Setting.AffixSetting CACHE_TYPE_STORE_NAME = Setting.suffixKeySetting(
        "store.name",
        (key) -> Setting.simpleString(key, "", Setting.Property.NodeScope)
    );

    public static Setting getConcreteStoreNameSettingForCacheType(CacheType cacheType) {
        return CACHE_TYPE_STORE_NAME.getConcreteSettingForNamespace(cacheType.getSettingPrefix());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy