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

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: https://issues.apache.org/jira/browse/LUCENE-1402
>             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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to