lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3226) rename SegmentInfos.FORMAT_3_1 and improve description in CheckIndex
Date Wed, 22 Jun 2011 03:12:51 GMT


Shai Erera commented on LUCENE-3226:

bq. I'd like to commit this if nobody objects, its trivial and will reduce confusion.

I would have (objected), only it all happened so fast while I was asleep :).

I called the constant like that because I didn't like the other constant names (and don't
like the new one either).  The problem is that when it comes to remove support for a certain
format, it is very hard to understand from the constant name what index format it represents.

Instead, I chose a meaningful constant name for the developer, with a documentation that explains
what has changed. When we're on 5.0 and need to remove support for 3.x, it will be very easy
to delete all the places in the code which reference FORMAT_3_1, rather than go ask Mike what

Also, in LUCENE-2921 I plan to get rid of all those ridiculous constant names and track the
index version at the segment level only. It will be easier, IMO, to have an easy to understand
constant name when it comes to supporting an older index (or remove support for). Perhaps
it's only me, but when I read those format constant names, I only did that when removing support
for older indexes. Other than that, they are not very interesting ...

What Hoss reported about CheckIndex is the real problem we should handle here. SegmentInfo
prints in its toString the code version which created it, which is better than seeing -9 IMO,
and that should be "3.1" or "3.2". If it's a 3.2.0 newly created index, you shouldn't see
"3.1" reported from SegmentInfos.toString. Perhaps CheckIndex needs to be fixed to refer to
Constants.LUCENE_MAIN_VERSION instead?

Robert, shall we reopen the issue to discuss?

> rename SegmentInfos.FORMAT_3_1 and improve description in CheckIndex
> --------------------------------------------------------------------
>                 Key: LUCENE-3226
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>    Affects Versions: 3.1, 3.2
>            Reporter: Hoss Man
>            Assignee: Robert Muir
>             Fix For: 3.3, 4.0
>         Attachments: LUCENE-3226.patch
> A 3.2 user recently asked if something was wrong because CheckIndex was reporting his
(newly built) index version as...
> {noformat}
> Segments file=segments_or numSegments=1 version=FORMAT_3_1 [Lucene 3.1]
> {noformat}
> It seems like there are two very confusing pieces of information here...
> 1) the variable name of SegmentInfos.FORMAT_3_1 seems like poor choice.  All other FORMAT_*
constants in SegmentInfos are descriptive of the actual change made, and not specific to the
version when they were introduced.
> 2) whatever the name of the FORMAT_* variable, CheckIndex is labeling it "Lucene 3.1",
which is missleading since that format is alwasy used in 3.2 (and probably 3.3, etc...). 

> I suggest:
> a) rename FORMAT_3_1 to something like "FORMAT_SEGMENT_RECORDS_VERSION"
> b) change CheckIndex so that the label for the "newest" format always ends with " and
later" (ie: "Lucene 3.1 and later") so when we release versions w/o a format change we don't
have to remember to manual list them in CheckIndex.  when we *do* make format changes and
update CheckIndex " and later" can be replaced with " to X.Y" and the new format can be added

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