際際滷

際際滷Share a Scribd company logo
Punch clock for
Apache storm
<just an idea>
Punch clock (a.ka. time clock)
Punch clock (a.ka. time clock)
 You have a card per person.
Punch clock (a.ka. time clock)
 You have a card per person.
 The person punches IN with the card when
he/she enters the office.
Punch clock (a.ka. time clock)
 You have a card per person.
 The person punches IN with the card when
he/she enters the office.
 The person punches OUT with the card
when he/she leaves the office.
Punch clock (a.ka. time clock)
 You have a card per person.
 The person punches IN with the card when
he/she enters the office.
 The person punches OUT with the card
when he/she leaves the office.
 The punch clock records the time of
entry/exit on the card
Motivation
To Find out
Motivation
To Find out 
1. When did the Person enter / exit the office ?
Motivation
To Find out 
1. When did the Person enter / exit the office ?
2. Who is still in office ?
Change of Context
Apache Storm
Tuples going In & Out
of Spouts/Bolts
Motivation
Debugging Apache Storm*
* Debugging Storm
Transactional Topologies
Debugging Transactional Topologies
Debugging Transactional Topologies
1. Spout emits a batch of data(tuples) which forms a
transaction.
Debugging Transactional Topologies
1. Spout emits a batch of data(tuples) which forms a
transaction.
2. Every Bolt in the topology processes that batch of data
(tuples).
Motivation
To Find out
Motivation
To Find out 
1. When did the batch enter/exit the Spout/Bolt ?
Motivation
To Find out 
1. When did the batch enter/exit the Spout/Bolt ?
2. Which batch is still in the Spout/Bolt? i.e. are any batches STUCK ?
Motivation
To Find out 
1. When did the batch enter/exit the Spout/Bolt ?
2. Which batch is still in the Spout/Bolt? i.e. are any batches STUCK ?
a. On which host are they stuck ?
b. In which Spout/Bolt are they stuck ?
Possible Solution(s):
Possible Solution(s):
Add a log statement before and after the critical section.
Possible Solution(s):
Add a log statement before and after the critical section.
log.info(Inserting data into database .); //  entering
datasource.insert(table, tuples); // the real work
log.info(Inserted data into database.); // exiting
Possible Solution(s):
Add a log statement before and after the critical section.
log.info(Inserting data into database .); //  entering
datasource.insert(table, tuples); // the real work
log.info(Inserted data into database.); // exiting
------------------------------------------------------------------
Cons: Logs distributed over multiple hosts, need to aggregate logs. needs a bit of work,
Elastic Search Kibana ?
Possible Solution(s):
Use http://riemann.io/index.html
This was Suggested by my friend angad. I have not looked at this though.
My Idea
Batch of Tuples Punch IN and Punch Out in a bolt / spout.
My Idea
Batch of Tuples Punch IN and Punch Out in a bolt / spout.
Punch In - Put into hashmap (or any other suitable data structure)
Punch Out - Remove from hashmap (or any other suitable data structure)
My Idea:
Batch of Tuples Punch In and Punch Out in a spout.
In the emitBatch of Transactional Spout:
PunchClock.getInstance().punchIn(punchCardId); // Punch In
collector.emit(tuples); // Emit tuple(s)
PunchClock.getInstance().punchOut(punchCardId); // Punch Out
Batch of Tuples Punch IN and Punch Out in a bolt .
In the prepare method of Transactional Bolt:
punchCardId ="Bolt__"+Thread.currentThread().getId()+"__"+System.currentTimeMillis(); // Create Punch
Card for txn
In the execute method of Transactional Bolt:
PunchClock.getInstance().punchIn(punchCardId); //  Punch In
In the finishBatch method of Transactional Bolt:
PunchClock.getInstance().punchOut(punchCardId); //  Punch Out
My Idea:
Yes,
but its a simple Put / Remove call to a hashmap.
When compared to logging its cheaper
Is it intrusive ?
Punch Clocks
Punch Clocks
 Spouts / Bolts housed in a storm worker jvm.
Punch Clocks
 Spouts / Bolts housed in a storm worker jvm.
 One Punch Clock per JVM.
Punch Clocks
 Spouts / Bolts housed in a storm worker jvm.
 One Punch Clock per JVM.
 Since we have multiple JVM we have multiple Punch Clocks.
Punch Clocks
 Spouts / Bolts housed in a storm worker jvm.
 One Punch Clock per JVM.
 Since we have multiple JVM we have multiple Punch Clocks.
 Batches move across storm workers & we have multiple JVM,
 We need to aggregate the data across Punch Clocks.
 Expose Punch Clock via JMX.
Punch clock for  debugging apache storm
demo:
Punch clock for  debugging apache storm
thank you
jaihind213@gmail.com
https://github.com/jaihind213/storm-punch-clock
sweetweet213@twitter

