lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shai Erera <ser...@gmail.com>
Subject Re: SnapshotDeletionPolicy throws NPE if no commit happened
Date Thu, 15 Apr 2010 07:36:01 GMT
Well ... one can still call commit() or close() right after IW creation. And
this is a very rare case to be hit by. Was just asking about whether we want
to add an explicit and clear protective code about it or not.

Shai

On Thu, Apr 15, 2010 at 10:26 AM, Earwin Burrfoot <earwin@gmail.com> wrote:

> We should just let IW create a null commit on an empty directory, like
> it always did ;)
> Then a whole class of such problems disappears.
>
> On Thu, Apr 15, 2010 at 11:16, Shai Erera <serera@gmail.com> wrote:
> > SDP throws NPE if the index includes no commits, but snapshot() is
> called.
> > This is an extreme case, but can happen if one takes snapshots (for
> backup
> > purposes for example) in a separate code segment than indexing, and does
> not
> > know if commit was called or not.
> >
> > I think we should throw an IllegalStateException instead of falling on
> NPE,
> > w/ a descriptive message. Alternatively, we can just return null and
> > document it ... But I prefer the ISE instead. What do you think?
> >
> > Shai
> >
>
>
>
> --
> Kirill Zakharenko/Кирилл Захаренко (earwin@gmail.com)
> Home / Mobile: +7 (495) 683-567-4 / +7 (903) 5-888-423
> ICQ: 104465785
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>

Mime
View raw message