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

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: https://issues.apache.org/jira/browse/LUCENE-3084
>             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: http://www.atlassian.com/software/jira

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

Reply via email to