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 2009/01/19 19:35:59 UTC
[jira] Created: (SOLR-969) Context#FULL_DUMP, DELTA_DUMP,
FIND_DELTA as an enum
Context#FULL_DUMP, DELTA_DUMP, FIND_DELTA as an enum
-----------------------------------------------------
Key: SOLR-969
URL: https://issues.apache.org/jira/browse/SOLR-969
Project: Solr
Issue Type: Improvement
Components: contrib - DataImportHandler
Environment: Java 6, Tomcat 6
Reporter: Kay Kay
Fix For: 1.4
Context # FULL_DUMP, DELTA_DUMP, FIND_DELTA made type-safe as an enum.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-969) Context#FULL_DUMP, DELTA_DUMP,
FIND_DELTA as an enum
Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665466#action_12665466 ]
Kay Kay commented on SOLR-969:
------------------------------
Are there any unit test cases for the scenario that you are mentioning about. Also Context has EntityProcessor / DataSource / VariableResolver as return types .What would be the right way to serialize the Java objects to the JavaSCript realm .
> Context#FULL_DUMP, DELTA_DUMP, FIND_DELTA as an enum
> -----------------------------------------------------
>
> Key: SOLR-969
> URL: https://issues.apache.org/jira/browse/SOLR-969
> Project: Solr
> Issue Type: Improvement
> Components: contrib - DataImportHandler
> Environment: Java 6, Tomcat 6
> Reporter: Kay Kay
> Fix For: 1.4
>
> Attachments: SOLR-969.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Context # FULL_DUMP, DELTA_DUMP, FIND_DELTA made type-safe as an enum.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-969) Context#FULL_DUMP, DELTA_DUMP,
FIND_DELTA as an enum
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665326#action_12665326 ]
Noble Paul commented on SOLR-969:
---------------------------------
It was not made an enum because I wamted them to be used in non-java languages (like javascript)
> Context#FULL_DUMP, DELTA_DUMP, FIND_DELTA as an enum
> -----------------------------------------------------
>
> Key: SOLR-969
> URL: https://issues.apache.org/jira/browse/SOLR-969
> Project: Solr
> Issue Type: Improvement
> Components: contrib - DataImportHandler
> Environment: Java 6, Tomcat 6
> Reporter: Kay Kay
> Fix For: 1.4
>
> Attachments: SOLR-969.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Context # FULL_DUMP, DELTA_DUMP, FIND_DELTA made type-safe as an enum.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-969) Context#FULL_DUMP, DELTA_DUMP,
FIND_DELTA as an enum
Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666203#action_12666203 ]
Kay Kay commented on SOLR-969:
------------------------------
I agree String-s are portable. But choosing an enum would still be orthogonal to Strings thanks to the Enum.valueOf(String) method - We can still regenerate the enum from the String representation (in case of non-Java languages).
In any case - Context seems to be restricted to DIH and seems to be available since 1.3 only . So making the change now might be more intuitive to the developer instead of misusing with integers not meant to be passed as an argument in the first place.
> Context#FULL_DUMP, DELTA_DUMP, FIND_DELTA as an enum
> -----------------------------------------------------
>
> Key: SOLR-969
> URL: https://issues.apache.org/jira/browse/SOLR-969
> Project: Solr
> Issue Type: Improvement
> Components: contrib - DataImportHandler
> Environment: Java 6, Tomcat 6
> Reporter: Kay Kay
> Fix For: 1.4
>
> Attachments: SOLR-969.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Context # FULL_DUMP, DELTA_DUMP, FIND_DELTA made type-safe as an enum.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (SOLR-969) Context#FULL_DUMP, DELTA_DUMP,
FIND_DELTA as an enum
Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shalin Shekhar Mangar resolved SOLR-969.
----------------------------------------
Resolution: Fixed
Assignee: Shalin Shekhar Mangar
Committed revision 765499.
I changed the javadocs of Context.currentProcess to reflect the changes.
> Context#FULL_DUMP, DELTA_DUMP, FIND_DELTA as an enum
> -----------------------------------------------------
>
> Key: SOLR-969
> URL: https://issues.apache.org/jira/browse/SOLR-969
> Project: Solr
> Issue Type: Improvement
> Components: contrib - DataImportHandler
> Environment: Java 6, Tomcat 6
> Reporter: Kay Kay
> Assignee: Shalin Shekhar Mangar
> Fix For: 1.4
>
> Attachments: SOLR-969.patch, SOLR-969.patch, SOLR-969.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Context # FULL_DUMP, DELTA_DUMP, FIND_DELTA made type-safe as an enum.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SOLR-969) Context#FULL_DUMP, DELTA_DUMP,
FIND_DELTA as an enum
Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kay Kay updated SOLR-969:
-------------------------
Attachment: SOLR-969.patch
> Context#FULL_DUMP, DELTA_DUMP, FIND_DELTA as an enum
> -----------------------------------------------------
>
> Key: SOLR-969
> URL: https://issues.apache.org/jira/browse/SOLR-969
> Project: Solr
> Issue Type: Improvement
> Components: contrib - DataImportHandler
> Environment: Java 6, Tomcat 6
> Reporter: Kay Kay
> Fix For: 1.4
>
> Attachments: SOLR-969.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Context # FULL_DUMP, DELTA_DUMP, FIND_DELTA made type-safe as an enum.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-969) Context#FULL_DUMP, DELTA_DUMP,
FIND_DELTA as an enum
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666059#action_12666059 ]
Noble Paul commented on SOLR-969:
---------------------------------
I wished it had been String . But, it was already exposed in the API so I did not want to break it. (It may not be so widely used)
Strings are portable across languages.
> Context#FULL_DUMP, DELTA_DUMP, FIND_DELTA as an enum
> -----------------------------------------------------
>
> Key: SOLR-969
> URL: https://issues.apache.org/jira/browse/SOLR-969
> Project: Solr
> Issue Type: Improvement
> Components: contrib - DataImportHandler
> Environment: Java 6, Tomcat 6
> Reporter: Kay Kay
> Fix For: 1.4
>
> Attachments: SOLR-969.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Context # FULL_DUMP, DELTA_DUMP, FIND_DELTA made type-safe as an enum.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-969) Context#FULL_DUMP, DELTA_DUMP,
FIND_DELTA as an enum
Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665876#action_12665876 ]
Kay Kay commented on SOLR-969:
------------------------------
| It was not made an enum because I wamted them to be used in non-java languages (like javascript)
Going back to the original issue - I am sure there would be some way to map the enum objects in java to javascript when it comes to porting the same. Until then ignoring type-safety seems to be ripe for errors ( A good number of test cases seem to pass a 0, as of today in place of ImportProcess in the ContextImpl ctor. when 0 makes no sense at all and another piece of code uses a -1 to check if it is an invalid process i.e. other than full import, delta import, find delta etc. ).
> Context#FULL_DUMP, DELTA_DUMP, FIND_DELTA as an enum
> -----------------------------------------------------
>
> Key: SOLR-969
> URL: https://issues.apache.org/jira/browse/SOLR-969
> Project: Solr
> Issue Type: Improvement
> Components: contrib - DataImportHandler
> Environment: Java 6, Tomcat 6
> Reporter: Kay Kay
> Fix For: 1.4
>
> Attachments: SOLR-969.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Context # FULL_DUMP, DELTA_DUMP, FIND_DELTA made type-safe as an enum.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SOLR-969) Context#FULL_DUMP, DELTA_DUMP,
FIND_DELTA as an enum
Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shalin Shekhar Mangar updated SOLR-969:
---------------------------------------
Attachment: SOLR-969.patch
Patch in sync with trunk.
I'll commit this shortly.
> Context#FULL_DUMP, DELTA_DUMP, FIND_DELTA as an enum
> -----------------------------------------------------
>
> Key: SOLR-969
> URL: https://issues.apache.org/jira/browse/SOLR-969
> Project: Solr
> Issue Type: Improvement
> Components: contrib - DataImportHandler
> Environment: Java 6, Tomcat 6
> Reporter: Kay Kay
> Fix For: 1.4
>
> Attachments: SOLR-969.patch, SOLR-969.patch, SOLR-969.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Context # FULL_DUMP, DELTA_DUMP, FIND_DELTA made type-safe as an enum.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-969) Context#FULL_DUMP, DELTA_DUMP,
FIND_DELTA as an enum
Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12683776#action_12683776 ]
Shalin Shekhar Mangar commented on SOLR-969:
--------------------------------------------
I see no advantage in maintaining an enum as well as a string. I agree that an integer is not intuitive and should be replaced by a string. It might be OK to break compatibility.
> Context#FULL_DUMP, DELTA_DUMP, FIND_DELTA as an enum
> -----------------------------------------------------
>
> Key: SOLR-969
> URL: https://issues.apache.org/jira/browse/SOLR-969
> Project: Solr
> Issue Type: Improvement
> Components: contrib - DataImportHandler
> Environment: Java 6, Tomcat 6
> Reporter: Kay Kay
> Fix For: 1.4
>
> Attachments: SOLR-969.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Context # FULL_DUMP, DELTA_DUMP, FIND_DELTA made type-safe as an enum.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-969) Context#FULL_DUMP, DELTA_DUMP,
FIND_DELTA as an enum
Posted by "Kay Kay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665185#action_12665185 ]
Kay Kay commented on SOLR-969:
------------------------------
New enum value called IMPORT_INVALID for corner cases.
> Context#FULL_DUMP, DELTA_DUMP, FIND_DELTA as an enum
> -----------------------------------------------------
>
> Key: SOLR-969
> URL: https://issues.apache.org/jira/browse/SOLR-969
> Project: Solr
> Issue Type: Improvement
> Components: contrib - DataImportHandler
> Environment: Java 6, Tomcat 6
> Reporter: Kay Kay
> Fix For: 1.4
>
> Attachments: SOLR-969.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Context # FULL_DUMP, DELTA_DUMP, FIND_DELTA made type-safe as an enum.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-969) Context#FULL_DUMP, DELTA_DUMP,
FIND_DELTA as an enum
Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665699#action_12665699 ]
Noble Paul commented on SOLR-969:
---------------------------------
All the Objects can be consumed directly from JS , just the way we use it in java .
example
{code}
<dataConfig>
<script><![CDATA[
function f1(row, context) {
var cmd = context.getVariableResolver().replaceTokens('${dataimporter.request.command}');
if(cmd == 'full-import')
row.put('message', 'The command is full-import');
return row;
}
]]></script>
<document>
<entity name="e" pk="id" transformer="script:f1" query="select * from X">
....
</entity>
</document>
</dataConfig>
{code}
Currently only a Transformer can be written in JS and that is the most common extension point.
It is hard to write a DataSource/EntityProcessor in JS . I'm interested in having an Entityprocessor written in non-java. but there has not been much interest in it.
an Eventlistener can be easily written in JS (but not yet implemented)
> Context#FULL_DUMP, DELTA_DUMP, FIND_DELTA as an enum
> -----------------------------------------------------
>
> Key: SOLR-969
> URL: https://issues.apache.org/jira/browse/SOLR-969
> Project: Solr
> Issue Type: Improvement
> Components: contrib - DataImportHandler
> Environment: Java 6, Tomcat 6
> Reporter: Kay Kay
> Fix For: 1.4
>
> Attachments: SOLR-969.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Context # FULL_DUMP, DELTA_DUMP, FIND_DELTA made type-safe as an enum.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SOLR-969) Context#FULL_DUMP, DELTA_DUMP,
FIND_DELTA as an enum
Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shalin Shekhar Mangar updated SOLR-969:
---------------------------------------
Attachment: SOLR-969.patch
Patch to change integer to strings.
> Context#FULL_DUMP, DELTA_DUMP, FIND_DELTA as an enum
> -----------------------------------------------------
>
> Key: SOLR-969
> URL: https://issues.apache.org/jira/browse/SOLR-969
> Project: Solr
> Issue Type: Improvement
> Components: contrib - DataImportHandler
> Environment: Java 6, Tomcat 6
> Reporter: Kay Kay
> Fix For: 1.4
>
> Attachments: SOLR-969.patch, SOLR-969.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Context # FULL_DUMP, DELTA_DUMP, FIND_DELTA made type-safe as an enum.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.