SlideShare a Scribd company logo
Stream API For Apex
June 2016
Apex Overview
Apex Overview
• YARN is
the
resource
manager
• HDFS used
for storing
any
persistent
state
Current Development Model
Directed Acyclic Graph (DAG)
Output
Stream
Tupl
e
Tupl
e
er
Operator
er
Operator
er
Operator
er
Operator
er
Operator
er
Operator
● Stream is a sequence of data tuples
● Typical Operator takes one or more input streams, performs computations & emits one or more output streams
● Each operator is your custom business logic in java, or built-in operator from our open source library
● Operator has many instances that run in parallel and each instance is single-threaded
● Directed Acyclic Graph (DAG) is made up of operators and streams
Current Application Example
@ApplicationAnnotation(name="WordCountDemo")
public class Application implements StreamingApplication
{
@Override
public void populateDAG(DAG dag, Configuration conf)
{
WordCountInputOperator input = dag.addOperator("wordinput", new WordCountInputOperator());
UniqueCounter<String> wordCount = dag.addOperator("count", new UniqueCounter<String>());
ConsoleOutputOperator consoleOperator = dag.addOperator("console", new ConsoleOutputOperator());
dag.addStream("wordinput-count", input.outputPort, wordCount.data);
dag.addStream("count-console",wordCount.count, consoleOperator.input);
}
}
o Easier for beginners to start with
o Fluent API
o Smaller learning curve
o Transform methods in one place vs operator library
o Operator API provides flexibility while high-level API provides ease of use
Why we need high-level API
Stream API
map(..)
filter(..)
…
addOperator(...)
with(prop, val)
…
window(Opt...)
ApexStream<T>
group(..)
groupByKey(...)
reduce(..)
fold(..)
join(..)
count(..)
…
window(Opt...)
WindowedStream<T>
<<interface>> <<interface>>
Stream API (Application Example)
@ApplicationAnnotation(name = "WordCountStreamingApiDemo")
public class ApplicationWithStreamAPI implements StreamingApplication
{
@Override
public void populateDAG(DAG dag, Configuration configuration)
{
String localFolder = "./src/test/resources/data";
ApexStream<String> stream = StreamFactory
.fromFolder(localFolder)
.flatMap(new Split())
.window(new WindowOption.GlobalWindow(), new
TriggerOption().withEarlyFiringsAtEvery(Duration.millis(1000)).accumulatingFiredPanes())
.countByKey(new ConvertToKeyVal()).print();
stream.populateDag(dag);
}
}
How it works
o ApexStream<T> literally means bounded/unbounded data set of type T
o ApexStream<T> also holds a graph data struture of all operator and
connections between operators from input to current point
o Each transform method attach one or more operators to current graph
data structure and return a new Apex Stream object
o The graph data structure won’t be translated to Apex DAG until
populateDag or run method are called
How it works (Con’t)
○ Method chain for readability
○ Stateless transform(map, flatmap, filter)
○ Some input and output are available (file, console, Kafka)
○ Some interoperability (addOperator, getDag, set property/attributes etc)
○ Local mode and distributed mode
○ Annonymous function class support
○ Extensible
Current Status
○ WindowedStream is in pull request along with Operators that support it
○ A few window transforms (count, reduce, etc)
○ 3 Window types (fix window, sliding window, session window)
○ 3 Trigger types (early trigger, late trigger, at watermark)
○ 3 Accumulation modes(accumulate, discard, accumulation_retraction)
○ In memory window state (checkpointed)
Current Status (Con’t)
Roadmap
○ Persistent window state for windowed operators (large state)
○ Fully follow Beam model (window, trigger, watermark)
○ Rich selection of windowed transform (group, combine, join)
○ Support custom window assignor
○ Support custom trigger
○ More input/output (hbase, cassendra, jdbc, etc)
○ Better schema support
○ More language support (java 8, scala, etc...)
○ What the community asks for
Resources
○ Apache Apex website - http://apex.apache.org/
○ Subscribe - http://apex.apache.org/community.html
○ Download - http://apex.apache.org/downloads.html
○ Twitter - @ApacheApex; Follow - https://twitter.com/apacheapex
○ Facebook - https://www.facebook.com/ApacheApex/
○ Meetup - http://www.meetup.com/topics/apache-apex
○ SlideShare - http://www.slideshare.net/ApacheApex/presentations
○ More Examples - https://github.com/DataTorrent/examples
○ Pull request
https://github.com/apache/apex-malhar/pull/319
https://github.com/apache/apex-malhar/pull/327
Demo & Code Example
○ Word Count
○ AutoComplete
Thank You!
June
2016
Comments/Questions
siyuan@datatorrent.com
Ad

