Michael McCandless created LUCENE-7335:
------------------------------------------
Summary: IndexWriter.setCommitData should be late binding
Key: LUCENE-7335
URL: https://issues.apache.org/jira/browse/LUCENE-7335
Project: Lucene - Core
Issue Type: Bug
Reporter: Michael McCandless
Assignee: Michael McCandless
Fix For: master (7.0), 6.2
Today, {{IndexWriter.setCommitData}} is early-binding: as soon as you call it,
it clones the provided map and later on when commit is called, it uses that
clone.
But this makes it hard for some use cases where the app needs to record more
timely information based on when specifically the commit actually occurs.
E.g., with LUCENE-7302, it would be helpful to store the max completed sequence
number in the commit point: that would be a lower bound of operations that were
after the commit.
I think the most minimal way to do this would be to upgrade the existing method
to take an {{Iterable<Map.Entry<String,String>}}, and document that it's now
late binding, i.e. IW will pull an {{Iterator}} from that when it's time to
write the segments file.
Or we could also make an explicit interface that you pass (seems like
overkill), or maybe have a listener or something (or you subclass IW) that's
invoked when the commit is about to write the segments file, but that also
seems like overkill.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]