java.lang.Object
org.elasticsearch.common.util.FeatureFlag
A utility class for registering feature flags in Elasticsearch code.
Typical usage:
Typical usage:
{ public static final FeatureFlag XYZZY_FEATURE_FLAG = new FeatureFlag("xyzzy"); // ... if (XYZZY_FEATURE_FLAG.isEnabled()) { addRestHandlers(); registerSettings(); // etc } }
The feature flag will be enabled automatically in all snapshot
builds.
The feature flag can be enabled in release builds by setting the system property "es.{name}_feature_flag_enabled" to true
(e.g. -Des.xyzzy_feature_flag_enabled=true
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
static FeatureFlag
legacyRegisteredFlag
(String name) Deprecated.toString()
-
Constructor Details
-
FeatureFlag
-
-
Method Details
-
legacyRegisteredFlag
Deprecated.UseFeatureFlag(String)
insteadThis method exists to register feature flags that use the old{name}_feature_flag_registered
naming for their system property, instead of the preferred{name}_feature_flag_enabled
name. It exists so that old style feature flag implementations can be converted to use this utility class without changing the name of their system property (which would affect consumers of the feature). -
isEnabled
public boolean isEnabled() -
toString
-
FeatureFlag(String)
instead