Coder Social home page Coder Social logo

mapreduce's Introduction

MapReduce

MapReduce parctice.


WordCount

A counter to count differernt word and its number.

How to run?

  • Set classpath according to reference document
  • Compile them
    javac *.java
  • Pack them into a jar
    jar cvf WordCount.jar *.class
  • Upload input file to HDFS
    hadoop fs -mkdir -p /input/WordCount
    hadoop fs -put input_file.txt /input/WordCount
  • Create a output path(If already exists, skip to next step)
    hadoop fs -mkdir /output
  • Run it
    hadoop jar WordCount.jar WordCount /input/WordCount /output/WordCount
  • Cat or download output file
    hadoop fs -cat /output/WordCount/part-r-00000
    hadoop fs -get /output/WordCount/part-r-00000 result.txt

MeanScore

Calculate mean score from student transcript by studnet and by subject

StudentMean

How to run?

  • Set classpath according to reference document
  • Compile them
    javac StudentMean\*.java
  • Pack them into a jar
    jar cvf StudentMean.jar StudentMean\*.class
  • Upload input file to HDFS
    hadoop fs -mkdir -p /input/ScoreMean
    hadoop fs -put student_transcript.txt /input/ScoreMean
  • Create a output path(If already exists, skip to next step)
    hadoop fs -mkdir /output
  • Run it
    hadoop jar StudentMean.jar StudentMean.StudentMean /input/ScoreMean /output/StudentMean
  • Cat or download output file
    hadoop fs -cat /output/StudentMean/part-r-00000
    hadoop fs -get /output/StudentMean/part-r-00000 StudentMean.txt

SubjectMean

How to run?

  • Set classpath according to reference document
  • Compile them
    javac SubjectMean\*.java
  • Pack them into a jar
    jar cvf SubjectMean.jar SubjectMean\*.class
  • Upload input file to HDFS(If already exists, skip to next step)
    hadoop fs -mkdir -p /input/ScoreMean
    hadoop fs -put student_transcript.txt /input/ScoreMean
  • Create a output path(If already exists, skip to next step)
    hadoop fs -mkdir /output
  • Run it
    hadoop jar SubjectMean.jar SubjectMean.SubjectMean /input/ScoreMean /output/SubjectMean
  • Cat or download output file
    hadoop fs -cat /output/SubjectMean/part-r-00000
    hadoop fs -get /output/SubjectMean/part-r-00000 SubjectMean.txt

GrandchildGrandparent

Input a child-parent file, find all grandchild-grandparent. Suppose there is no same name

How to run?

  • Set classpath according to reference document
  • Compile them
    javac *.java
  • Pack them into a jar
    jar cvf GrandchildGrandparent.jar *.class
  • Upload input file to HDFS
    hadoop fs -mkdir -p /input/GrandchildGrandparent
    hadoop fs -put child-parent.txt /input/GrandchildGrandparent
  • Create a output path(If already exists, skip to next step)
    hadoop fs -mkdir /output
  • Run it
    hadoop jar SubjectMean.jar SubjectMean.SubjectMean /input/ScoreMean /output/SubjectMean
  • Cat or download output file
    hadoop fs -cat /output/GrandchildGrandparent/part-r-00000
    hadoop fs -get /output/GrandchildGrandparent/part-r-00000 GrandchildGrandparent.txt

mapreduce's People

Contributors

littlegreenmouse avatar

Watchers

James Cloos avatar

mapreduce's Issues

MapReduce

MapReduce practice.

  • WordCount
  • MeanScore
  • GrandchildGrandparent

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.