forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
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 (opensearch-project…
…#4959) 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]> (cherry picked from commit 241bd42)
- Loading branch information
Showing
8 changed files
with
322 additions
and
30 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
223 changes: 194 additions & 29 deletions
223
...src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
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