실시간 인벤트 처리

18
실실실 실실실 실실 실실실 [email protected] 실실실

Upload: byeongweon-moon

Post on 10-May-2015

638 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: 실시간 인벤트 처리

실시간 이벤트 처리

문병원[email protected]

레드덕

Page 2: 실시간 인벤트 처리

실시간 이벤트 처리

Page 3: 실시간 인벤트 처리

솔루션

EsperApache S4Twitter StormHStreaming

비슷함

Page 4: 실시간 인벤트 처리

Event Stream Pro-cessing

Complex Event Processing

Page 5: 실시간 인벤트 처리

Event Stream Process-ing  은 이벤트 스트림의 빠른 처리와 단순한 산술 계산에 초첨을 두고 있다 .

Page 6: 실시간 인벤트 처리

Complex Event Pro-cessing 은 패턴 분석에 주안점을 둔 데이터 분석을 포함하고 있다

Page 7: 실시간 인벤트 처리

Esper

• ESP/CEP with expressive Event Pro-cessing Language: continuous queries, aggregation, joins, causality and missing events, joins to historical data, output flow control...

• High throughput, low latency• Standalone or embedded, open API• Multi platform support

Page 8: 실시간 인벤트 처리

Computing Rates Per Feed

insert into TicksPerSecond select feed, rate(10) as cnt from MarketDataEvent group by feed

Page 9: 실시간 인벤트 처리

Detecting a Fall-off

select feed, avg(cnt) as avgCnt, cnt as feedCnt from TicksPerSecond.win:time(10 seconds) group by feed having cnt < avg(cnt) * 0.75

Page 10: 실시간 인벤트 처리

Storm

Stream processingContinuous computationDistributed RPC

Page 11: 실시간 인벤트 처리

Storm do

• Guaranteed message process-ing• Robust process management• Fault detection and automatic

reassignment• Efficient message passing• Local mode and distributed

mode

Page 12: 실시간 인벤트 처리
Page 13: 실시간 인벤트 처리
Page 14: 실시간 인벤트 처리
Page 15: 실시간 인벤트 처리

TopologyBuilder builder = new TopologyBuilder();builder.setSpout(1, new KestrelSpout("kestrel.backtype.com",                                     22133,                                     "sentence_queue",                                     new StringScheme()));builder.setBolt(2, new SplitSentence(), 10)        .shuffleGrouping(1);builder.setBolt(3, new WordCount(), 20)        .fieldsGrouping(2, new Fields("word"));

Page 16: 실시간 인벤트 처리

public class SplitSentence implements IBasicBolt {    public void execute(Tuple tuple, BasicOutputCollector collector) {        String sentence = tuple.getString(0);        for(String word: sentence.split(" ")) {            collector.emit(new Values(word));        }    }

    public void declareOutputFields(OutputFieldsDeclarer declarer) {        declarer.declare(new Fields("word"));    } }

Page 17: 실시간 인벤트 처리

public class WordCount implements IBasicBolt {    private Map<String, Integer> _counts = new HashMap<String, Integer>();

    public void execute(Tuple tuple, BasicOutputCollector collector) {        String word = tuple.getString(0);        int count;        if(_counts.containsKey(word)) {            count = _counts.get(word);        } else {            count = 0;        }        count++;        _counts.put(word, count);        collector.emit(new Values(word, count));    }

    public void declareOutputFields(OutputFieldsDeclarer declarer) {        declarer.declare(new Fields("word", "count"));    } }

Page 18: 실시간 인벤트 처리