[
https://issues.apache.org/jira/browse/LUCENE-4566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13501265#comment-13501265
]
Michael McCandless commented on LUCENE-4566:
--------------------------------------------
1) seems like a bug: we should only call afterRefresh if a swap actually
happened, I think?
2) I agree this would be useful, ie a trigger after the swap has happened
(SearcherFactory.newSearcher, by definition, is called before the swap has
happened...). Maybe we make SM non-final and advertise that this is for
afterRefresh...? Or, app passes in a separate "OnRefresh" callback
interface...?
> SearcherManager.afterRefresh() issues
> -------------------------------------
>
> Key: LUCENE-4566
> URL: https://issues.apache.org/jira/browse/LUCENE-4566
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: selckin
> Priority: Minor
>
> 1) ReferenceManager.doMaybeRefresh seems to call afterRefresh even if it
> didn't refresh/swap, (when newReference == null)
> 2) It would be nice if users were allowed to override
> SearcherManager.afterRefresh() to get notified when a new searcher is in
> action.
> But SearcherManager and ReaderManager are final, while NRTManager is not.
> The only way to currently hook into when a new searched is created is using
> the factory, but if you wish to do some async task then, there are no
> guarantees that acquire() will return the new searcher, so you have to pass
> it around and incRef manually. While if allowed to hook into afterRefresh you
> can just rely on acquire() & existing infra you have around it to give you
> the latest one.
--
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: [email protected]
For additional commands, e-mail: [email protected]