lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <>
Subject [jira] Commented: (LUCENE-1402) CheckIndex API changed without backwards compaitibility
Date Tue, 23 Sep 2008 17:26:44 GMT


Uwe Schindler commented on LUCENE-1402:

I did not realize about LUCENE-1354, so I am a little bit late with my concerns. In my opinion,
the way how CheckIndex is implemented, is not the cleanest obect-oriented way. It looks like
a standard console program, what it was at the beginning, but not like a tool for use in other
tools (like startup or maintenance tasks of Solr or my project panFMP). There is one problem:

We have a *static* variable pointing to the output Stream. As this variable is static, it
is everywhere the same. If I want to create a web application that checks two indexes and
this maybe in parallel (because two users started the check index task), I cannot redirect
the output stream to an individual "console" (e.g. the servlet output stream).

In my opinion, to be a handy tool, there should be some minor changes:
 - the class should have an public constructor getting the Directory
 - a public method to set the output stream for the instance (like IndexWriter does with setInfoStream())
 - the check/fix methods as instance methods

The main() method (which must stay static, which is clear) and the two static and deprecated
methods, should instantiate an CheckIndex instance and call the methods using System.err

> CheckIndex API changed without backwards compaitibility
> -------------------------------------------------------
>                 Key: LUCENE-1402
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Index
>    Affects Versions: 2.4
>            Reporter: Uwe Schindler
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1402.patch
> The API of CheckIndex changed. The Check function returns a CheckIndexStatus and not
boolean. And JavaDocs notes the boolean return value.
> I am not sure if it works, but it would be good to have the check method that returns
boolean available @Deprecated, i.e.
> @Deprecated public static CheckIndexStatus check(Directory dir, boolean doFix) throws
IOException {
>  final CheckIndexStatus stat=this.check(dir,doFix);
>  return stat.clean;
> }
> I am not sure, if it can be done with the same method name, but it prevents drop-in-replacements
of Lucene to work.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message