SlideShare une entreprise Scribd logo
1  sur  14
Télécharger pour lire hors ligne
Apache Storm 
A Brief Introduction
What Is Storm 
● Distributed 
● Stream Oriented 
● Real Time* 
● Scalable 
● Reliable**
Topologies 
● Storm’s equivalent of an application 
○ Consists of Components (Spouts and Bolts) 
■ parallelism 
■ Data represented as streams of tuples
Spouts 
● Spouts 
○ Expose an external input source 
■ An unbounded stream of data 
○ Are polled, by storm, for their next Tuple 
○ Produce one or more streams of Tuples 
○ Notified when a Tuple is completely processed 
○ Notified when a Tuple fails to be processed
Bolts 
● Bolts 
○ Subscribes to one or more Streams 
■ Grouped by all, randomly, or by Field values 
○ Produces zero or more Streams 
○ Single threaded execution per instance
An Example 
Classic word count: 
Lets assume we have an unbounded incoming stream of 
sentences and we want to have a constantly updated count 
of the words found in the text. 
Code: 
https://github.com/apache/storm/blob/master/examples/storm-starter/src/jvm/storm/starter/WordCountTopology.java
Building a topology 
We provide a description of the topology to be 
deployed via the fluent TopologyBuilder class. 
TopologyBuilder builder = new TopologyBuilder();
Spout 
First we’ll create a spout to generate random 
sentences and add it to the topology 
public class RandomSentenceSpout extends BaseRichSpout { 
… 
public void nextTuple() { 
String[] sentences = new String[]{ "the cow jumped over the moon", "an apple a day keeps the doctor away", 
"four score and seven years ago", "snow white and the seven dwarfs", "i am at two with nature" }; 
String sentence = sentences[_rand.nextInt(sentences.length)]; 
_collector.emit(new Values(sentence)); 
} 
… 
} 
builder.setSpout("spout", new RandomSentenceSpout(), 5);
Split Messages 
Next we’ll split each item into words. 
The example is in python, here it is in Java: 
public static class SplitSentence extends BaseBasicBolt { 
... 
public void execute(Tuple tuple, BasicOutputCollector collector) { 
String sentence = tuple.getString(0); 
for (String word : sentence.split(“s”)) { 
collector.emit(new Values(word)); 
} 
} 
... 
} 
builder.setBolt("split", new SplitSentence(), 8).shuffleGrouping("spout");
Count Words 
Now we can count the words 
public static class WordCount extends BaseBasicBolt { 
Map<String, Integer> counts = new HashMap<String, Integer>(); 
public void execute(Tuple tuple, BasicOutputCollector collector) { 
String word = tuple.getString(0); 
Integer count = counts.get(word); 
if (count == null) 
count = 0; 
count++; 
counts.put(word, count); 
collector.emit(new Values(word, count)); 
} 
... 
} 
builder.setBolt("count", new WordCount(), 12).fieldsGrouping("split", new Fields("word"));
Discussion 
● Component Lifecycle Events 
● In Memory State 
● Deployment view
Ecosystem 
● Trident 
● SummingBird
Alternatives 
● Spark Streaming
Questions? 
comments, concerns or criticisms?

Contenu connexe

Tendances

เกมส์จับคู่
เกมส์จับคู่เกมส์จับคู่
เกมส์จับคู่
Aeew Autaporn
 
In class, we discussed min-heaps. In a min-heap the element of the heap with ...
In class, we discussed min-heaps. In a min-heap the element of the heap with ...In class, we discussed min-heaps. In a min-heap the element of the heap with ...
In class, we discussed min-heaps. In a min-heap the element of the heap with ...
licservernoida
 

Tendances (20)

Glusterfs session #5 inode t, fd-t lifecycles
Glusterfs session #5   inode t, fd-t lifecyclesGlusterfs session #5   inode t, fd-t lifecycles
Glusterfs session #5 inode t, fd-t lifecycles
 