More Related Content

Viewers also liked (7)

Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)
Ganesh Samarthyam
Microservices with Spring Boot
Microservices with Spring BootMicroservices with Spring Boot
Microservices with Spring Boot
Joshua Long
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring Cloud
Eberhard Wolff
Microservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring CloudMicroservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring Cloud
Eberhard Wolff
Bangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - PosterBangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - Poster
Ganesh Samarthyam
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
Ganesh Samarthyam
Spring boot
Spring bootSpring boot
Spring boot
sdeeg
Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)
Ganesh Samarthyam
Microservices with Spring Boot
Microservices with Spring BootMicroservices with Spring Boot
Microservices with Spring Boot
Joshua Long
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring Cloud
Eberhard Wolff
Microservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring CloudMicroservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring Cloud
Eberhard Wolff
Bangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - PosterBangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - Poster
Ganesh Samarthyam
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
Ganesh Samarthyam
Spring boot
Spring bootSpring boot
Spring boot
sdeeg

More from vishnu rao (7)

Assessing Data Pipeline Quality & Sanity with Data Angiograms.pdf
Assessing Data Pipeline Quality & Sanity with Data Angiograms.pdfAssessing Data Pipeline Quality & Sanity with Data Angiograms.pdf
Assessing Data Pipeline Quality & Sanity with Data Angiograms.pdf
vishnu rao
A talk on mysql & aurora
A talk on mysql & auroraA talk on mysql & aurora
A talk on mysql & aurora
vishnu rao
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
vishnu rao
Mysql Relay log - the unsung hero
Mysql Relay log - the unsung heroMysql Relay log - the unsung hero
Mysql Relay log - the unsung hero
vishnu rao
simple introduction to hadoop
simple introduction to hadoopsimple introduction to hadoop
simple introduction to hadoop
vishnu rao
Druid beginner performance tips
Druid beginner performance tipsDruid beginner performance tips
Druid beginner performance tips
vishnu rao
StormWars - when the data stream shrinks
StormWars - when the data stream shrinksStormWars - when the data stream shrinks
StormWars - when the data stream shrinks
vishnu rao
Assessing Data Pipeline Quality & Sanity with Data Angiograms.pdf
Assessing Data Pipeline Quality & Sanity with Data Angiograms.pdfAssessing Data Pipeline Quality & Sanity with Data Angiograms.pdf
Assessing Data Pipeline Quality & Sanity with Data Angiograms.pdf
vishnu rao
A talk on mysql & aurora
A talk on mysql & auroraA talk on mysql & aurora
A talk on mysql & aurora
vishnu rao
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
vishnu rao
Mysql Relay log - the unsung hero
Mysql Relay log - the unsung heroMysql Relay log - the unsung hero
Mysql Relay log - the unsung hero
vishnu rao
simple introduction to hadoop
simple introduction to hadoopsimple introduction to hadoop
simple introduction to hadoop
vishnu rao
Druid beginner performance tips
Druid beginner performance tipsDruid beginner performance tips
Druid beginner performance tips
vishnu rao
StormWars - when the data stream shrinks
StormWars - when the data stream shrinksStormWars - when the data stream shrinks
StormWars - when the data stream shrinks
vishnu rao

Recently uploaded (20)

