incubator-s4-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 杨定裕 <yangdin...@gmail.com>
Subject Re: How to use S4 to implement Join operator
Date Thu, 04 Oct 2012 04:18:36 GMT
Hi, Shailendra,
Yes, I have a stream with two event types:lineitem and order. The same key
will be sent to same PE.

this is the code of mine:
---------------------------
    private List<Event> T_lineitem = new ArrayList<Event>();
    private List<Event> T_order = new ArrayList<Event>();
    private long count = 0;

    public void onEvent(Event event) {
        // in this example, we use the default generic Event type, by you
can also define your own type
        String value = "";
        count = count+1;
        try{
            value = event.get("lineitem").replace("|","&").split("&")[0];

            T_lineitem.add(event);
            System.out.println("JoinPE------:Table:!||| T_lineitem.size():
"+T_lineitem.size()+"||| PEID:"+getId()+"||| count:"+count);
        }catch(Exception e){

        }
        try{
            value = event.get("order").replace("|","&").split("&")[0];
            T_order.add(event);
            System.out.println("oinPE------:Table:!||| T_order.size():
"+T_order.size()+"||| PEID:"+getId()+"||| count:"+count);


        }catch(Exception e){

        }
}
-----------------------------

The output is like this :
JoinPE------:Table:!||| T_lineitem.size(): 19||| PEID:7||| count:1
JoinPE------:Table:!||| T_lineitem.size(): 20||| PEID:7||| count:2

That is the problem, count should be more than the size of list.

Dingyu

Mime
View raw message