Sorter
SorterSorter
Sorter
 
Java 7 new features
Java 7 new featuresJava 7 new features
Java 7 new features
 
1 sample16c132 java-programming
1 sample16c132 java-programming1 sample16c132 java-programming
1 sample16c132 java-programming
 
Devry gsp 215 week 6 i lab virtual memory new
Devry gsp 215 week 6 i lab virtual memory newDevry gsp 215 week 6 i lab virtual memory new
Devry gsp 215 week 6 i lab virtual memory new
 
Ns2 ns3 training in mohali
Ns2 ns3 training in mohaliNs2 ns3 training in mohali
Ns2 ns3 training in mohali
 
ReactPHP – reaktor jądrowy w PHP
ReactPHP – reaktor jądrowy w PHPReactPHP – reaktor jądrowy w PHP
ReactPHP – reaktor jądrowy w PHP
 
เกมส์จับคู่
เกมส์จับคู่เกมส์จับคู่
เกมส์จับคู่
 
Glusterfs session #9 index xlator
Glusterfs session #9   index xlatorGlusterfs session #9   index xlator
Glusterfs session #9 index xlator
 
Network simulator 2
Network simulator 2Network simulator 2
Network simulator 2
 
Network simulator 2
Network simulator 2Network simulator 2
Network simulator 2
 
Stack Data structure
Stack Data structureStack Data structure
Stack Data structure
 
Java Week9(A) Notepad
Java Week9(A)   NotepadJava Week9(A)   Notepad
Java Week9(A) Notepad
 
Coding convention
Coding conventionCoding convention
Coding convention
 
Åsted .Net (CSI .Net)
Åsted .Net (CSI .Net)Åsted .Net (CSI .Net)
Åsted .Net (CSI .Net)
 
Sorter
SorterSorter
Sorter
 
Netty: asynchronous data transfer
Netty: asynchronous data transferNetty: asynchronous data transfer
Netty: asynchronous data transfer
 
In class, we discussed min-heaps. In a min-heap the element of the heap with ...
In class, we discussed min-heaps. In a min-heap the element of the heap with ...In class, we discussed min-heaps. In a min-heap the element of the heap with ...
In class, we discussed min-heaps. In a min-heap the element of the heap with ...
 
Creating a Name seperator Custom Control using C#
Creating a Name seperator Custom Control using C#Creating a Name seperator Custom Control using C#
Creating a Name seperator Custom Control using C#
 
A698111855 22750 26_2018_finite
A698111855 22750 26_2018_finiteA698111855 22750 26_2018_finite
A698111855 22750 26_2018_finite
 

En vedette

Presentasi sej pemikiran islam
Presentasi   sej pemikiran islamPresentasi   sej pemikiran islam
Presentasi sej pemikiran islam
Ni'matul Kediri
 
Patagonia's H2No Digital marketing plan
Patagonia's H2No Digital marketing planPatagonia's H2No Digital marketing plan
Patagonia's H2No Digital marketing plan
Damon Huber
 
Presentasi ku manajemen pai
Presentasi  ku manajemen paiPresentasi  ku manajemen pai
Presentasi ku manajemen pai
Ni'matul Kediri
 
Història escola sant esteve
Història escola sant esteveHistòria escola sant esteve
Història escola sant esteve
comunitat
 
Music magazine genres
Music magazine genresMusic magazine genres
Music magazine genres
emmalouise0
 
Catch Up_Epilogue
Catch Up_EpilogueCatch Up_Epilogue
Catch Up_Epilogue
Mina Lee
 
Projection of solids
Projection of solidsProjection of solids
Projection of solids
Sumit Chandak
 

En vedette (17)

проекторы
проекторы проекторы
проекторы
 
FARO 3D Metrology Solutions
FARO 3D Metrology SolutionsFARO 3D Metrology Solutions
FARO 3D Metrology Solutions
 
Presentasi sej pemikiran islam
Presentasi   sej pemikiran islamPresentasi   sej pemikiran islam
Presentasi sej pemikiran islam
 