Recommended

PPTX
Intro to Apache Apex - Next Gen Native Hadoop Platform - Hackac
Apache Apex
 
PPTX
Intro to Apache Apex @ Women in Big Data
Apache Apex
 
PPTX
Introduction to Apache Apex
Apache Apex
 
PPTX
Intro to Apache Apex - Next Gen Platform for Ingest and Transform
Apache Apex
 
PPTX
Hadoop Summit SJ 2016: Next Gen Big Data Analytics with Apache Apex
Apache Apex
 
PDF
Apache Big Data EU 2016: Next Gen Big Data Analytics with Apache Apex
Apache Apex
 
PDF
From Batch to Streaming with Apache Apex Dataworks Summit 2017
Apache Apex
 
PPTX
Architectual Comparison of Apache Apex and Spark Streaming
Apache Apex
 
PDF
Actionable Insights with Apache Apex at Apache Big Data 2017 by Devendra Tagare
Apache Apex
 
PPTX
Deep Dive into Apache Apex App Development
Apache Apex
 
PDF
Building your first aplication using Apache Apex
Yogi Devendra Vyavahare
 
PPTX
Intro to Apache Apex (next gen Hadoop) & comparison to Spark Streaming
Apache Apex
 
PPTX
Smart Partitioning with Apache Apex (Webinar)
Apache Apex
 
PPTX
Introduction to Real-Time Data Processing
Apache Apex
 
PPTX
Apache Big Data 2016: Next Gen Big Data Analytics with Apache Apex
Apache Apex
 
PPTX
Apache Apex: Stream Processing Architecture and Applications
Thomas Weise
 
PDF
Low Latency Polyglot Model Scoring using Apache Apex
Apache Apex
 
PDF
Developing streaming applications with apache apex (strata + hadoop world)
Apache Apex
 
PDF
Apache Big Data EU 2016: Building Streaming Applications with Apache Apex
Apache Apex
 
PPTX
DataTorrent Presentation @ Big Data Application Meetup
Thomas Weise
 
PPTX
Ingestion and Dimensions Compute and Enrich using Apache Apex
Apache Apex
 
PPTX
Introduction to Apache Apex and writing a big data streaming application
Apache Apex
 
PDF
Introduction to Apache Apex - CoDS 2016
Bhupesh Chawda
 
PPTX
Kafka to Hadoop Ingest with Parsing, Dedup and other Big Data Transformations
Apache Apex
 
PPTX
Big Data Berlin v8.0 Stream Processing with Apache Apex
Apache Apex
 
PDF
Apex as yarn application
Chinmay Kolhatkar
 
PPTX
Ingesting Data from Kafka to JDBC with Transformation and Enrichment
Apache Apex
 
PPTX
Fault Tolerance and Processing Semantics in Apache Apex
Apache Apex Organizer
 
PPTX
Stream processing - Apache flink
Renato Guimaraes
 
PDF
Introduction to Apache Apex by Thomas Weise
Big Data Spain
 

More Related Content

What's hot (20)

PDF
Actionable Insights with Apache Apex at Apache Big Data 2017 by Devendra Tagare
Apache Apex
 
PPTX
Deep Dive into Apache Apex App Development
Apache Apex
 
PDF
Building your first aplication using Apache Apex
Yogi Devendra Vyavahare
 
PPTX
Intro to Apache Apex (next gen Hadoop) & comparison to Spark Streaming
Apache Apex
 
PPTX
Smart Partitioning with Apache Apex (Webinar)
Apache Apex
 
PPTX
Introduction to Real-Time Data Processing
Apache Apex
 
PPTX
Apache Big Data 2016: Next Gen Big Data Analytics with Apache Apex
Apache Apex
 
