[jira] [Commented] (LUCENE-7904) Refactoring of SegmentInfos

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (LUCENE-7904) Refactoring of SegmentInfos

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/LUCENE-7904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16089792#comment-16089792 ]

Adrien Grand commented on LUCENE-7904:
--------------------------------------

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

> Refactoring of SegmentInfos
> ---------------------------
>
>                 Key: LUCENE-7904
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7904
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/index
>            Reporter: João Paulo Lemes Machado
>
> 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?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]