All about the Snail Power Catalog Product 2025
All about the Snail Power Catalog  Product 2025All about the Snail Power Catalog  Product 2025
All about the Snail Power Catalog Product 2025
kstgroupvn
Silent-Aire Quality Orientation - OFCI_GC - EVAP Unit REV2.pdf
Silent-Aire Quality Orientation - OFCI_GC - EVAP Unit REV2.pdfSilent-Aire Quality Orientation - OFCI_GC - EVAP Unit REV2.pdf
Silent-Aire Quality Orientation - OFCI_GC - EVAP Unit REV2.pdf
EfrainGarrilloRuiz1
Kevin Corke Spouse Revealed A Deep Dive Into His Private Life.pdf
Kevin Corke Spouse Revealed A Deep Dive Into His Private Life.pdfKevin Corke Spouse Revealed A Deep Dive Into His Private Life.pdf
Kevin Corke Spouse Revealed A Deep Dive Into His Private Life.pdf
Medicoz Clinic
Software_Engineering_in_6_Hours_lyst1728638742594.pdf
Software_Engineering_in_6_Hours_lyst1728638742594.pdfSoftware_Engineering_in_6_Hours_lyst1728638742594.pdf
Software_Engineering_in_6_Hours_lyst1728638742594.pdf
VanshMunjal7
危 渚狩 豺企襦蠏 2025 (Lok Fitting Catalog 2025)
危 渚狩 豺企襦蠏 2025 (Lok Fitting Catalog 2025)危 渚狩 豺企襦蠏 2025 (Lok Fitting Catalog 2025)
危 渚狩 豺企襦蠏 2025 (Lok Fitting Catalog 2025)
危 / HIFLUX Co., Ltd.
Concept Learning - Find S Algorithm,Candidate Elimination Algorithm
Concept Learning - Find S Algorithm,Candidate Elimination AlgorithmConcept Learning - Find S Algorithm,Candidate Elimination Algorithm
Concept Learning - Find S Algorithm,Candidate Elimination Algorithm
Global Academy of Technology
DE-UNIT-V MEMORY DEVICES AND DIGITAL INTEGRATED CIRCUITS
DE-UNIT-V MEMORY DEVICES AND DIGITAL INTEGRATED CIRCUITSDE-UNIT-V MEMORY DEVICES AND DIGITAL INTEGRATED CIRCUITS
DE-UNIT-V MEMORY DEVICES AND DIGITAL INTEGRATED CIRCUITS
Sridhar191373
PPT on Grid resilience against Natural disasters.pptx
PPT on Grid resilience against Natural disasters.pptxPPT on Grid resilience against Natural disasters.pptx
PPT on Grid resilience against Natural disasters.pptx
manesumit66
MODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDING
MODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDINGMODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDING
MODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDING
Dr. BASWESHWAR JIRWANKAR
Unit 6 Message Digest Message Digest Message Digest
Unit 6  Message Digest  Message Digest  Message DigestUnit 6  Message Digest  Message Digest  Message Digest
Unit 6 Message Digest Message Digest Message Digest
ChatanBawankar
Attenuation Models for Estimation of Vertical Peak Ground Acceleration Based ...
Attenuation Models for Estimation of Vertical Peak Ground Acceleration Based ...Attenuation Models for Estimation of Vertical Peak Ground Acceleration Based ...
Attenuation Models for Estimation of Vertical Peak Ground Acceleration Based ...
Journal of Soft Computing in Civil Engineering
Main Menu The metals-black-book-ferrous-metals
Main Menu The metals-black-book-ferrous-metalsMain Menu The metals-black-book-ferrous-metals
Main Menu The metals-black-book-ferrous-metals
Ricardo Akerman
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility Applications
Mathias Magdowski
world subdivision.pdf...................
world subdivision.pdf...................world subdivision.pdf...................
world subdivision.pdf...................
bmmederos12
2. CT M35 Grade Concrete Mix design ppt.pdf
2. CT M35 Grade Concrete Mix design  ppt.pdf2. CT M35 Grade Concrete Mix design  ppt.pdf
2. CT M35 Grade Concrete Mix design ppt.pdf
smghumare
Software Engineering Unit 2 Power Point Presentation AKTU University
Software Engineering Unit 2 Power Point Presentation AKTU UniversitySoftware Engineering Unit 2 Power Point Presentation AKTU University
Software Engineering Unit 2 Power Point Presentation AKTU University
utkarshpandey8299
MODULE 5 BUILDING PLANNING AND DESIGN SY BTECH ACOUSTICS SYSTEM IN BUILDING
MODULE 5 BUILDING PLANNING AND DESIGN SY BTECH ACOUSTICS SYSTEM IN BUILDINGMODULE 5 BUILDING PLANNING AND DESIGN SY BTECH ACOUSTICS SYSTEM IN BUILDING
MODULE 5 BUILDING PLANNING AND DESIGN SY BTECH ACOUSTICS SYSTEM IN BUILDING
Dr. BASWESHWAR JIRWANKAR
Java Programming Language: until 2025 and beyond
Java Programming Language: until 2025 and beyondJava Programming Language: until 2025 and beyond
Java Programming Language: until 2025 and beyond
arzu TR
Fresh concrete Workability Measurement
Fresh concrete  Workability  MeasurementFresh concrete  Workability  Measurement
Fresh concrete Workability Measurement
SasiVarman5
ISO 4548-7 Filter Vibration Fatigue Test Rig Catalogue.pdf
ISO 4548-7 Filter Vibration Fatigue Test Rig Catalogue.pdfISO 4548-7 Filter Vibration Fatigue Test Rig Catalogue.pdf
ISO 4548-7 Filter Vibration Fatigue Test Rig Catalogue.pdf
FILTRATION ENGINEERING & CUNSULTANT
All about the Snail Power Catalog Product 2025
All about the Snail Power Catalog  Product 2025All about the Snail Power Catalog  Product 2025
All about the Snail Power Catalog Product 2025
kstgroupvn
Silent-Aire Quality Orientation - OFCI_GC - EVAP Unit REV2.pdf
Silent-Aire Quality Orientation - OFCI_GC - EVAP Unit REV2.pdfSilent-Aire Quality Orientation - OFCI_GC - EVAP Unit REV2.pdf
Silent-Aire Quality Orientation - OFCI_GC - EVAP Unit REV2.pdf
EfrainGarrilloRuiz1
Kevin Corke Spouse Revealed A Deep Dive Into His Private Life.pdf
Kevin Corke Spouse Revealed A Deep Dive Into His Private Life.pdfKevin Corke Spouse Revealed A Deep Dive Into His Private Life.pdf
Kevin Corke Spouse Revealed A Deep Dive Into His Private Life.pdf
Medicoz Clinic
Software_Engineering_in_6_Hours_lyst1728638742594.pdf
Software_Engineering_in_6_Hours_lyst1728638742594.pdfSoftware_Engineering_in_6_Hours_lyst1728638742594.pdf
Software_Engineering_in_6_Hours_lyst1728638742594.pdf
VanshMunjal7
危 渚狩 豺企襦蠏 2025 (Lok Fitting Catalog 2025)
危 渚狩 豺企襦蠏 2025 (Lok Fitting Catalog 2025)危 渚狩 豺企襦蠏 2025 (Lok Fitting Catalog 2025)
危 渚狩 豺企襦蠏 2025 (Lok Fitting Catalog 2025)
危 / HIFLUX Co., Ltd.
Concept Learning - Find S Algorithm,Candidate Elimination Algorithm
Concept Learning - Find S Algorithm,Candidate Elimination AlgorithmConcept Learning - Find S Algorithm,Candidate Elimination Algorithm
Concept Learning - Find S Algorithm,Candidate Elimination Algorithm
Global Academy of Technology
DE-UNIT-V MEMORY DEVICES AND DIGITAL INTEGRATED CIRCUITS
DE-UNIT-V MEMORY DEVICES AND DIGITAL INTEGRATED CIRCUITSDE-UNIT-V MEMORY DEVICES AND DIGITAL INTEGRATED CIRCUITS
DE-UNIT-V MEMORY DEVICES AND DIGITAL INTEGRATED CIRCUITS
Sridhar191373
PPT on Grid resilience against Natural disasters.pptx
PPT on Grid resilience against Natural disasters.pptxPPT on Grid resilience against Natural disasters.pptx
PPT on Grid resilience against Natural disasters.pptx
manesumit66
MODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDING
MODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDINGMODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDING
MODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDING
Dr. BASWESHWAR JIRWANKAR
Unit 6 Message Digest Message Digest Message Digest
Unit 6  Message Digest  Message Digest  Message DigestUnit 6  Message Digest  Message Digest  Message Digest
Unit 6 Message Digest Message Digest Message Digest
ChatanBawankar
Main Menu The metals-black-book-ferrous-metals
Main Menu The metals-black-book-ferrous-metalsMain Menu The metals-black-book-ferrous-metals
Main Menu The metals-black-book-ferrous-metals
Ricardo Akerman
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility Applications
Mathias Magdowski
world subdivision.pdf...................
world subdivision.pdf...................world subdivision.pdf...................
world subdivision.pdf...................
bmmederos12
2. CT M35 Grade Concrete Mix design ppt.pdf
2. CT M35 Grade Concrete Mix design  ppt.pdf2. CT M35 Grade Concrete Mix design  ppt.pdf
2. CT M35 Grade Concrete Mix design ppt.pdf
smghumare
Software Engineering Unit 2 Power Point Presentation AKTU University
Software Engineering Unit 2 Power Point Presentation AKTU UniversitySoftware Engineering Unit 2 Power Point Presentation AKTU University
Software Engineering Unit 2 Power Point Presentation AKTU University
utkarshpandey8299
MODULE 5 BUILDING PLANNING AND DESIGN SY BTECH ACOUSTICS SYSTEM IN BUILDING
MODULE 5 BUILDING PLANNING AND DESIGN SY BTECH ACOUSTICS SYSTEM IN BUILDINGMODULE 5 BUILDING PLANNING AND DESIGN SY BTECH ACOUSTICS SYSTEM IN BUILDING
MODULE 5 BUILDING PLANNING AND DESIGN SY BTECH ACOUSTICS SYSTEM IN BUILDING
Dr. BASWESHWAR JIRWANKAR
Java Programming Language: until 2025 and beyond
Java Programming Language: until 2025 and beyondJava Programming Language: until 2025 and beyond
Java Programming Language: until 2025 and beyond
arzu TR
Fresh concrete Workability Measurement
Fresh concrete  Workability  MeasurementFresh concrete  Workability  Measurement
Fresh concrete Workability Measurement
SasiVarman5

Punch clock for debugging apache storm