Class MetadataDataStreamsService

java.lang.Object
org.elasticsearch.cluster.metadata.MetadataDataStreamsService

public class MetadataDataStreamsService extends Object
Handles data stream modification requests.
  • Constructor Details

  • Method Details

    • modifyDataStream

      public void modifyDataStream(ProjectId projectId, ModifyDataStreamsAction.Request request, ActionListener<AcknowledgedResponse> listener)
    • setLifecycle

      public void setLifecycle(ProjectId projectId, List<String> dataStreamNames, DataStreamLifecycle lifecycle, TimeValue ackTimeout, TimeValue masterTimeout, ActionListener<AcknowledgedResponse> listener)
      Submits the task to set the lifecycle to the requested data streams.
    • removeLifecycle

      public void removeLifecycle(ProjectId projectId, List<String> dataStreamNames, TimeValue ackTimeout, TimeValue masterTimeout, ActionListener<AcknowledgedResponse> listener)
      Submits the task to remove the lifecycle from the requested data streams.
    • setDataStreamOptions

      public void setDataStreamOptions(ProjectId projectId, List<String> dataStreamNames, DataStreamOptions options, TimeValue ackTimeout, TimeValue masterTimeout, ActionListener<AcknowledgedResponse> listener)
      Submits the task to set the provided data stream options to the requested data streams.
    • removeDataStreamOptions

      public void removeDataStreamOptions(ProjectId projectId, List<String> dataStreamNames, TimeValue ackTimeout, TimeValue masterTimeout, ActionListener<AcknowledgedResponse> listener)
      Submits the task to remove the data stream options from the requested data streams.
    • setRolloverOnWrite

      public void setRolloverOnWrite(ProjectId projectId, String dataStreamName, boolean rolloverOnWrite, boolean targetFailureStore, TimeValue ackTimeout, TimeValue masterTimeout, ActionListener<AcknowledgedResponse> listener)
      Submits the task to signal that the next time this data stream receives a document, it will be rolled over.
    • setRolloverOnWrite

      public static ClusterState setRolloverOnWrite(ProjectState currentState, String dataStreamName, boolean rolloverOnWrite, boolean targetFailureStore)
      Creates an updated cluster state in which the requested data stream has the flag DataStream.rolloverOnWrite() set to the value of the parameter rolloverOnWrite
      Parameters:
      currentState - the initial project state
      dataStreamName - the name of the data stream to be updated
      rolloverOnWrite - the value of the flag
      targetFailureStore - whether this rollover targets the failure store or the backing indices
      Returns:
      the updated cluster state
    • updateSettings

      public void updateSettings(ProjectId projectId, TimeValue masterNodeTimeout, TimeValue ackTimeout, String dataStreamName, Settings settingsOverrides, boolean dryRun, ActionListener<DataStream> listener)
    • getEffectiveSettings

      public Settings getEffectiveSettings(ProjectMetadata projectMetadata, DataStream dataStream) throws IOException
      This method gets the effective settings for the given data stream. The effective settings include the combination of template settings, data stream settings overrides, and the implicit settings provide by IndexSettingsProviders.
      Parameters:
      projectMetadata - The project metadata
      dataStream - The data stream
      Returns:
      The effective settings for the data stream, which are a the combination of template settings, data stream settings overrides, and the implicit settings provide by IndexSettingsProviders
      Throws:
      IOException
    • getEffectiveSettings

      public Settings getEffectiveSettings(ProjectMetadata projectMetadata, DataStream dataStream, CompressedXContent mappingOverrides) throws IOException
      This method gets the effective settings for the given data stream, using the passed-in mappingOverrides rather than the data stream's mapping overrides. This can be used to evaluate the validity of the settings and mappings before applying the mapping overrides to the data stream. The effective settings include the combination of template settings, data stream settings overrides, and the implicit settings provide by IndexSettingsProviders.
      Parameters:
      projectMetadata - The project metadata
      dataStream - The data stream
      mappingOverrides - The mapping overrides to be used in place of the mapping overrides on the data stream currently
      Returns:
      The effective settings for the data stream, which are a the combination of template settings, data stream settings overrides, and the implicit settings provide by IndexSettingsProviders
      Throws:
      IOException
    • updateMappings

      public void updateMappings(ProjectId projectId, TimeValue masterNodeTimeout, TimeValue ackTimeout, String dataStreamName, CompressedXContent mappingsOverrides, boolean dryRun, ActionListener<DataStream> listener)
    • deleteDataStreams

      public static ClusterState deleteDataStreams(ProjectState projectState, Set<DataStream> dataStreams, Settings settings)
      Removes the given data stream and their backing indices from the Project State.
      Parameters:
      projectState - The project state
      dataStreams - The data streams to remove
      settings - The settings
      Returns:
      The updated Project State