org.apache.lucene.luke.models.commits

## Class CommitsImpl

- java.lang.Object
- - org.apache.lucene.luke.models.LukeModel
  - - org.apache.lucene.luke.models.commits.CommitsImpl

- All Implemented Interfaces:
    Commits

      public final class CommitsImpl
      extends LukeModel
      implements Commits

  Default implementation of `Commits`

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.luke.models.LukeModel

      `commit, dir, liveDocs, reader`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CommitsImpl(DirectoryReader reader, String indexPath)` Constructs a CommitsImpl that holds the `Directory` wrapped in the given `DirectoryReader`.
    `CommitsImpl(Directory dir, String indexPath)` Constructs a CommitsImpl that holds given `Directory`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Optional<Commit>` | `getCommit(long commitGen)` Returns a commit of the specified generation.
    `List<File>` | `getFiles(long commitGen)` Returns index files for the specified generation.
    `Map<String,String>` | `getSegmentAttributes(long commitGen, String name)` Returns internal codec attributes map for the specified segment.
    `Optional<Codec>` | `getSegmentCodec(long commitGen, String name)` Returns codec for the specified segment.
    `Map<String,String>` | `getSegmentDiagnostics(long commitGen, String name)` Returns diagnotics for the specified segment.
    `List<Segment>` | `getSegments(long commitGen)` Returns segments for the specified generation.
    `List<Commit>` | `listCommits()` Returns commits that exists in this Directory.

    - ### Methods inherited from class org.apache.lucene.luke.models.LukeModel

      `getFieldNames`

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

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

- - ### Constructor Detail

    - #### CommitsImpl

          public CommitsImpl(Directory dir,
                             String indexPath)

      Constructs a CommitsImpl that holds given `Directory`.
      Parameters:
        `dir` - - the index directory
        `indexPath` - - the path to index directory

    - #### CommitsImpl

          public CommitsImpl(DirectoryReader reader,
                             String indexPath)

      Constructs a CommitsImpl that holds the `Directory` wrapped in the given `DirectoryReader`.
      Parameters:
        `reader` - - the index reader
        `indexPath` - - the path to index directory

  - ### Method Detail

    - #### listCommits

          public List<Commit> listCommits()
                                   throws LukeException

      Description copied from interface: `Commits`
      Returns commits that exists in this Directory.
      Specified by:
        `listCommits` in interface `Commits`
      Throws:
        `LukeException` - - if an internal error occurs when accessing index

    - #### getCommit

          public Optional<Commit> getCommit(long commitGen)
                                     throws LukeException

      Description copied from interface: `Commits`
      Returns a commit of the specified generation.
      Specified by:
        `getCommit` in interface `Commits`
      Parameters:
        `commitGen` - - generation
      Throws:
        `LukeException` - - if an internal error occurs when accessing index

    - #### getFiles

          public List<File> getFiles(long commitGen)
                              throws LukeException

      Description copied from interface: `Commits`
      Returns index files for the specified generation.
      Specified by:
        `getFiles` in interface `Commits`
      Parameters:
        `commitGen` - - generation
      Throws:
        `LukeException` - - if an internal error occurs when accessing index

    - #### getSegments

          public List<Segment> getSegments(long commitGen)
                                    throws LukeException

      Description copied from interface: `Commits`
      Returns segments for the specified generation.
      Specified by:
        `getSegments` in interface `Commits`
      Parameters:
        `commitGen` - - generation
      Throws:
        `LukeException` - - if an internal error occurs when accessing index

    - #### getSegmentAttributes

          public Map<String,String> getSegmentAttributes(long commitGen,
                                                         String name)
                                                  throws LukeException

      Description copied from interface: `Commits`
      Returns internal codec attributes map for the specified segment.
      Specified by:
        `getSegmentAttributes` in interface `Commits`
      Parameters:
        `commitGen` - - generation
        `name` - - segment name
      Throws:
        `LukeException` - - if an internal error occurs when accessing index

    - #### getSegmentDiagnostics

          public Map<String,String> getSegmentDiagnostics(long commitGen,
                                                          String name)
                                                   throws LukeException

      Description copied from interface: `Commits`
      Returns diagnotics for the specified segment.
      Specified by:
        `getSegmentDiagnostics` in interface `Commits`
      Parameters:
        `commitGen` - - generation
        `name` - - segment name
      Throws:
        `LukeException` - - if an internal error occurs when accessing index

    - #### getSegmentCodec

          public Optional<Codec> getSegmentCodec(long commitGen,
                                                 String name)
                                          throws LukeException

      Description copied from interface: `Commits`
      Returns codec for the specified segment.
      Specified by:
        `getSegmentCodec` in interface `Commits`
      Parameters:
        `commitGen` - - generation
        `name` - - segment name
      Throws:
        `LukeException` - - if an internal error occurs when accessing index

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