Patagonia's H2No Digital marketing plan
Patagonia's H2No Digital marketing planPatagonia's H2No Digital marketing plan
Patagonia's H2No Digital marketing plan
 
Presentasi ku manajemen pai
Presentasi  ku manajemen paiPresentasi  ku manajemen pai
Presentasi ku manajemen pai
 
Història escola sant esteve
Història escola sant esteveHistòria escola sant esteve
Història escola sant esteve
 
Accounting ppt
Accounting pptAccounting ppt
Accounting ppt
 
мониторы
мониторымониторы
мониторы
 
Music magazine genres
Music magazine genresMusic magazine genres
Music magazine genres
 
Case app cirrus aircraft
Case app cirrus aircraft Case app cirrus aircraft
Case app cirrus aircraft
 
Catch Up_Epilogue
Catch Up_EpilogueCatch Up_Epilogue
Catch Up_Epilogue
 
Autocad
AutocadAutocad
Autocad
 
Projection of solids
Projection of solidsProjection of solids
Projection of solids
 
Mary shelley percy Shelley
Mary shelley percy ShelleyMary shelley percy Shelley
Mary shelley percy Shelley
 
Accounting ppt
Accounting pptAccounting ppt
Accounting ppt
 
Viva questions
Viva questionsViva questions
Viva questions
 
Project on sales promotion in big bazaar
Project on sales promotion in big bazaarProject on sales promotion in big bazaar
Project on sales promotion in big bazaar
 

Similaire à Storm introduction

Streams processing with Storm
Streams processing with StormStreams processing with Storm
Streams processing with Storm
Mariusz Gil
 
forwarder.java.txt java forwarder class waits for an in.docx
forwarder.java.txt java forwarder class waits for an in.docxforwarder.java.txt java forwarder class waits for an in.docx
forwarder.java.txt java forwarder class waits for an in.docx
budbarber38650
 

Similaire à Storm introduction (20)

Introduction to Apache Storm
Introduction to Apache StormIntroduction to Apache Storm
Introduction to Apache Storm
 
Real time stream processing presentation at General Assemb.ly
Real time stream processing presentation at General Assemb.lyReal time stream processing presentation at General Assemb.ly
Real time stream processing presentation at General Assemb.ly
 
Storm
StormStorm
Storm
 
Apache Storm Tutorial
Apache Storm TutorialApache Storm Tutorial
Apache Storm Tutorial
 
Real time and reliable processing with Apache Storm
Real time and reliable processing with Apache StormReal time and reliable processing with Apache Storm
Real time and reliable processing with Apache Storm
 
PigSPARQL: A SPARQL Query Processing Baseline for Big Data
PigSPARQL: A SPARQL Query Processing Baseline for Big DataPigSPARQL: A SPARQL Query Processing Baseline for Big Data
PigSPARQL: A SPARQL Query Processing Baseline for Big Data
 
storm-170531123446.pptx
storm-170531123446.pptxstorm-170531123446.pptx
storm-170531123446.pptx
 
Storm Anatomy
Storm AnatomyStorm Anatomy
Storm Anatomy
 
Real-Time Streaming with Apache Spark Streaming and Apache Storm
Real-Time Streaming with Apache Spark Streaming and Apache StormReal-Time Streaming with Apache Spark Streaming and Apache Storm
Real-Time Streaming with Apache Spark Streaming and Apache Storm
 
Sinfonier: How I turned my grandmother into a data analyst - Fran J. Gomez - ...
Sinfonier: How I turned my grandmother into a data analyst - Fran J. Gomez - ...Sinfonier: How I turned my grandmother into a data analyst - Fran J. Gomez - ...
Sinfonier: How I turned my grandmother into a data analyst - Fran J. Gomez - ...
 
Thread
ThreadThread
Thread
 
Streams processing with Storm
Streams processing with StormStreams processing with Storm
Streams processing with Storm
 
