YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
Page 1: Building Your First Apache Apex Application

Yogi [email protected]

Building your first Apache Apex Application

Page 2: Building Your First Apache Apex Application

● Key concepts: DAG, Operators, Ports● APIs for defining Applications, Operators● “Word Count” example DAG● Building Apache Apex from source code● Creating a sample application● Demo● Questions

Outline

Page 3: Building Your First Apache Apex Application

● An Application is defined as Directed Acyclic Graph : DAG● Vertices of the DAG are computational units : Operators● Edges of the DAG are data tuples in-motion : Streams● Operator end-points for input , output : Ports● An Operator takes one or more input streams, performs computations & emits one or more output streams

○ Each operator is USER’s business logic, or built-in operator from our open source library○ Operator may have multiple instances that run in parallel

Application as a DAG

Page 4: Building Your First Apache Apex Application

Typical application example

Page 5: Building Your First Apache Apex Application

● MyApplication implements StreamingApplication○ Provide implementation for populateDAG○ Stitch the DAG

● SampleOperator extends BaseOperator○ Define input ports, output ports ○ Define process methods○ Optional : Define beginWindow, endWindow, setup,

teardown

APIs : Application, Operator

Page 6: Building Your First Apache Apex Application

Operator workflow

Page 7: Building Your First Apache Apex Application

● Data at Rest - Count occurrences of words in a file● Data in Motion - Emit counts at the end of the window● Another variation - Emit cumulative counts at the end of

every window.

Sample application

Apex Application DAGHDFSLOGS

Lines Counts

Page 8: Building Your First Apache Apex Application

Defining DAG

Reader Parser Counter Output

Input Operator (Adapter)

Output Operator (Adapter)

Generic Operators

HDFSLOGS

Page 9: Building Your First Apache Apex Application

• Java : 1.7.x• mvn : 3.0 + • git : 1.7 +• Apache hadoop : How to : Single node cluster • Apache Apex Core

• git clone [email protected]:apache/apex-core.git• cd apex-core/• git checkout master• mvn clean install -DskipTests

• Apache Apex Malhar• git clone [email protected]:apache/apex-malhar.git• cd apex-malhar/• git checkout master• mvn clean install -DskipTests

• DataTorrent RTS community edition

Building Apache Apex

Page 10: Building Your First Apache Apex Application

10

Questions

Image ref [2]

Page 11: Building Your First Apache Apex Application

● Apache Apex website - http://apex.apache.org/● Subscribe - http://apex.apache.org/community.html● Download - http://apex.apache.org/downloads.html● Youtube : subscribe DataTorrent● Meetup - http://www.meetup.com/topics/apache-apex● Twitter : follow @ApacheApex● Startup Program – Free Enterprise License for Startups,

Educational Institutions, Non-Profits

Resources

11

Page 12: Building Your First Apache Apex Application

12


Related Documents