[ 
https://issues.apache.org/jira/browse/S4-5?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13403944#comment-13403944
 ] 

Matthieu Morel commented on S4-5:
---------------------------------

I had a new look at the edsl framework and added, in branch S4-5-alt:
* a simple word count test ported from core
* re-enabled the CounterApp from example subproject

Things work ok but I did the following modification:
* AppBuilder (and affected PEs): changed the type of the stream field to 
{{Stream<Event>}} instead of {{Stream<Event>[]}} . Indeed, I don't really see 
the need for using arrays of streams. Is there a reason for that? Should we 
keep this modification? 




For info, here is the code for the word count example with EDSL:
{code}
pe("Classifier").type(WordClassifierPE.class).pe("Counter").type(WordCounterPE.class)
                
.emit(WordCountEvent.class).withKeyFinder(WordCountKeyFinder.class).to("Classifier")
                
.pe("Splitter").type(WordSplitterPE.class).emit(WordSeenEvent.class)
                .withKeyFinder(WordSeenKeyFinder.class).to("Counter").build();
        Stream<StringEvent> sentenceStream = createStream("sentences stream", 
new SentenceKeyFinder(),
                getPE("Splitter"));
{code}

(I'm not sure how to create the "sentences stream" as an entry point to the PE 
graph).

Here is the same without EDSL:
{code}
WordClassifierPE wordClassifierPrototype = createPE(WordClassifierPE.class);
        Stream<WordCountEvent> wordCountStream = createStream("words counts 
stream", new WordCountKeyFinder(),
                wordClassifierPrototype);
        WordCounterPE wordCounterPrototype = createPE(WordCounterPE.class);
        wordCounterPrototype.setWordClassifierStream(wordCountStream);
        Stream<WordSeenEvent> wordSeenStream = createStream("words seen 
stream", new WordSeenKeyFinder(),
                wordCounterPrototype);
        WordSplitterPE wordSplitterPrototype = createPE(WordSplitterPE.class);
        wordSplitterPrototype.setWordSeenStream(wordSeenStream);
        Stream<StringEvent> sentenceStream = createStream("sentences stream", 
new SentenceKeyFinder(),
                wordSplitterPrototype);
{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
>
>         Attachments: s4-app.png, s4-fluent.pdf
>
>
> 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

        

Reply via email to