forwarder.java.txt java forwarder class waits for an in.docx
forwarder.java.txt java forwarder class waits for an in.docxforwarder.java.txt java forwarder class waits for an in.docx
forwarder.java.txt java forwarder class waits for an in.docx
 
Java 7 & 8 New Features
Java 7 & 8 New FeaturesJava 7 & 8 New Features
Java 7 & 8 New Features
 
Distributed Realtime Computation using Apache Storm
Distributed Realtime Computation using Apache StormDistributed Realtime Computation using Apache Storm
Distributed Realtime Computation using Apache Storm
 
Intro to Apache Storm
Intro to Apache StormIntro to Apache Storm
Intro to Apache Storm
 
Java
JavaJava
Java
 
BWB Meetup: Storm - distributed realtime computation system
BWB Meetup: Storm - distributed realtime computation systemBWB Meetup: Storm - distributed realtime computation system
BWB Meetup: Storm - distributed realtime computation system
 
My lecture stack_queue_operation
My lecture stack_queue_operationMy lecture stack_queue_operation
My lecture stack_queue_operation
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 

Storm introduction

  • 1. Apache Storm A Brief Introduction
  • 2. What Is Storm ● Distributed ● Stream Oriented ● Real Time* ● Scalable ● Reliable**
  • 3. Topologies ● Storm’s equivalent of an application ○ Consists of Components (Spouts and Bolts) ■ parallelism ■ Data represented as streams of tuples
  • 4. Spouts ● Spouts ○ Expose an external input source ■ An unbounded stream of data ○ Are polled, by storm, for their next Tuple ○ Produce one or more streams of Tuples ○ Notified when a Tuple is completely processed ○ Notified when a Tuple fails to be processed
  • 5. Bolts ● Bolts ○ Subscribes to one or more Streams ■ Grouped by all, randomly, or by Field values ○ Produces zero or more Streams ○ Single threaded execution per instance
  • 6. An Example Classic word count: Lets assume we have an unbounded incoming stream of sentences and we want to have a constantly updated count of the words found in the text. Code: https://github.com/apache/storm/blob/master/examples/storm-starter/src/jvm/storm/starter/WordCountTopology.java
  • 7. Building a topology We provide a description of the topology to be deployed via the fluent TopologyBuilder class. TopologyBuilder builder = new TopologyBuilder();
  • 8. Spout First we’ll create a spout to generate random sentences and add it to the topology public class RandomSentenceSpout extends BaseRichSpout { … public void nextTuple() { String[] sentences = new String[]{ "the cow jumped over the moon", "an apple a day keeps the doctor away", "four score and seven years ago", "snow white and the seven dwarfs", "i am at two with nature" }; String sentence = sentences[_rand.nextInt(sentences.length)]; _collector.emit(new Values(sentence)); } … } builder.setSpout("spout", new RandomSentenceSpout(), 5);
  • 9. Split Messages Next we’ll split each item into words. The example is in python, here it is in Java: public static class SplitSentence extends BaseBasicBolt { ... public void execute(Tuple tuple, BasicOutputCollector collector) { String sentence = tuple.getString(0); for (String word : sentence.split(“s”)) { collector.emit(new Values(word)); } } ... } builder.setBolt("split", new SplitSentence(), 8).shuffleGrouping("spout");
  • 10. Count Words Now we can count the words public static class WordCount extends BaseBasicBolt { Map<String, Integer> counts = new HashMap<String, Integer>(); public void execute(Tuple tuple, BasicOutputCollector collector) { String word = tuple.getString(0); Integer count = counts.get(word); if (count == null) count = 0; count++; counts.put(word, count); collector.emit(new Values(word, count)); } ... } builder.setBolt("count", new WordCount(), 12).fieldsGrouping("split", new Fields("word"));
  • 11. Discussion ● Component Lifecycle Events ● In Memory State ● Deployment view
  • 12. Ecosystem ● Trident ● SummingBird