Interface ClusterState.FeatureAware

All Known Subinterfaces:
ClusterState.Custom, Metadata.Custom, PersistentTaskParams
All Known Implementing Classes:
ComponentTemplateMetadata, ComposableIndexTemplateMetadata, DataStreamMetadata, IndexGraveyard, IngestMetadata, OpenSearchNodeCommand.UnknownMetadataCustom, PersistentTasksCustomMetadata, RepositoriesMetadata, RepositoryCleanupInProgress, RestoreInProgress, ScriptMetadata, SnapshotDeletionsInProgress, SnapshotsInProgress
Enclosing class:
ClusterState

public static interface ClusterState.FeatureAware
An interface that implementors use when a class requires a client to maybe have a feature.
Opensearch.internal:
  • Method Details

    • getRequiredFeature

      default Optional<String> getRequiredFeature()
      An optional feature that is required for the client to have.
      Returns:
      an empty optional if no feature is required otherwise a string representing the required feature
    • shouldSerialize

      static <T extends VersionedNamedWriteable & ClusterState.FeatureAware> boolean shouldSerialize(StreamOutput out, T custom)
      Tests whether the custom should be serialized. The criterion is that the output stream must be at least the minimum supported version of the custom.

      That is, we only serialize customs to clients than can understand the custom based on the version of the client.

      Type Parameters:
      T - the type of the custom
      Parameters:
      out - the output stream
      custom - the custom to serialize
      Returns:
      true if the custom should be serialized and false otherwise