You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Doron Cohen (JIRA)" <ji...@apache.org> on 2011/03/10 18:10:59 UTC
[jira] Created: (LUCENE-2964) Allow benchmark tasks from packages
Allow benchmark tasks from packages
-----------------------------------
Key: LUCENE-2964
URL: https://issues.apache.org/jira/browse/LUCENE-2964
Project: Lucene - Java
Issue Type: Improvement
Components: contrib/benchmark
Reporter: Doron Cohen
Assignee: Doron Cohen
Priority: Minor
Relax current limitation of all tasks in same package - that of PerfTask.
Add a property "alt.tasks.packages" - its value are comma separated full package names.
If the task class is not found in the default package, an attempt is made to load it from the alternate packages specified in that property.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] Updated: (LUCENE-2964) Allow benchmark tasks from
alternative packages
Posted by "Doron Cohen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2964?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Doron Cohen updated LUCENE-2964:
--------------------------------
Attachment: LUCENE-2964.patch
Patch implements this relaxation.
It is working for me conveniently.
To do:
# add a test
# update the package documentation about this property
> Allow benchmark tasks from alternative packages
> -----------------------------------------------
>
> Key: LUCENE-2964
> URL: https://issues.apache.org/jira/browse/LUCENE-2964
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/benchmark
> Reporter: Doron Cohen
> Assignee: Doron Cohen
> Priority: Minor
> Fix For: 3.2, 4.0
>
> Attachments: LUCENE-2964.patch
>
>
> Relax current limitation of all tasks in same package - that of PerfTask.
> Add a property "alt.tasks.packages" - its value are comma separated full package names.
> If the task class is not found in the default package, an attempt is made to load it from the alternate packages specified in that property.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Resolved] (LUCENE-2964) Allow benchmark tasks from
alternative packages
Posted by "Doron Cohen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2964?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Doron Cohen resolved LUCENE-2964.
---------------------------------
Resolution: Fixed
Committed:
- r1083726 - 3x
- r1083731 - trunk
(Hudson's Lucene-Solr-tests-only-trunk #6185 passed the new Benchmarks tests.)
> Allow benchmark tasks from alternative packages
> -----------------------------------------------
>
> Key: LUCENE-2964
> URL: https://issues.apache.org/jira/browse/LUCENE-2964
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/benchmark
> Reporter: Doron Cohen
> Assignee: Doron Cohen
> Priority: Minor
> Fix For: 3.2, 4.0
>
> Attachments: LUCENE-2964.patch, LUCENE-2964.patch, LUCENE-2964.patch
>
>
> Relax current limitation of all tasks in same package - that of PerfTask.
> Add a property "alt.tasks.packages" - its value are comma separated full package names.
> If the task class is not found in the default package, an attempt is made to load it from the alternate packages specified in that property.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Updated] (LUCENE-2964) Allow benchmark tasks from
alternative packages
Posted by "Doron Cohen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2964?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Doron Cohen updated LUCENE-2964:
--------------------------------
Attachment: LUCENE-2964.patch
Updated patch, fixing per Shai suggestion on the exception.
Planning to commit shortly.
> Allow benchmark tasks from alternative packages
> -----------------------------------------------
>
> Key: LUCENE-2964
> URL: https://issues.apache.org/jira/browse/LUCENE-2964
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/benchmark
> Reporter: Doron Cohen
> Assignee: Doron Cohen
> Priority: Minor
> Fix For: 3.2, 4.0
>
> Attachments: LUCENE-2964.patch, LUCENE-2964.patch, LUCENE-2964.patch
>
>
> Relax current limitation of all tasks in same package - that of PerfTask.
> Add a property "alt.tasks.packages" - its value are comma separated full package names.
> If the task class is not found in the default package, an attempt is made to load it from the alternate packages specified in that property.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] Commented: (LUCENE-2964) Allow benchmark tasks from
alternative packages
Posted by "Shai Erera (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005220#comment-13005220 ]
Shai Erera commented on LUCENE-2964:
------------------------------------
Big +1 !
What a nice addition Doron. Now I can change my benchmark code to stop looking like I hack Lucene w/ those package names.
About the patch, looks good. I have two questions:
# Can you pass 'null' to config.get() and then just compare the 'alt' to null in the next line?
# Maybe instead of this 'fallback' logic, you always create a packages[] array with the first package being that of PerfTask? Then you can loop over all packages until the first one succeeds. Since this is not a hotspot section (executed once when algorithm is parsed), I think perf-wise we should be ok. It will also mean looking up the alt package names in the config before this method is invoked ...
# I'd add a comment to the javadocs that if someone uses the same task name by two packages, then whichever is found first is used.
> Allow benchmark tasks from alternative packages
> -----------------------------------------------
>
> Key: LUCENE-2964
> URL: https://issues.apache.org/jira/browse/LUCENE-2964
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/benchmark
> Reporter: Doron Cohen
> Assignee: Doron Cohen
> Priority: Minor
> Fix For: 3.2, 4.0
>
> Attachments: LUCENE-2964.patch
>
>
> Relax current limitation of all tasks in same package - that of PerfTask.
> Add a property "alt.tasks.packages" - its value are comma separated full package names.
> If the task class is not found in the default package, an attempt is made to load it from the alternate packages specified in that property.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-2964) Allow benchmark tasks from
alternative packages
Posted by "Doron Cohen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009062#comment-13009062 ]
Doron Cohen commented on LUCENE-2964:
-------------------------------------
Apparently using '$' is safe in that it is always correct as this is the standard definition for inner class separator - see [Inner Classes Specification | http://www.retrologic.com/innerclasses.doc7.html].
The required change to the Benchmark Algorithm is to define '$' as a word part, by adding this to the Algorithm's tokenizer intialization:
{code}
stok.wordChars('$','$');
{code}
I am not sure about this.
It would allow easier creation of tasks as inner classes.
But this is mainly for tests I assume, because for real tasks one would want them to read nicely - without that '$' and to have their own class file.
And making '$' a regular word char just for this test need, will prevent us from adding some semantics to it in the future, should the need arise,
So, I rather keep the additional class file in the test package.
> Allow benchmark tasks from alternative packages
> -----------------------------------------------
>
> Key: LUCENE-2964
> URL: https://issues.apache.org/jira/browse/LUCENE-2964
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/benchmark
> Reporter: Doron Cohen
> Assignee: Doron Cohen
> Priority: Minor
> Fix For: 3.2, 4.0
>
> Attachments: LUCENE-2964.patch, LUCENE-2964.patch
>
>
> Relax current limitation of all tasks in same package - that of PerfTask.
> Add a property "alt.tasks.packages" - its value are comma separated full package names.
> If the task class is not found in the default package, an attempt is made to load it from the alternate packages specified in that property.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-2964) Allow benchmark tasks from
alternative packages
Posted by "Shai Erera (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009020#comment-13009020 ]
Shai Erera commented on LUCENE-2964:
------------------------------------
Patch looks good and nice updates to package.html !
In Algorithm.taskClass, I see that you store the CNFE and later reference it in the thrown CNFE (if the class wasn't found in all package). I think it's redundant? Because if I specify 4 alt packages and the task is not in any of them, the referenced error will be of the last one, which is just confusing. The CNFE message that you pass is already descriptive enough, IMO.
Can we put AltTestTask an inner public static member of AltPackageTaskTest?
> Allow benchmark tasks from alternative packages
> -----------------------------------------------
>
> Key: LUCENE-2964
> URL: https://issues.apache.org/jira/browse/LUCENE-2964
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/benchmark
> Reporter: Doron Cohen
> Assignee: Doron Cohen
> Priority: Minor
> Fix For: 3.2, 4.0
>
> Attachments: LUCENE-2964.patch, LUCENE-2964.patch
>
>
> Relax current limitation of all tasks in same package - that of PerfTask.
> Add a property "alt.tasks.packages" - its value are comma separated full package names.
> If the task class is not found in the default package, an attempt is made to load it from the alternate packages specified in that property.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] Updated: (LUCENE-2964) Allow benchmark tasks from
alternative packages
Posted by "Doron Cohen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2964?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Doron Cohen updated LUCENE-2964:
--------------------------------
Fix Version/s: 4.0
3.2
Summary: Allow benchmark tasks from alternative packages (was: Allow benchmark tasks from packages)
> Allow benchmark tasks from alternative packages
> -----------------------------------------------
>
> Key: LUCENE-2964
> URL: https://issues.apache.org/jira/browse/LUCENE-2964
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/benchmark
> Reporter: Doron Cohen
> Assignee: Doron Cohen
> Priority: Minor
> Fix For: 3.2, 4.0
>
>
> Relax current limitation of all tasks in same package - that of PerfTask.
> Add a property "alt.tasks.packages" - its value are comma separated full package names.
> If the task class is not found in the default package, an attempt is made to load it from the alternate packages specified in that property.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-2964) Allow benchmark tasks from
alternative packages
Posted by "Doron Cohen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009060#comment-13009060 ]
Doron Cohen commented on LUCENE-2964:
-------------------------------------
Thanks for reviewing.
bq. The CNFE message that you pass is already descriptive enough, IMO.
Agree, I'll change that.
bq. put AltTestTask an inner public static member of AltPackageTaskTest
This makes sense - but is tricky, as the alg line should now look like this:
{code}
String altTask = "{ AltPackageTaskTest$AltTest }"; // inner class peculiarities - '$' as separator
{code}
Which is rather not too nice (took me some time to figure why just *AltPackageTaskTest.AltTest* fails).
But in addition, *$* causes the Algorithm's tokenizer to break that into two task names, I am not sure it is worth to modify it for removing that test class, but I'll give it a few more minutes.
> Allow benchmark tasks from alternative packages
> -----------------------------------------------
>
> Key: LUCENE-2964
> URL: https://issues.apache.org/jira/browse/LUCENE-2964
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/benchmark
> Reporter: Doron Cohen
> Assignee: Doron Cohen
> Priority: Minor
> Fix For: 3.2, 4.0
>
> Attachments: LUCENE-2964.patch, LUCENE-2964.patch
>
>
> Relax current limitation of all tasks in same package - that of PerfTask.
> Add a property "alt.tasks.packages" - its value are comma separated full package names.
> If the task class is not found in the default package, an attempt is made to load it from the alternate packages specified in that property.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-2964) Allow benchmark tasks from
alternative packages
Posted by "Shai Erera (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009080#comment-13009080 ]
Shai Erera commented on LUCENE-2964:
------------------------------------
bq. So, I rather keep the additional class file in the test package.
I'm fine with it.
> Allow benchmark tasks from alternative packages
> -----------------------------------------------
>
> Key: LUCENE-2964
> URL: https://issues.apache.org/jira/browse/LUCENE-2964
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/benchmark
> Reporter: Doron Cohen
> Assignee: Doron Cohen
> Priority: Minor
> Fix For: 3.2, 4.0
>
> Attachments: LUCENE-2964.patch, LUCENE-2964.patch, LUCENE-2964.patch
>
>
> Relax current limitation of all tasks in same package - that of PerfTask.
> Add a property "alt.tasks.packages" - its value are comma separated full package names.
> If the task class is not found in the default package, an attempt is made to load it from the alternate packages specified in that property.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Updated] (LUCENE-2964) Allow benchmark tasks from
alternative packages
Posted by "Doron Cohen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2964?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Doron Cohen updated LUCENE-2964:
--------------------------------
Attachment: LUCENE-2964.patch
Thanks Shai for the review!
Followed all your suggestions, it indeed made the code simpler.
Also added a test case and a Changes entry,
> Allow benchmark tasks from alternative packages
> -----------------------------------------------
>
> Key: LUCENE-2964
> URL: https://issues.apache.org/jira/browse/LUCENE-2964
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/benchmark
> Reporter: Doron Cohen
> Assignee: Doron Cohen
> Priority: Minor
> Fix For: 3.2, 4.0
>
> Attachments: LUCENE-2964.patch, LUCENE-2964.patch
>
>
> Relax current limitation of all tasks in same package - that of PerfTask.
> Add a property "alt.tasks.packages" - its value are comma separated full package names.
> If the task class is not found in the default package, an attempt is made to load it from the alternate packages specified in that property.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org