Git Product home page Git Product logo

bigdata_p2's Introduction

Big Data Analytics (CIIC 8995) Project II

Project II of Big Data Analytics (CIIC 8995) given by Dr. Manuel Rodríguez in the University of Puerto Rico, Mayagüez Campus.

An example of this is available at http://kvm_33.uprm.edu/p2/.

twitter_stream.py

Python Kafka Producer that receives a sample stream of tweets from Twitter, extract only the ones from about trump and send it to the Kafka Server. A credential file is required as twitter_credentials.json. A example of that file is included as twitter_credentials.sample.json.

python3 twitter_stream.py

p2-words.py

Python Kafka Consumer that implements Spark Streams, it receives the json of tweets about trump and separate the tweet into words, remove stop words, count them (reduce) and more to finally, store it on HDFS to be later analyzed.

/opt/spark/bin/spark-submit --packages org.apache.spark:spark-streaming-kafka-0-8_2.11:2.1.1 p2-words.py

p2-screennames.py

Python Kafka Consumer that implements Spark Streams, it receives the json of tweets about trump and separate the get the screen name of the tweet, count the occurrences of it (reduce) and more to finally, store it on HDFS to be later analyzed.

/opt/spark/bin/spark-submit --packages org.apache.spark:spark-streaming-kafka-0-8_2.11:2.1.1 p2-screennames.py

p2lib.py

Library with the common functions for this project.

words-cron.py

Take as input the files generated by p2-words.py and stored in HDFS to generate the index and files that will be used on a webapp to visualize the data.

screennames-cron.py

Take as input the files generated by p2-screennames.py and stored in HDFS to generate the index and files that will be used on a webapp to visualize the data.

Crontab

A crontab was configured to execute words-cron.py every 10 minutes and screennames-cron.py every 1 hour. The files produced by those two processes are then used to be visualized on a webapp.

*/10 * * * * source /home/omar.soto2/.bash_profile; flock -w 0 /home/omar.soto2/p2/words-cron.lock /opt/spark/bin/spark-submit /home/omar.soto2/p2/words-cron.py >> /home/omar.soto2/p2/cron_log 2>&1
0 * * * * source /home/omar.soto2/.bash_profile; flock -w 0 /home/omar.soto2/p2/screenname-cron.lock /opt/spark/bin/spark-submit --master yarn  --deploy-mode client --py-files /home/omar.soto2/p2/p2lib.py --conf='spark.executorEnv.PYTHONHASHSEED=223' /home/omar.soto2/p2/screennames-cron.py >> /home/omar.soto2/p2/cron_log 2>&1

bigdata_p2's People

Contributors

omarpr avatar

Stargazers

Alejandro Perez avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.