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 "Kay Kay (JIRA)" <ji...@apache.org> on 2008/12/24 18:16:46 UTC

[jira] Created: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

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
         Environment: JRE 6, Tomcat 6
            Reporter: Kay Kay


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.


[jira] Commented: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659566#action_12659566 ] 

Kay Kay commented on SOLR-938:
------------------------------

Noble - In the revised patch - did you mean to add EventListener to the source control as well since it would not compile at this point. 

Also - with invokeEvent - I believe it might be better to reuse the EventListener instance instead of recreating them again, for every notification, since the ClassLoading and the instance creation might be expensive (especially Class Loading). Storing the information during the runtime might be useful for various event notification purposes. 

> 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, 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.


[jira] Assigned: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shalin Shekhar Mangar reassigned SOLR-938:
------------------------------------------

    Assignee: Shalin Shekhar Mangar

> 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
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 1.4
>
>         Attachments: SOLR-938.patch, SOLR-938.patch, 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.


[jira] Commented: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659145#action_12659145 ] 

Kay Kay commented on SOLR-938:
------------------------------

I am a little bit apprehensive about inheriting from JdbcDataSource since inheritance brings in tighter coupling. (The most important assumption about JdbcDataSource overriding is that the sub class' close() method calls super.close() - to avoid resource leaks). 

And also - doing a full-import a given query is different from closing the jdbc connection altogether ( even though the impl. might converge in their meaning ). 

Instead - from a workflow perspective - all I need is a pluggable independent hook without disrupting DIH but a notification from the same after its completion to move onto the next. 

> 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.


[jira] Commented: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662180#action_12662180 ] 

Kay Kay commented on SOLR-938:
------------------------------

Thanks Shalin / Noble. 

Full Import and Delta Import are functionally 2 different things. We probably need a way to distinguish the event handlers as  onFullImportStart/End and onDeltaImportStart/End since they represent different events. May be there could be a separate jira to track this. 

> 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
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 1.4
>
>         Attachments: SOLR-938.patch, SOLR-938.patch, SOLR-938.patch, 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.


[jira] Updated: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kay Kay updated SOLR-938:
-------------------------

          Component/s: contrib - DataImportHandler
        Fix Version/s: 1.4
    Affects Version/s: 1.4

> 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
>
>   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.


[jira] Issue Comment Edited: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659124#action_12659124 ] 

Shalin Shekhar Mangar commented on SOLR-938:
--------------------------------------------

Kay, you can also extend JdbcDataSource, override the close method and use this data source for your root entity.

> 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.


[jira] Closed: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kay Kay closed SOLR-938.
------------------------


> 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
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 1.4
>
>         Attachments: SOLR-938.patch, SOLR-938.patch, SOLR-938.patch, 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.


[jira] Commented: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659588#action_12659588 ] 

Kay Kay commented on SOLR-938:
------------------------------

| I guess caching is pointless for a class which is used only twice for a full import

We have a much larger query , for which we do a full-import . We split the data by the primary key range and perform multiple smaller 'full-import's consolidated together to form a  full-import . Hence the necessity for retaining the instance for the event handlers. 

But I am ok with tracking that with a separate jira - if needed. When can we get this committed the current patch onto the trunk for now. 

> 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, SOLR-938.patch, 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.


[jira] Updated: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noble Paul updated SOLR-938:
----------------------------

    Attachment: SOLR-938.patch

I missed the file. this patch has it

bq.Also - with invokeEvent - I believe it might be better to reuse the EventListener instance instead of recreating them again, for every notification, since the ClassLoading ...


I guess caching is pointless for a class which is used only twice for a full import

> 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, SOLR-938.patch, 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.


[jira] Updated: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noble Paul updated SOLR-938:
----------------------------

    Attachment: SOLR-938.patch

script is not supported

> 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, 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.


[jira] Updated: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kay Kay updated SOLR-938:
-------------------------

    Attachment: SOLR-938.patch

DataImportCloseHook.java : New interface to be implemented for handling closing hooks

DataImporter.java / DataConfig.java :  add new close hook interfaces. 

TestDocBuilder.java : have a sample  schema (optional closehook type=" " ) and let TestDocBuilder parse the same. 

> 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.


Re: [jira] Issue Comment Edited: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by Kay Kay <ka...@gmail.com>.
Great. How about having an enum for Context (as compared to int) for 
type safety.


Noble Paul (JIRA) wrote:
>     [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662224#action_12662224 ] 
>
> noble.paul edited comment on SOLR-938 at 1/8/09 6:10 PM:
> ---------------------------------------------------------
>
> =Context#currentProcess() can tell you what is going on now. 
>
>       was (Author: noble.paul):
>     the Context can tell you which one is going on. Context#currentProcess() can tell you what is going on now. 
>   
>   
>> 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
>>            Assignee: Shalin Shekhar Mangar
>>             Fix For: 1.4
>>
>>         Attachments: SOLR-938.patch, SOLR-938.patch, SOLR-938.patch, 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. 
>>     
>
>   


[jira] Issue Comment Edited: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662224#action_12662224 ] 

noble.paul edited comment on SOLR-938 at 1/8/09 6:10 PM:
---------------------------------------------------------

=Context#currentProcess() can tell you what is going on now. 

      was (Author: noble.paul):
    the Context can tell you which one is going on. Context#currentProcess() can tell you what is going on now. 
  
> 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
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 1.4
>
>         Attachments: SOLR-938.patch, SOLR-938.patch, SOLR-938.patch, 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.


[jira] Resolved: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shalin Shekhar Mangar resolved SOLR-938.
----------------------------------------

    Resolution: Fixed

Committed revision 732695.

Thanks Kay and Noble!

> 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
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 1.4
>
>         Attachments: SOLR-938.patch, SOLR-938.patch, SOLR-938.patch, 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.


[jira] Updated: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shalin Shekhar Mangar updated SOLR-938:
---------------------------------------

    Attachment: SOLR-938.patch

# Bringing patch in sync with trunk.
# Added a test case

I plan to commit shortly.

> 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
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 1.4
>
>         Attachments: SOLR-938.patch, SOLR-938.patch, SOLR-938.patch, 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.


[jira] Commented: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659190#action_12659190 ] 

Noble Paul commented on SOLR-938:
---------------------------------

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.


[jira] Commented: (SOLR-938) DataImportHandler: Add close hooks to the completion of a full-import process

Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662224#action_12662224 ] 

Noble Paul commented on SOLR-938:
---------------------------------

the Context can tell you which one is going on. Context#currentProcess() can tell you what is going on now. 

> 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
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 1.4
>
>         Attachments: SOLR-938.patch, SOLR-938.patch, SOLR-938.patch, 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.