lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3084) MergePolicy.OneMerge.segments should be List<SegmentInfo> not SegmentInfos
Date Wed, 11 May 2011 22:03:47 GMT


Uwe Schindler commented on LUCENE-3084:

bq. It may contain list as a field instead. And have a much cleaner API as a consequence.

I agree, I dont like subclassing ArrayList (this is the only class in Lucene that subclasses
java collection classes left over. We should rmeove.

Problem: List access is heavy used in code, I have to first review all places. Alternatively
we could make ist simply implement List<SegmentInfo>, so it does not get the extra methods
from ArrayList that go beyond List. This would be a good way in the middle.

bq. On another note, I wonder, is the fact that Vector is internally synchronized used somewhere
within SegmentInfos client code?

Thats safe, synchronization is not an issue here, all access to SegmentInfos is protected
by IndexWriter synchronization (see e.g. mergeInit()). The use of Vector is just a relict
from earlier days. I should have removed that for 3.0 already but missed that exactly because
I did not know if synchronization was needed.

> MergePolicy.OneMerge.segments should be List<SegmentInfo> not SegmentInfos
> --------------------------------------------------------------------------
>                 Key: LUCENE-3084
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 3.2, 4.0
>         Attachments: LUCENE-3084-trunk-only.patch, LUCENE-3084-trunk-only.patch, LUCENE-3084.patch
> SegmentInfos carries a bunch of fields beyond the list of SI, but for merging purposes
these fields are unused.
> We should cutover to List<SI> instead.

This message is automatically generated by JIRA.
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message