PPTX
Apache Apex: Stream Processing Architecture and Applications
Thomas Weise
 
PDF
Low Latency Polyglot Model Scoring using Apache Apex
Apache Apex
 
PDF
Developing streaming applications with apache apex (strata + hadoop world)
Apache Apex
 
PDF
Apache Big Data EU 2016: Building Streaming Applications with Apache Apex
Apache Apex
 
PPTX
DataTorrent Presentation @ Big Data Application Meetup
Thomas Weise
 
PPTX
Ingestion and Dimensions Compute and Enrich using Apache Apex
Apache Apex
 
PPTX
Introduction to Apache Apex and writing a big data streaming application
Apache Apex
 
PDF
Introduction to Apache Apex - CoDS 2016
Bhupesh Chawda
 
PPTX
Kafka to Hadoop Ingest with Parsing, Dedup and other Big Data Transformations
Apache Apex
 
PPTX
Big Data Berlin v8.0 Stream Processing with Apache Apex
Apache Apex
 
PDF
Apex as yarn application
Chinmay Kolhatkar
 
PPTX
Ingesting Data from Kafka to JDBC with Transformation and Enrichment
Apache Apex
 
PPTX
Fault Tolerance and Processing Semantics in Apache Apex
Apache Apex Organizer
 
Actionable Insights with Apache Apex at Apache Big Data 2017 by Devendra Tagare
Apache Apex
 
Deep Dive into Apache Apex App Development
Apache Apex
 
Building your first aplication using Apache Apex
Yogi Devendra Vyavahare
 
Intro to Apache Apex (next gen Hadoop) & comparison to Spark Streaming
Apache Apex
 
Smart Partitioning with Apache Apex (Webinar)
Apache Apex
 
Introduction to Real-Time Data Processing
Apache Apex
 
Apache Big Data 2016: Next Gen Big Data Analytics with Apache Apex
Apache Apex
 
Apache Apex: Stream Processing Architecture and Applications
Thomas Weise
 
Low Latency Polyglot Model Scoring using Apache Apex
Apache Apex
 
Developing streaming applications with apache apex (strata + hadoop world)
Apache Apex
 
Apache Big Data EU 2016: Building Streaming Applications with Apache Apex
Apache Apex
 
DataTorrent Presentation @ Big Data Application Meetup
Thomas Weise
 
Ingestion and Dimensions Compute and Enrich using Apache Apex
Apache Apex
 
Introduction to Apache Apex and writing a big data streaming application
Apache Apex
 
Introduction to Apache Apex - CoDS 2016
Bhupesh Chawda
 
Kafka to Hadoop Ingest with Parsing, Dedup and other Big Data Transformations
Apache Apex
 
Big Data Berlin v8.0 Stream Processing with Apache Apex
Apache Apex
 
Apex as yarn application
Chinmay Kolhatkar
 
Ingesting Data from Kafka to JDBC with Transformation and Enrichment
Apache Apex
 
Fault Tolerance and Processing Semantics in Apache Apex
Apache Apex Organizer
 

Similar to Java High Level Stream API (20)

PPTX
Stream processing - Apache flink
Renato Guimaraes
 
PDF
Introduction to Apache Apex by Thomas Weise
Big Data Spain
 
PPSX
GE IOT Predix Time Series & Data Ingestion Service using Apache Apex (Hadoop)
Apache Apex
 
PDF
Building Your First Apache Apex Application
Apache Apex
 
PDF
Introduction to Apache Apex
Chinmay Kolhatkar
 
PDF
Real-time Stream Processing using Apache Apex
Apache Apex
 
PPTX
Apache Apex: Stream Processing Architecture and Applications
Comsysto Reply GmbH
 
PPTX
Apache Flink Overview at SF Spark and Friends
Stephan Ewen
 
PDF
Apache Samza 1.0 - What's New, What's Next
Prateek Maheshwari
 
PPTX
Hadoop and HBase experiences in perf log project
Mao Geng
 
PDF
Strata Singapore: Gearpump Real time DAG-Processing with Akka at Scale
Sean Zhong
 
PPTX
An adaptive and eventually self healing framework for geo-distributed real-ti...
Angad Singh
 
