Top Banner
19

Mandatory exercise presentation

Jan 16, 2017

Download

Education

Assignment Help
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mandatory exercise presentation
Page 2: Mandatory exercise presentation

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.

Page 3: Mandatory exercise presentation

Changes from last year

No longer allowed to work in groups

New exercises

New deadline (Wednesday ,Sept. 30, 2015, 12:00 h)

Page 4: Mandatory exercise presentation

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.

Page 5: Mandatory exercise presentation

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/

Page 6: Mandatory exercise presentation

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!

Page 7: Mandatory exercise presentation

inf5100/

● This folder contains the “pre code” and files that you should

utilize in this exercise.

Page 8: Mandatory exercise presentation

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

Page 9: Mandatory exercise presentation

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

Page 10: Mandatory exercise presentation

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.

Page 11: Mandatory exercise presentation

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.

Page 12: Mandatory exercise presentation

inf5100/Tick.java

SYMBOL = BTC = NAME OF THE STOCK

Page 13: Mandatory exercise presentation

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

Page 14: Mandatory exercise presentation

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

Page 15: Mandatory exercise presentation

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!

Page 16: Mandatory exercise presentation

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.

Page 17: Mandatory exercise presentation

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

Page 18: Mandatory exercise presentation

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.

Page 19: Mandatory exercise presentation

Q & A

● Please contact me at [email protected] if anything is unclear! I

will do my best to help via email!