lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (Commented) (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3836) Most Codec.*Format().*Reader() methods should use SegmentReadState
Date Thu, 01 Mar 2012 12:44:03 GMT


Robert Muir commented on LUCENE-3836:

I think this change is OK: I just want to mention that avoiding SegmentReadState 
was definitely intentional... well most of my issues are really based on
SegmentWriteState, but I think the whole concept is broken, see below:

SegmentWriteState is bad news, for many codec APIs
they would be underpopulated, or even have bogus data!

For example, what would be SegmentWriteState.numDocs for StoredFieldsWriter?

I understand that at a glance having foo(A) where A has A.B and A.C and A.D seems simpler
than foo(B, C),
but I think its confusing to pass "A" at all if there is an A.D thats somehow bogus, invalid,

In that case its actually much clearer to pass B and C directly... personally I think we 
should revisit these 'argument holder' APIs and likely remove them completely.

Because of that: for most codec APIs I avoided SegmentWriteState and also SegmentReadState
(for symmetry).
> Most Codec.*Format().*Reader() methods should use SegmentReadState
> ------------------------------------------------------------------
>                 Key: LUCENE-3836
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/codecs
>            Reporter: Andrzej Bialecki 
>            Assignee: Andrzej Bialecki 
>             Fix For: 4.0
>         Attachments: LUCENE-3836.patch
> Codec formats API for opening readers is inconsistent - sometimes it uses SegmentReadState,
in other cases it uses individual arguments that are already available via SegmentReadState.
This complicates extending the API, e.g. if additional per-segment state would need to be
passed to the readers.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


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

View raw message