org.apache.lucene.index

## Class SegmentReadState

- java.lang.Object
- - org.apache.lucene.index.SegmentReadState

-     public class SegmentReadState
      extends Object

  Holder class for common parameters used during read.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `IOContext` | `context` `IOContext` to pass to `Directory.openInput(String,IOContext)`.
    `Directory` | `directory` `Directory` where this segment is read from.
    `FieldInfos` | `fieldInfos` `FieldInfos` describing all fields in this segment.
    `boolean` | `openedFromWriter` True iff this SegmentReadState is opened from an IndexWriter.
    `Map<String,String>` | `readerAttributes` The reader attributes for this reader.
    `SegmentInfo` | `segmentInfo` `SegmentInfo` describing this segment.
    `String` | `segmentSuffix` Unique suffix for any postings files read for this segment.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SegmentReadState(Directory dir, SegmentInfo info, FieldInfos fieldInfos, boolean openedFromWriter, IOContext context, Map<String,String> readerAttributes)` Create a `SegmentReadState`.
    `SegmentReadState(Directory dir, SegmentInfo info, FieldInfos fieldInfos, boolean openedFromWriter, IOContext context, String segmentSuffix, Map<String,String> readerAttributes)` Create a `SegmentReadState`.
    `SegmentReadState(SegmentReadState other, String newSegmentSuffix)` Create a `SegmentReadState`.

  - ### Method Summary

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### directory

          public final Directory directory

      `Directory` where this segment is read from.

    - #### segmentInfo

          public final SegmentInfo segmentInfo

      `SegmentInfo` describing this segment.

    - #### fieldInfos

          public final FieldInfos fieldInfos

      `FieldInfos` describing all fields in this segment.

    - #### context

          public final IOContext context

      `IOContext` to pass to `Directory.openInput(String,IOContext)`.

    - #### segmentSuffix

          public final String segmentSuffix

      Unique suffix for any postings files read for this segment. `PerFieldPostingsFormat` sets this for each of the postings formats it wraps. If you create a new `PostingsFormat` then any files you write/read must be derived using this suffix (use `IndexFileNames.segmentFileName(String,String,String)`).

    - #### openedFromWriter

          public final boolean openedFromWriter

      True iff this SegmentReadState is opened from an IndexWriter.

    - #### readerAttributes

          public final Map<String,String> readerAttributes

      The reader attributes for this reader. This is used to configure low level options on the codec layer. This attribute map is user supplied at reader creation time.

  - ### Constructor Detail

    - #### SegmentReadState

          public SegmentReadState(Directory dir,
                                  SegmentInfo info,
                                  FieldInfos fieldInfos,
                                  boolean openedFromWriter,
                                  IOContext context,
                                  Map<String,String> readerAttributes)

      Create a `SegmentReadState`.

    - #### SegmentReadState

          public SegmentReadState(Directory dir,
                                  SegmentInfo info,
                                  FieldInfos fieldInfos,
                                  boolean openedFromWriter,
                                  IOContext context,
                                  String segmentSuffix,
                                  Map<String,String> readerAttributes)

      Create a `SegmentReadState`.

    - #### SegmentReadState

          public SegmentReadState(SegmentReadState other,
                                  String newSegmentSuffix)

      Create a `SegmentReadState`.

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.