[
https://issues.apache.org/jira/browse/SOLR-2701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080474#comment-13080474
]
Eks Dev commented on SOLR-2701:
-------------------------------
one hook for users to update content of this map would be to add beforeCommit
callbacks. This looks simple enough in UpdateHandler2.commit() call, but there
is a catch:
We need to invoke listeners before we close() for implicit commits... having
decref-ed IndexWriter, the question is if we want to run beforeCommit listeners
even if IW does not really get closed (user updates map more often than
needed).
IMO, this should not be a problem, invoking callbacks a little bit more often
than needed.
Another place where we have "implicit commit" is newIndexWriter() /
here we need only to add IndexWriterProvider.isIndexWriterNull() to check if we
need callbacks
A solution for close() would be also simple by adding
IndexWriterProvider.isIndexGoingToCloseOnNextDecref() before invoking decref()
to condition callbacks
Any better solution? Are the callbacks good approach to provide user hooks for
this?
-------
Another approach is to get beforeCommitCallbacks at lucene level and piggy-back
there for solr callbacks?
We would only need to change IndexWriter.commit(Map..) and close() but commit
is final...
Notice: I am very rusty considering solr/lucene codebase => any help would be
appreciated. Last patch I made here is ages ago :)
> Expose IndexWriter.commit(Map<String,String> commitUserData) to solr
> ---------------------------------------------------------------------
>
> Key: SOLR-2701
> URL: https://issues.apache.org/jira/browse/SOLR-2701
> Project: Solr
> Issue Type: New Feature
> Components: update
> Affects Versions: 4.0
> Reporter: Eks Dev
> Priority: Minor
> Labels: commit, update
> Original Estimate: 8h
> Remaining Estimate: 8h
>
> At the moment, there is no feature that enables associating user information
> to the commit point.
>
> Lucene supports this possibility and it should be exposed to solr as well,
> probably via beforeCommit Listener (analogous to prepareCommit in Lucene).
> Most likely home for this Map to live is UpdateHandler.
> Example use case would be an atomic tracking of sequence numbers or
> timestamps for incremental updates.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]