lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LUCENE-5223) IndexUpgrader (4.4.0) fails when -verbose is not set
Date Tue, 17 Sep 2013 23:46:51 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-5223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Hoss Man updated LUCENE-5223:
-----------------------------

    Attachment: LUCENE-5223.patch

As mentioned to uwe on irc, i took a stab at improving hte tests for IndexUpgrader -- we weren't
doing any testing of the command line parsing logic, and only one of the class constructors
was being tested.

this attached patch includes the new tests, as well as a quick attempt at fixing the issue
reported.  it also fixes another issue discoverd by the test: "-dir-impl" aparently didn't
work at all, because it would be interpreted as the name of the directory and then the subsequent
option value would be considered bogus and cause the usage to be printed.

This patch still has some problems...

1) since it now randomly tests "verbose" mode, it's really verbose.  i don't have any good
suggestions here other them to create a static variable that defaults to System.out when the
code runs normally, but the tests could set it to some MockOutputStream in a @BeforeClass

2) there are some nocommit lines relate to how we randomize the "-dir-impl" option ... it's
really kludgy now, but it's the best i could come up with w/o making changes to LuceneTestCase
... hopefully someone else has a suggestion.

3) as i mentioned on irc, i'm not convinced that IndexWriterConfig doesn't also need fixed...

* IndexWriterConfig.setInfoStream(InfoStream) javadocs say "If non-null, ... will be printed
to this." but it throws an error if you try to set it to the value of null you get an error
-- why doesn't it just implicitly use NO_OUTPUT if the arg is null? why don't the javadocs
mention NO_OUTPUT?
* IndexWriterConfig.setInfoStream(PrintStream) javadocs just say it's a convinience wrapper
using PrintStreamInfoStream, with no mention of null at all -- even if setInfoStream(InfoStream)
is going to be a hard-ass about null, why can't setInfoStream(PrintStream) implicitly use
NO_OUTPUT when it's arg is null?
                
> IndexUpgrader (4.4.0) fails when -verbose is not set
> ----------------------------------------------------
>
>                 Key: LUCENE-5223
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5223
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/index
>    Affects Versions: 4.4
>         Environment: Linux
>            Reporter: Bruce Karsh
>            Assignee: Uwe Schindler
>            Priority: Minor
>         Attachments: LUCENE-5223.patch
>
>
> Here it fails because -verbose is not set:
> $ java -cp ./lucene-core-4.4-SNAPSHOT.jar org.apache.lucene.index.IndexUpgrader ./INDEX
> Exception in thread "main" java.lang.IllegalArgumentException: printStream must not be
null
> 	at org.apache.lucene.index.IndexWriterConfig.setInfoStream(IndexWriterConfig.java:514)
> 	at org.apache.lucene.index.IndexUpgrader.<init>(IndexUpgrader.java:126)
> 	at org.apache.lucene.index.IndexUpgrader.main(IndexUpgrader.java:109)
> Here it works with -verbose set:
> $ java -cp ./lucene-core-4.4-SNAPSHOT.jar org.apache.lucene.index.IndexUpgrader -verbose
./INDEX
> IFD 0 [Mon Sep 16 18:25:53 PDT 2013; main]: init: current segments file is "segments_5";
deletionPolicy=org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy@42698403
> ...
> IW 0 [Mon Sep 16 18:25:53 PDT 2013; main]: at close: _2(4.4):C4

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message