You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Noble Paul (JIRA)" <ji...@apache.org> on 2008/12/25 19:18:44 UTC
[jira] Issue Comment Edited: (SOLR-938) DataImportHandler: Add
close hooks to the completion of a full-import process
[ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659190#action_12659190 ]
noble.paul edited comment on SOLR-938 at 12/25/08 10:18 AM:
------------------------------------------------------------
I wish to recommend the following. It is better not to limit this to close event. I try to minimize the no:of public interfaces. DIH is designed keeping non-java users also in mind. As far as possible users should not be forced to use java.
It can better be called an EventListener
{code}
public interface EventListener {
public void onEvent(Context ctx );
}
{code}
It could be registered as something like
{code}
<document onImportEnd="script:endImport" onImportStart="com.foo.Foo" >
<!-- entitiies go here-->.
</document>
{code}
Single method interface is preferred because it should be possible to write the implementation in scripting languages
was (Author: noble.paul):
I wish to recommend the following. It is better not to limit this to close event. I try to minimize the no:of public interfaces. DIH is designed keeping non-java users in mind. As far as possible users should not be forced to use java.
It can better be called an EventListener
{code}
public interface DataImportEventListener {
public void event(Context ctx );
}
{code}
It could be registered as something like
{code}
<document endImportListener="script:endImport" startImportListener="com.foo.Foo" >
<!-- entitiies go here-->.
</document>
{code}
Single method interface is preferred because it should be possible to write the implementation in scripting languages
> DataImportHandler: Add close hooks to the completion of a full-import process
> ------------------------------------------------------------------------------
>
> Key: SOLR-938
> URL: https://issues.apache.org/jira/browse/SOLR-938
> Project: Solr
> Issue Type: New Feature
> Components: contrib - DataImportHandler
> Affects Versions: 1.4
> Environment: JRE 6, Tomcat 6
> Reporter: Kay Kay
> Fix For: 1.4
>
> Attachments: SOLR-938.patch
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> Adding a new feature that we need for continuation of a workflow based on a full-import procedure. When a full-import completes , the pre-defined hook method is called at the end of the same.
> Implementations that need to notified , need to implement the new interface - DataImportCloseHook and register themselves in the data config file as follows.
> <dataConfig>
> .
> .
> .
> .
> <closeHook type="com.myorg.fullimporter.closeHookImpl1" />
> <closeHook type="com.myorg.fullimporter.closeHookImpl2" />
> </dataConfig>
> A single instance of them is created (as part of DataImporter) during instantiation and the same insance is reused across multiple invocations.
> Since the dataImporter is protected by a thread-lock - there is no thred-safe guarantee for the implementations of the full-import close hook.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.