-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
FeatureFlags.java
40 lines (35 loc) · 1.51 KB
/
FeatureFlags.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* 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.util;
/**
* Utility class to manage feature flags. Feature flags are system properties that must be set on the JVM.
* These are used to gate the visibility/availability of incomplete features. Fore more information, see
* https://featureflags.io/feature-flag-introduction/
*
* @opensearch.internal
*/
public class FeatureFlags {
/**
* Gates the visibility of the index setting that allows changing of replication type.
* Once the feature is ready for production release, this feature flag can be removed.
*/
public static final String REPLICATION_TYPE = "opensearch.experimental.feature.replication_type.enabled";
/**
* Gates the visibility of the index setting that allows persisting data to remote store along with local disk.
* Once the feature is ready for production release, this feature flag can be removed.
*/
public static final String REMOTE_STORE = "opensearch.experimental.feature.remote_store.enabled";
/**
* Used to test feature flags whose values are expected to be booleans.
* This method returns true if the value is "true" (case-insensitive),
* and false otherwise.
*/
public static boolean isEnabled(String featureFlagName) {
return "true".equalsIgnoreCase(System.getProperty(featureFlagName));
}
}