PDF
Custom Pregel Algorithms in ArangoDB
ArangoDB Database
 
PPTX
Akka Microservices Architecture And Design
Yaroslav Tkachenko
 
PDF
Load testing in Zonky with Gatling
Petr Vlček
 
PPTX
Spark Concepts - Spark SQL, Graphx, Streaming
Petr Zapletal
 
PDF
Stateful streaming data pipelines
Timothy Farkas
 
PPTX
Nike tech talk.2
Jags Ramnarayan
 
PDF
On-boarding with JanusGraph Performance
Chin Huang
 
PPTX
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
Lightbend
 
Stream processing - Apache flink
Renato Guimaraes
 
Introduction to Apache Apex by Thomas Weise
Big Data Spain
 
GE IOT Predix Time Series & Data Ingestion Service using Apache Apex (Hadoop)
Apache Apex
 
Building Your First Apache Apex Application
Apache Apex
 
Introduction to Apache Apex
Chinmay Kolhatkar
 
Real-time Stream Processing using Apache Apex
Apache Apex
 
Apache Apex: Stream Processing Architecture and Applications
Comsysto Reply GmbH
 
Apache Flink Overview at SF Spark and Friends
Stephan Ewen
 
Apache Samza 1.0 - What's New, What's Next
Prateek Maheshwari
 
Hadoop and HBase experiences in perf log project
Mao Geng
 
Strata Singapore: Gearpump Real time DAG-Processing with Akka at Scale
Sean Zhong
 
An adaptive and eventually self healing framework for geo-distributed real-ti...
Angad Singh
 
Custom Pregel Algorithms in ArangoDB
ArangoDB Database
 
Akka Microservices Architecture And Design
Yaroslav Tkachenko
 
Load testing in Zonky with Gatling
Petr Vlček
 
Spark Concepts - Spark SQL, Graphx, Streaming
Petr Zapletal
 
Stateful streaming data pipelines
Timothy Farkas
 
Nike tech talk.2
Jags Ramnarayan
 
On-boarding with JanusGraph Performance
Chin Huang
 
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
Lightbend
 
Ad

More from Apache Apex (10)

PPTX
Hadoop Interacting with HDFS
Apache Apex
 
PPTX
Introduction to Yarn
Apache Apex
 
PPTX
Introduction to Map Reduce
Apache Apex
 
PPTX
HDFS Internals
Apache Apex
 
PPTX
Intro to Big Data Hadoop
Apache Apex
 
PPTX
Building Your First Apache Apex (Next Gen Big Data/Hadoop) Application
Apache Apex
 
PPTX
Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)
Apache Apex
 
PPTX
Apache Beam (incubating)
Apache Apex
 
PPTX
Making sense of Apache Bigtop's role in ODPi and how it matters to Apache Apex
Apache Apex
 
PPTX
Apache Apex & Bigtop
Apache Apex
 
Hadoop Interacting with HDFS
Apache Apex
 
Introduction to Yarn
Apache Apex
 
Introduction to Map Reduce
Apache Apex
 
HDFS Internals
Apache Apex
 
Intro to Big Data Hadoop
Apache Apex
 
Building Your First Apache Apex (Next Gen Big Data/Hadoop) Application
Apache Apex
 
Intro to YARN (Hadoop 2.0) & Apex as YARN App (Next Gen Big Data)
Apache Apex
 
Apache Beam (incubating)
Apache Apex
 
Making sense of Apache Bigtop's role in ODPi and how it matters to Apache Apex
Apache Apex
 
Apache Apex & Bigtop
Apache Apex
 
Ad

Recently uploaded (20)

PDF
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
PDF
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
PPTX
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
PDF
The Growing Value and Application of FME & GenAI
Safe Software
 
PPTX
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
PDF
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
PDF
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
PDF
Python Conference Singapore - 19 Jun 2025
ninefyi
 
PDF
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
PPTX
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PPTX
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
PDF
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
PDF
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
PDF
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
PDF
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
PDF
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
PDF
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
The Growing Value and Application of FME & GenAI
Safe Software
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Python Conference Singapore - 19 Jun 2025
ninefyi
 
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 

