lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shikhar Bhushan (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (LUCENE-4370) Let Collector know when all docs have been collected
Date Sun, 06 Apr 2014 12:47:14 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-4370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13961394#comment-13961394
] 

Shikhar Bhushan edited comment on LUCENE-4370 at 4/6/14 12:45 PM:
------------------------------------------------------------------

Proposal: {{LeafCollector}} (in trunk via LUCENE-5527) gets a method {{void done();}

Semantics: It is invoked when collection with that leaf has completed. It is not invoked if
collection terminates due to an exception.

I know this ticket was originally about having such a method on {{Collector}} and not at the
segment-level collection, however I think all use cases can be cleanly modelled in this manner.

As naming goes, I think {{done()}} or such is better than {{close()}}, which implies a try-finally'esque
construct.

Edit: changed my proposal from {{finish()}} to {{done()}} to avoid messing with existing uses
e.g. {{DelegatingCollector}} which would currently extend {{SimpleCollector}} that implements
both {{Collector}} and {{LeafCollector}}.

/cc [~jpountz] [~rcmuir] [~hossman]


was (Author: shikhar):
Proposal: {{LeafCollector}} (in trunk via LUCENE-5527) gets a method {{void done();}

Semantics: It is invoked when collection with that leaf has completed. It is not invoked if
collection does terminates due to an exception.

I know this ticket was originally about having such a method on {{Collector}} and not at the
segment-level collection, however I think all use cases can be cleanly modelled in this manner.

As naming goes, I think {{done()}} or such is better than {{close()}}, which implies a try-finally'esque
construct.

Edit: changed my proposal from {{finish()}} to {{done()}} to avoid messing with existing uses
e.g. {{DelegatingCollector}} which would currently extend {{SimpleCollector}} that implements
both {{Collector}} and {{LeafCollector}}.

/cc [~jpountz] [~rcmuir] [~hossman]

> Let Collector know when all docs have been collected
> ----------------------------------------------------
>
>                 Key: LUCENE-4370
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4370
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 4.0-BETA
>            Reporter: Tomás Fernández Löbbe
>            Priority: Minor
>
> Collectors are a good point for extension/customization of Lucene/Solr, however sometimes
it's necessary to know when the last document has been collected (for example, for flushing
cached data).
> It would be nice to have a method that gets called after the last doc has been collected.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message