[
https://issues.apache.org/jira/browse/S4-5?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172660#comment-13172660
]
Leo Neumeyer commented on S4-5:
-------------------------------
Implemented GenericKeyFinder to specify event fields of primitive types as
strings OR event attribute keys as strings. Supported in the std and fluent
APIs. (Event attributes are key-value pairs with typed values set in the base
Event class.) First it checks if there is a a field that matches the name and
returns the value as a String. Otherwise checks if there is an attribute that
matches the key name and returns the value as a String. Otherwise it fails at
runtime. (It is still desirable to use the type safe KeyFinder for production
work but the string descriptor is handy for rapid prototyping.)
Example:
Fluent API using KeyFinder class:
{code}
generateUserEventPE.emit(UserEvent.class).onKey(new
GenderKeyFinder()).to(ageCountPE);
{code}
Fluent API using string descriptor:
{code}
generateUserEventPE.emit(UserEvent.class).onKey("gender").to(genderCountPE);
{code}
Standard API using KeyFinder:
{code}
Stream<UserEvent> genderStream = createStream(UserEvent.class);
genderStream.setName("Gender Stream");
genderStream.setKey(new GenderKeyFinder());
genderStream.setPE(genderCountPE);
{code}
Standard API using string descriptor:
{code}
Stream<UserEvent> genderStream = createStream(UserEvent.class);
genderStream.setName("Gender Stream");
genderStream.setKey("gender");
genderStream.setPE(genderCountPE);
{code}
> Prototype app builder
> ---------------------
>
> Key: S4-5
> URL: https://issues.apache.org/jira/browse/S4-5
> Project: Apache S4
> Issue Type: New Feature
> Affects Versions: 0.5
> Reporter: Leo Neumeyer
> Priority: Minor
> Fix For: 0.5
>
>
> Extend Guice AbstractModule to create a simple application builder layer. The
> idea is to evaluate if we can use Guice to do all the wiring including PEs
> and Streams and Apps.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira