SlideShare una empresa de Scribd logo
1 de 14
Descargar para leer sin conexión
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?

Más contenido relacionado

La actualidad más candente

เกมส์จับคู่
เกมส์จับคู่เกมส์จับคู่
เกมส์จับคู่
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
 

La actualidad más candente (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
 

Destacado

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
 

Destacado (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
 

Similar a 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
 

Similar a 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
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

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