-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for feature flags in opensearch.yml
This change introduces a static store "settings" in FeatureFlags.java file to enable isEnabled method to fetch flag settings defined in opensearch.yml. Signed-off-by: Nagaraj Tantri <[email protected]>
- Loading branch information
Showing
9 changed files
with
164 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
server/src/main/java/org/opensearch/common/settings/FeatureFlagSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* 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.settings; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
import org.opensearch.common.settings.Setting.Property; | ||
import org.opensearch.common.util.FeatureFlags; | ||
|
||
/** | ||
* Encapsulates all valid feature flag level settings. | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public class FeatureFlagSettings extends AbstractScopedSettings { | ||
|
||
protected FeatureFlagSettings( | ||
Settings settings, | ||
Set<Setting<?>> settingsSet, | ||
Set<SettingUpgrader<?>> settingUpgraders, | ||
Property scope | ||
) { | ||
super(settings, settingsSet, settingUpgraders, scope); | ||
} | ||
|
||
public static final Set<Setting<?>> BUILT_IN_FEATURE_FLAGS = Collections.unmodifiableSet( | ||
new HashSet<>( | ||
Arrays.asList( | ||
FeatureFlags.REPLICATION_TYPE_SETTING, | ||
FeatureFlags.REMOTE_STORE_SETTING, | ||
FeatureFlags.SEARCHABLE_SNAPSHOT_SETTING, | ||
FeatureFlags.EXTENSIONS_SETTING | ||
) | ||
) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.