[ https://issues.apache.org/jira/browse/LUCENE-4876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13720526#comment-13720526 ]
Adrien Grand commented on LUCENE-4876: -------------------------------------- bq. This is currently impossible because of SetOnce. The merge schedulers don't have a SetOnce<IndexWriter> so if a user replaces the MergePolicy and all objects that have a SetOnce in its IndexWriterConfig and forgets the merge scheduler, the problem remains. I don't really like this SetOnce<?> trick. If a variable should only be set once, it should be final and set in the constructor? bq. how cruel it is to expose clone semantics on end-users I fully agree. In this issue I tried to make clone consistently used across stateful objects held by an IndexWriterConfig object but ideally IndexWriterConfig should only carry stateless objects (in particular none of them should have an IndexWriter as a member) so that we never need to clone it or any of its members when reusing it. > IndexWriterConfig.clone should clone the MergeScheduler > ------------------------------------------------------- > > Key: LUCENE-4876 > URL: https://issues.apache.org/jira/browse/LUCENE-4876 > Project: Lucene - Core > Issue Type: Bug > Reporter: Adrien Grand > Assignee: Adrien Grand > Fix For: 4.3 > > Attachments: LUCENE-4876.patch, LUCENE-4876.patch, LUCENE-4876.patch > > > ConcurrentMergeScheduler has a List<MergeThread> member to track the running > merging threads, so IndexWriterConfig.clone should clone the merge scheduler > so that both IndexWriterConfig instances are independant. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org