Class SegmentsRecord.Builder

java.lang.Object
org.opensearch.client.util.ObjectBuilderBase
org.opensearch.client.opensearch.cat.segments.SegmentsRecord.Builder
All Implemented Interfaces:
CopyableBuilder<SegmentsRecord.Builder,SegmentsRecord>, MutableBuilder<SegmentsRecord.Builder,SegmentsRecord>, ObjectBuilder<SegmentsRecord>
Enclosing class:
SegmentsRecord

public static class SegmentsRecord.Builder extends ObjectBuilderBase implements CopyableBuilder<SegmentsRecord.Builder,SegmentsRecord>
Builder for SegmentsRecord.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • copy

      @Nonnull public SegmentsRecord.Builder copy()
      Description copied from interface: CopyableBuilder
      Create a new builder CopyableBuilder that is a copy of this one.
      Specified by:
      copy in interface CopyableBuilder<SegmentsRecord.Builder,SegmentsRecord>
      Returns:
      a new builder instance.
    • committed

      @Nonnull public final SegmentsRecord.Builder committed(@Nullable String value)
      If true, the segment is synced to disk. Segments that are synced can survive a hard reboot. If false, the data from uncommitted segments is also stored in the transaction log so that OpenSearch is able to replay changes on the next start.

      API name: committed

    • compound

      @Nonnull public final SegmentsRecord.Builder compound(@Nullable String value)
      If true, the segment is stored in a compound file. This means Lucene merged all files from the segment in a single file to save file descriptors.

      API name: compound

    • docsCount

      @Nonnull public final SegmentsRecord.Builder docsCount(@Nullable String value)
      The number of documents in the segment. This excludes deleted documents and counts any nested documents separately from their parents. It also excludes documents which were indexed recently and do not yet belong to a segment.

      API name: docs.count

    • docsDeleted

      @Nonnull public final SegmentsRecord.Builder docsDeleted(@Nullable String value)
      The number of deleted documents in the segment, which might be higher or lower than the number of delete operations you have performed. This number excludes deletes that were performed recently and do not yet belong to a segment. Deleted documents are cleaned up by the automatic merge process if it makes sense to do so. Also, OpenSearch creates extra deleted documents to internally track the recent history of operations on a shard.

      API name: docs.deleted

    • generation

      @Nonnull public final SegmentsRecord.Builder generation(@Nullable String value)
      The segment generation number. OpenSearch increments this generation number for each segment written then uses this number to derive the segment name.

      API name: generation

    • id

      @Nonnull public final SegmentsRecord.Builder id(@Nullable String value)
      API name: id
    • index

      @Nonnull public final SegmentsRecord.Builder index(@Nullable String value)
      API name: index
    • ip

      @Nonnull public final SegmentsRecord.Builder ip(@Nullable String value)
      The IP address of the node where it lives.

      API name: ip

    • prirep

      @Nonnull public final SegmentsRecord.Builder prirep(@Nullable String value)
      The shard type: primary or replica.

      API name: prirep

    • searchable

      @Nonnull public final SegmentsRecord.Builder searchable(@Nullable String value)
      If true, the segment is searchable. If false, the segment has most likely been written to disk but needs a refresh to be searchable.

      API name: searchable

    • segment

      @Nonnull public final SegmentsRecord.Builder segment(@Nullable String value)
      The segment name, which is derived from the segment generation and used internally to create file names in the directory of the shard.

      API name: segment

    • shard

      @Nonnull public final SegmentsRecord.Builder shard(@Nullable String value)
      The shard name.

      API name: shard

    • size

      @Nonnull public final SegmentsRecord.Builder size(@Nullable String value)
      API name: size
    • sizeMemory

      @Nonnull public final SegmentsRecord.Builder sizeMemory(@Nullable String value)
      API name: size.memory
    • version

      @Nonnull public final SegmentsRecord.Builder version(@Nullable String value)
      API name: version
    • build

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