Java High Level Stream API

  • 1. Stream API For Apex June 2016
  • 3. Apex Overview • YARN is the resource manager • HDFS used for storing any persistent state
  • 4. Current Development Model Directed Acyclic Graph (DAG) Output Stream Tupl e Tupl e er Operator er Operator er Operator er Operator er Operator er Operator ● Stream is a sequence of data tuples ● Typical Operator takes one or more input streams, performs computations & emits one or more output streams ● Each operator is your custom business logic in java, or built-in operator from our open source library ● Operator has many instances that run in parallel and each instance is single-threaded ● Directed Acyclic Graph (DAG) is made up of operators and streams
  • 5. Current Application Example @ApplicationAnnotation(name="WordCountDemo") public class Application implements StreamingApplication { @Override public void populateDAG(DAG dag, Configuration conf) { WordCountInputOperator input = dag.addOperator("wordinput", new WordCountInputOperator()); UniqueCounter<String> wordCount = dag.addOperator("count", new UniqueCounter<String>()); ConsoleOutputOperator consoleOperator = dag.addOperator("console", new ConsoleOutputOperator()); dag.addStream("wordinput-count", input.outputPort, wordCount.data); dag.addStream("count-console",wordCount.count, consoleOperator.input); } }
  • 6. o Easier for beginners to start with o Fluent API o Smaller learning curve o Transform methods in one place vs operator library o Operator API provides flexibility while high-level API provides ease of use Why we need high-level API
  • 8. Stream API (Application Example) @ApplicationAnnotation(name = "WordCountStreamingApiDemo") public class ApplicationWithStreamAPI implements StreamingApplication { @Override public void populateDAG(DAG dag, Configuration configuration) { String localFolder = "./src/test/resources/data"; ApexStream<String> stream = StreamFactory .fromFolder(localFolder) .flatMap(new Split()) .window(new WindowOption.GlobalWindow(), new TriggerOption().withEarlyFiringsAtEvery(Duration.millis(1000)).accumulatingFiredPanes()) .countByKey(new ConvertToKeyVal()).print(); stream.populateDag(dag); } }
  • 9. How it works o ApexStream<T> literally means bounded/unbounded data set of type T o ApexStream<T> also holds a graph data struture of all operator and connections between operators from input to current point o Each transform method attach one or more operators to current graph data structure and return a new Apex Stream object o The graph data structure won’t be translated to Apex DAG until populateDag or run method are called
  • 10. How it works (Con’t)
  • 11. ○ Method chain for readability ○ Stateless transform(map, flatmap, filter) ○ Some input and output are available (file, console, Kafka) ○ Some interoperability (addOperator, getDag, set property/attributes etc) ○ Local mode and distributed mode ○ Annonymous function class support ○ Extensible Current Status
  • 12. ○ WindowedStream is in pull request along with Operators that support it ○ A few window transforms (count, reduce, etc) ○ 3 Window types (fix window, sliding window, session window) ○ 3 Trigger types (early trigger, late trigger, at watermark) ○ 3 Accumulation modes(accumulate, discard, accumulation_retraction) ○ In memory window state (checkpointed) Current Status (Con’t)
  • 13. Roadmap ○ Persistent window state for windowed operators (large state) ○ Fully follow Beam model (window, trigger, watermark) ○ Rich selection of windowed transform (group, combine, join) ○ Support custom window assignor ○ Support custom trigger ○ More input/output (hbase, cassendra, jdbc, etc) ○ Better schema support ○ More language support (java 8, scala, etc...) ○ What the community asks for
  • 14. Resources ○ Apache Apex website - http://apex.apache.org/ ○ Subscribe - http://apex.apache.org/community.html ○ Download - http://apex.apache.org/downloads.html ○ Twitter - @ApacheApex; Follow - https://twitter.com/apacheapex ○ Facebook - https://www.facebook.com/ApacheApex/ ○ Meetup - http://www.meetup.com/topics/apache-apex ○ SlideShare - http://www.slideshare.net/ApacheApex/presentations ○ More Examples - https://github.com/DataTorrent/examples ○ Pull request https://github.com/apache/apex-malhar/pull/319 https://github.com/apache/apex-malhar/pull/327
  • 15. Demo & Code Example ○ Word Count ○ AutoComplete