lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Who should close MergePolicy
Date Wed, 13 Aug 2014 22:03:54 GMT
+1 to just remove Closeable from MP!

Mike McCandless

On Wed, Aug 13, 2014 at 9:00 AM, Shai Erera <> wrote:
> Hi
> While working on LUCENE-5883, I noticed that IndexWriter calls
> mergePolicy.close(). But since LUCENE-5711, where we no longer wire an MP to
> a single IndexWriter instance, I don't think IW should call MP.close(), e.g.
> in case the app shares this MP across several IWs?
> But then, in the common case where an MP is used by a single IW instance,
> having IW close it is convenient.
> I looked at all MPs we have, none seem to implement close() in any special
> way (empty impls, or delegating impls are the only ones I found). So
> question is:
> 1) Is it a bug that IW calls mp.close()? I think so, but would like to
> confirm with others.
> 2) If it is a bug, and we're going to say that you should close your MP
> separately, I wonder why we need to have Closeable on MP at all. If someone
> uses an MP which should be closed, he can just close it? This stems from the
> fact that none of the existing MPs in trunk really implement close(), yet we
> advertise that you should close MP since it implements Closeable.
> Shai

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

View raw message