Class PutJobRequest.Builder

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

public static class PutJobRequest.Builder
extends RequestBase.AbstractBuilder<PutJobRequest.Builder>
implements ObjectBuilder<PutJobRequest>
Builder for PutJobRequest.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • cron

      public final PutJobRequest.Builder cron​(java.lang.String value)
      Required - A cron string which defines the intervals when the rollup job should be executed. When the interval triggers, the indexer attempts to rollup the data in the index pattern. The cron pattern is unrelated to the time interval of the data being rolled up. For example, you may wish to create hourly rollups of your document but to only run the indexer on a daily basis at midnight, as defined by the cron. The cron pattern is defined just like a Watcher cron schedule.

      API name: cron

    • groups

      public final PutJobRequest.Builder groups​(Groupings value)
      Required - Defines the grouping fields and aggregations that are defined for this rollup job. These fields will then be available later for aggregating into buckets. These aggs and fields can be used in any combination. Think of the groups configuration as defining a set of tools that can later be used in aggregations to partition the data. Unlike raw data, we have to think ahead to which fields and aggregations might be used. Rollups provide enough flexibility that you simply need to determine which fields are needed, not in what order they are needed.

      API name: groups

    • groups

      public final PutJobRequest.Builder groups​(java.util.function.Function<Groupings.Builder,​ObjectBuilder<Groupings>> fn)
      Required - Defines the grouping fields and aggregations that are defined for this rollup job. These fields will then be available later for aggregating into buckets. These aggs and fields can be used in any combination. Think of the groups configuration as defining a set of tools that can later be used in aggregations to partition the data. Unlike raw data, we have to think ahead to which fields and aggregations might be used. Rollups provide enough flexibility that you simply need to determine which fields are needed, not in what order they are needed.

      API name: groups

    • headers

      public final PutJobRequest.Builder headers​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> map)
      API name: headers

      Adds all entries of map to headers.

    • headers

      public final PutJobRequest.Builder headers​(java.lang.String key, java.util.List<java.lang.String> value)
      API name: headers

      Adds an entry to headers.

    • id

      public final PutJobRequest.Builder id​(java.lang.String value)
      Required - Identifier for the rollup job. This can be any alphanumeric string and uniquely identifies the data that is associated with the rollup job. The ID is persistent; it is stored with the rolled up data. If you create a job, let it run for a while, then delete the job, the data that the job rolled up is still be associated with this job ID. You cannot create a new job with the same ID since that could lead to problems with mismatched job configurations.

      API name: id

    • indexPattern

      public final PutJobRequest.Builder indexPattern​(java.lang.String value)
      Required - The index or index pattern to roll up. Supports wildcard-style patterns (logstash-*). The job attempts to rollup the entire index or index-pattern.

      API name: index_pattern

    • metrics

      public final PutJobRequest.Builder metrics​(java.util.List<FieldMetric> list)
      Defines the metrics to collect for each grouping tuple. By default, only the doc_counts are collected for each group. To make rollup useful, you will often add metrics like averages, mins, maxes, etc. Metrics are defined on a per-field basis and for each field you configure which metric should be collected.

      API name: metrics

      Adds all elements of list to metrics.

    • metrics

      public final PutJobRequest.Builder metrics​(FieldMetric value, FieldMetric... values)
      Defines the metrics to collect for each grouping tuple. By default, only the doc_counts are collected for each group. To make rollup useful, you will often add metrics like averages, mins, maxes, etc. Metrics are defined on a per-field basis and for each field you configure which metric should be collected.

      API name: metrics

      Adds one or more values to metrics.

    • metrics

      public final PutJobRequest.Builder metrics​(java.util.function.Function<FieldMetric.Builder,​ObjectBuilder<FieldMetric>> fn)
      Defines the metrics to collect for each grouping tuple. By default, only the doc_counts are collected for each group. To make rollup useful, you will often add metrics like averages, mins, maxes, etc. Metrics are defined on a per-field basis and for each field you configure which metric should be collected.

      API name: metrics

      Adds a value to metrics using a builder lambda.

    • pageSize

      public final PutJobRequest.Builder pageSize​(int value)
      Required - The number of bucket results that are processed on each iteration of the rollup indexer. A larger value tends to execute faster, but requires more memory during processing. This value has no effect on how the data is rolled up; it is merely used for tweaking the speed or memory cost of the indexer.

      API name: page_size

    • rollupIndex

      public final PutJobRequest.Builder rollupIndex​(java.lang.String value)
      Required - The index that contains the rollup results. The index can be shared with other rollup jobs. The data is stored so that it doesn’t interfere with unrelated jobs.

      API name: rollup_index

    • timeout

      public final PutJobRequest.Builder timeout​(@Nullable Time value)
      Time to wait for the request to complete.

      API name: timeout

    • timeout

      public final PutJobRequest.Builder timeout​(java.util.function.Function<Time.Builder,​ObjectBuilder<Time>> fn)
      Time to wait for the request to complete.

      API name: timeout

    • self

      protected PutJobRequest.Builder self()
      Specified by:
      self in class RequestBase.AbstractBuilder<PutJobRequest.Builder>
    • build

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