Coder Social home page Coder Social logo

priyanktejani / hadoop-mapreduce-average-calculator Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 539 KB

Hadoop MapReduce simple average calculator application that counts the average grade for each module in a given input set. The

License: MIT License

Java 100.00%
average-calculator hadoop in-mapper-combiner java mapreduce

hadoop-mapreduce-average-calculator's Introduction

Hadoop MapReduce average calculator

AverageCalculator is a simple MapReduce application that counts the average grade for each module in a given input set. The application operates in two different stages map phase and reduces phase.

1. Map phase

Mapper takes the file as input, divides it into single line. Where 4th (module) and 5th (grade) columns values are stored as KeyValue pair in the HashMap. But if the key already exists, it adds a new grade value with the previous grade value. Additionally, another HashMap tracks the number of times each module appears in a column. Then a cleanup converts the Hashmap Values into List of <Module, <IntPair(valueGrade, valueCount)>. Here, the key is the Module and the value is the integer pair of Grade, and the total Count of that key.

2. Reduce phase

This is the phase that is responsible to calculates the average grade of each module. The reducer takes a List of <Module, <IntPair(valueGrade, valueCount)> from the Map class. Then it iterates over the Integer pair of values and adds each pair value with the previous value. Finally, the sum of Grades is divided by the total number of counts recorded during the iteration process. Which outputs a final average for each Module.

License

MIT. Copyright (c) MIT License.

hadoop-mapreduce-average-calculator's People

Contributors

priyanktejani avatar

Watchers

 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.