Package com.alipay.dw.jstorm.example.sequence.bean

Examples of com.alipay.dw.jstorm.example.sequence.bean.TradeCustomer


      Long tupleId = tuple.getLong(0);
      Object obj = tuple.getValue(1);
     
      if (obj instanceof TradeCustomer) {
     
          TradeCustomer tradeCustomer = (TradeCustomer)obj;
         
          Pair trade = tradeCustomer.getTrade();
          Pair customer = tradeCustomer.getCustomer();
           
            collector.emit(SequenceTopologyDef.TRADE_STREAM_ID,
                    new Values(tupleId, trade));
           
            collector.emit(SequenceTopologyDef.CUSTOMER_STREAM_ID,
View Full Code Here


        customerSum.addAndGet(customer.getValue());
       
        collector.ack(tradeTuple);
        collector.ack(customerTuple);
       
        TradeCustomer tradeCustomer = new TradeCustomer();
        tradeCustomer.setTrade(trade);
        tradeCustomer.setCustomer(customer);
        collector.emit(new Values(tupleId, tradeCustomer));
    }
View Full Code Here

              LOG.error("LastTupleId is " + lastTupleId + ", but now:" + tupleId);
            }
            lastTupleId = tupleId;
      }

        TradeCustomer tradeCustomer = (TradeCustomer) input.getValue(1);
       
        tradeSum.addAndGet(tradeCustomer.getTrade().getValue());
        customerSum.addAndGet(tradeCustomer.getCustomer().getValue());
       
        collector.ack(input);
       
        long now = System.currentTimeMillis();
        long spend = now - tradeCustomer.getTimestamp();
       
        tpsCounter.count(spend);
       
//        long spend = System.currentTimeMillis() - input.getLong(0);
//        tpsCounter.count(spend);
View Full Code Here

   

    Pair trade = PairMaker.makeTradeInstance();
    Pair customer = PairMaker.makeCustomerInstance();

    TradeCustomer tradeCustomer = new TradeCustomer();
    tradeCustomer.setTrade(trade);
    tradeCustomer.setCustomer(customer);
    tradeCustomer.setBuffer(buffer);

    tradeSum.addAndGet(trade.getValue());
    customerSum.addAndGet(customer.getValue());

    collector.emit(new Values(tupleId, tradeCustomer),
View Full Code Here

TOP

Related Classes of com.alipay.dw.jstorm.example.sequence.bean.TradeCustomer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.