mandatory exercise presentation sample assignment at
TRANSCRIPT
Motivation
● Learn about data stream management systems and complex event processing.
● Learn to use Esper.
● Esper is a component for complex event processing (CEP),
available for Java.
● http://esper.codehaus.org/
● Allow passing students to take the final exam.
Changes from last year
No longer allowed to work in groups
New exercises
New deadline (Wednesday ,Sept. 30, 2015, 12:00 h)
Objective
● Use Esper to learn about CEP and to do queries on a stream of
stock events called ticks.
● Answer text questions to show that you have understood the
difference with traditional database systems.
You will have to learn about Esper and its query language EPL,
but you are not tested on your knowledge of stocks and
finance.
Getting Started
● Read about Esper at http://esper.codehaus.org/
● Download and extract
www.uio.no/studier/emner/matnat/ifi/INF5100/h15/exerc
ise/mandatory_exercise.tar.gz
● This bundle contains two directories:
● esper-4.9.0/
● inf5100/
esper-4.9.0/
● This is the Esper system and libraries, downloaded from
http://esper.codehaus.org/esper/download/download.html
● 4.9.0 is the newest version as of now, but you are free to
update if newer versions appear.
● You do not have to alter anything in this directory.
● However, the folder should be explored in order to
understand how Esper works.
● The folder also contains example programs that you can have
a look at, and learn from!
inf5100/
● This folder contains the “pre code” and files that you should
utilize in this exercise.
How to start working with Esper
● You need Eclipse JEE and JRE
● File → New Project (Give location of inf5100 pre code folder)
● Add external jars
inf5100/Makefile
● http://en.wikipedia.org/wiki/Make_(software)
● http://www.gnu.org/software/make/manual/make.html
● make - compiles the exercise
● make run - runs the queries
● make clean - removes the compiled Java classes
● You are free to expand the file if needed
inf5100/INF5100.java
● The code used to generate events (Esper ticks) and read your
queries.
● You do not need to modify this file, but you are allowed to
improve it if needed.
inf5100/Tick.java
– We only look at one single stock, BTC. ● timestamp = The date of the event/tick.
– Our stock exchange sends one tick per day. ● open = The price of the stock at the beginning of the day.
● high = The highest price the stock was traded for this day.
● low = The lowest price the stock was traded for this day.
● close = The price of the stock at the end of the day.
● volume = The number of times the stock was sold this day.
● weightedPrice = A weighted average of the stock price this day.
inf5100/Tick.java
SYMBOL = BTC = NAME OF THE STOCK
inf5100/BTC.csv
● The emulated stock exchange, consisting of events (ticks). You are not
allowed to modify this file, but you may look at it in order to verify the
correctness of your queries. It looks like: ● [...]
● 2010-07-18,0.04951,0.08585,0.05941,0.08584,75.01,0.07 ● 2010-07-19,0.08584,0.09307,0.07723,0.0808,574,0.09 ● 2010-07-
20,0.0808,0.08181,0.07426,0.07474,262,0.08 ● [...]
● As, you see, it is only a comma separated list of the 8 attributes from
Tick.java: timestamp, open, high, low, close, volume, average
inf5100/query_[...].epl
● These are the files you should change according to the
questions.
● E.g. “Find the date and weighted price of the BTC stock when
volume is greater than 200000.” → query_1.epl
Questions
● Both text and EPL questions.
● The ordering matters! Question 1 is easier than question
13. Solve the questions in order...
● Every question must be answered to pass!
Text Questions
● Questions 1, 3, 8, 10, 13, 15, 17
● Teaches you theory about CEP and EPL you might need in the
coming queries.
● Must be at least the page requirement listed in parenthesis.
E.g. (~1 page)
● You are not meant to copy/paste from either the Esper web-
page or the slides, but rather read, understand and write the
things in your own words.
EPL Questions
● Questions 2, 4, 5, 6, 7, 9, 11, 12, 14, 16
● Gives you practice in thinking in CEP environments and
teaches you EPL.
● Must include:
● How you think
● The EPL query
● Results (Output from Esper, nicely formatted)
● Graph of the the results
Delivery
● When: (Wednesday ,Sept. 30, 2015, 12:00 h) (Firm
deadline!)
● What: 1 PDF with all queries, explanations of how you
resonate, table with results and graphs where suited. Your
queries should be explained thoroughly, since there are many
possible solutions.
Q & A
● Please contact me at [email protected] if anything is unclear! I
will do my best to help via email!