[aura-dev] Map/Reduce with JSR223?
- From: Jeffrey Alexander <jeff.alexander@sun.com>
- To: dev@aura.kenai.com
- Subject: [aura-dev] Map/Reduce with JSR223?
- Date: Wed, 10 Jun 2009 15:41:36 -0400
So Francois was looking to run a query that I claimed would require the
DataStore to have specific knowledge about a type that it treats
opaquely. Specifically, he wanted to get a total count of "listens"
between a user and a song. No problem, except that he wants to store
multiple listens per attention (using the opaque num field). We don't
want to return all those attention objects back and require that they
get counted by the client, and we don't want to put specific code for
that in the data store. What if we wanted to be a little more
map-reducey and run some custom code at the replicant level?
Enter JSR223:
http://java.sun.com/developer/technicalArticles/J2SE/Desktop/scripting/
This would allow us to add a method called something like "Object
processAttention(AttentionConfig aC, StringBuffer script)".
The script can contain methods that can be invoked with arguments, so a
method could be called for each Attention that matches the
AttentionConfig, passing in some collector object (a HashMap?) each time
to accumulate results. The methods can return the collector object from
the Replicants. The DataStoreHead can invoke a reducer method on the
script, passing in all the collector objects from each partition. That
method can in turn return a different Object as a result that the
original caller would know how to interpret.
Is this insane? Is this brilliant? Could it apply to other problems,
or would the scripting interface dumb it down too much?
Jeff
p.s. this mailing list should now put [aura-dev] on all messages.
|
[aura-dev] Map/Reduce with JSR223? |
Jeffrey Alexander | 06/10/2009 |
| Jeffrey Alexander | 06/16/2009 | |
| Jeffrey Alexander | 06/16/2009 | |
| Jeffrey Alexander | 06/17/2009 |





