Code Monkey home page Code Monkey logo

hadoop-project's Introduction

Hadoop-project

Hadoop Sample question

Description:
Find the max elem globally from all arrays,
array1 = [2,3...655], length = 300
array2 = [4,6,6,466], length = 300
... array9 ...

1. Source file
FileName: FindMaxValue.java
Author: Billy Zhang ([email protected])
Date: May 27, 2014

2. Input file: data.txt
12 36 90 21 45 410 78 69 231 345 901 821 82 77 38 129 561

3. Compile , run(Hadoop 1.2.3 Version)
run test.sh
Here is the commands in test.sh:


#!/bin/bash
 rm -rf Output*
 rm -rf FindMaxValue.jar

javac -classpath  ${HADOOP_PREFIX}/hadoop-core-${HADOOP_VERSION}.jar:${HADOOP_PREFIX}/lib/commons-cli-1.2.jar -d fd_Classes ./*.java
jar -cvf ./FindMaxValue.jar -C fd_Classes/ .
hadoop fs -rmr Input
hadoop fs -mkdir Input
hadoop fs -copyFromLocal data.txt Input
hadoop fs -rmr Output*
hadoop jar FindMaxValue.jar FindMaxValue Input  Output
hadoop fs -getmerge Output/* Output
cat Output

4 Result
Max elem is : 901

hadoop-project's People

Contributors

hustbill avatar

Watchers

James Cloos avatar  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.