Class DataStream.Builder

All Implemented Interfaces:
WithJson<DataStream.Builder>, ObjectBuilder<DataStream>
Enclosing class:
DataStream

public static class DataStream.Builder extends WithJsonObjectBuilderBase<DataStream.Builder> implements ObjectBuilder<DataStream>
Builder for DataStream.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • meta

      public final DataStream.Builder meta(Map<String,JsonData> map)
      Custom metadata for the stream, copied from the _meta object of the stream’s matching index template. If empty, the response omits this property.

      API name: _meta

      Adds all entries of map to meta.

    • meta

      public final DataStream.Builder meta(String key, JsonData value)
      Custom metadata for the stream, copied from the _meta object of the stream’s matching index template. If empty, the response omits this property.

      API name: _meta

      Adds an entry to meta.

    • allowCustomRouting

      public final DataStream.Builder allowCustomRouting(@Nullable Boolean value)
      If true, the data stream allows custom routing on write request.

      API name: allow_custom_routing

    • generation

      public final DataStream.Builder generation(int value)
      Required - Current generation for the data stream. This number acts as a cumulative count of the stream’s rollovers, starting at 1.

      API name: generation

    • hidden

      public final DataStream.Builder hidden(boolean value)
      Required - If true, the data stream is hidden.

      API name: hidden

    • ilmPolicy

      public final DataStream.Builder ilmPolicy(@Nullable String value)
      Name of the current ILM lifecycle policy in the stream’s matching index template. This lifecycle policy is set in the index.lifecycle.name setting. If the template does not include a lifecycle policy, this property is not included in the response. NOTE: A data stream’s backing indices may be assigned different lifecycle policies. To retrieve the lifecycle policy for individual backing indices, use the get index settings API.

      API name: ilm_policy

    • indices

      public final DataStream.Builder indices(List<DataStreamIndex> list)
      Required - Array of objects containing information about the data stream’s backing indices. The last item in this array contains information about the stream’s current write index.

      API name: indices

      Adds all elements of list to indices.

    • indices

      public final DataStream.Builder indices(DataStreamIndex value, DataStreamIndex... values)
      Required - Array of objects containing information about the data stream’s backing indices. The last item in this array contains information about the stream’s current write index.

      API name: indices

      Adds one or more values to indices.

    • indices

      Required - Array of objects containing information about the data stream’s backing indices. The last item in this array contains information about the stream’s current write index.

      API name: indices

      Adds a value to indices using a builder lambda.

    • lifecycle

      public final DataStream.Builder lifecycle(@Nullable DataStreamLifecycleWithRollover value)
      Contains the configuration for the data lifecycle management of this data stream.

      API name: lifecycle

    • lifecycle

      Contains the configuration for the data lifecycle management of this data stream.

      API name: lifecycle

    • name

      public final DataStream.Builder name(String value)
      Required - Name of the data stream.

      API name: name

    • replicated

      public final DataStream.Builder replicated(@Nullable Boolean value)
      If true, the data stream is created and managed by cross-cluster replication and the local cluster can not write into this data stream or change its mappings.

      API name: replicated

    • status

      public final DataStream.Builder status(HealthStatus value)
      Required - Health status of the data stream. This health status is based on the state of the primary and replica shards of the stream’s backing indices.

      API name: status

    • system

      public final DataStream.Builder system(@Nullable Boolean value)
      If true, the data stream is created and managed by an Elastic stack component and cannot be modified through normal user interaction.

      API name: system

    • template

      public final DataStream.Builder template(String value)
      Required - Name of the index template used to create the data stream’s backing indices. The template’s index pattern must match the name of this data stream.

      API name: template

    • timestampField

      public final DataStream.Builder timestampField(DataStreamTimestampField value)
      Required - Information about the @timestamp field in the data stream.

      API name: timestamp_field

    • timestampField

      Required - Information about the @timestamp field in the data stream.

      API name: timestamp_field

    • self

      protected DataStream.Builder self()
      Specified by:
      self in class WithJsonObjectBuilderBase<DataStream.Builder>
    • build

      public DataStream build()
      Builds a DataStream.
      Specified by:
      build in interface ObjectBuilder<DataStream>
      Throws:
      NullPointerException - if some of the required fields are null.