Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      New
    • Flags:
      Important

      Description

      Hello everyone.
      I was analyzing the modularization of some classes, and I identified that the class SegmentInfos has an opportunity for cohesion improvement.
      The class IndexWriter was in the same situation and the problem was solved as follows: The IndexWriterConfig class was created, and several get() and set() methods that were used only to configure the class parameters were moved from IndexWriter to IndexWriterConfig.
      The new class was then accessed through an instance variable in IndexWriter. This strategy has cleaned and improved IndexWriter cohesion.
      With this in mind, I would recommend creating a new class: SegmentInfosConfig , and moving the following methods:
      getLastCommitGeneration
      getLastCommitSegmentsFileName
      getSegmentsFileName
      getNextPendingGeneration
      getId
      getVersion
      getGeneration
      getLastGeneration
      setInfoStream
      getInfoStream
      setNextWriteGeneration
      setUserData
      setVersion
      getCommitLuceneVersion
      getMinSegmentLuceneVersion
      from the SegmentInfos.
      Those parameters accessed by an instance variable in the SegmentInfos.
      Moreover, the orthogonality is the design would be enhanced.

      What do you think about that?

        Activity

        Hide
        jpountz Adrien Grand added a comment -

        It feels a bit wrong to me since commit gen, generation, version, etc. are not configuration parameters. I think SegmentInfos is fine as-is.

        Show
        jpountz Adrien Grand added a comment - It feels a bit wrong to me since commit gen, generation, version, etc. are not configuration parameters. I think SegmentInfos is fine as-is.
        Hide
        joaoplm João Paulo Lemes Machado added a comment -

        Thank you Adrien. I have identified a few more opportunities, can I present the list of classes to discuss the feasibility of refactoring for each class?

        Show
        joaoplm João Paulo Lemes Machado added a comment - Thank you Adrien. I have identified a few more opportunities, can I present the list of classes to discuss the feasibility of refactoring for each class?

          People

          • Assignee:
            Unassigned
            Reporter:
            joaoplm João Paulo Lemes Machado
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development