Giter Site home page Giter Site logo

hello-world's Introduction

hello-world

My first repository

about me: a student, studying on android and hadoop

1.hadoop : public static class Map extends Mapper<Object, Text, IntWritable, Text> {
public void map(Object key, Text value, Context context) throws IOException, InterruptedException { } }

public static class Reduce extends Reducer<Text, Text, Text, Text> { public void reduce (Text key, Text values, Context context) throws IOException, InterruptedException {

  }
  }

public void Mapreduce() throws Exception { Configuration conf = new Configuration(); conf.set("fs.default.name", "hdfs://:9000"); String[] ioArgs = new String[] {"/", "/"}; String[] otherArgs = new GenericOptionsParser(conf, ioArgs).getRemainingArgs(); if(otherArgs.length !=2) { System.err.println("readtif "); System.exit(2); } Job job = new Job(conf, "mrreadtifputtxt"); job.setJarByClass(mrreadtifputtxt.class); job.setMapperClass(Map.class); job.setReducerClass(Reduce.class); job.setMapOutputKeyClass(IntWritable.class); job.setMapOutputValueClass(Text.class); job.setOutputKeyClass(IntWritable.class); job.setOutputValueClass(Text.class); FileInputFormat.addInputPath(job, new Path(otherArgs[0])); FileOutputFormat.setOutputPath(job, new Path(otherArgs[1])); if (job.waitForCompletion(true)) { System.out.println("MapReduce completed!"); System.exit(0); } } public static void main(String[] args) throws Exception { mrreadtifputtxt rtf = new mrreadtifputtxt(); rtf.Mapreduce(); }

hello-world's People

Contributors

uestc-lyx 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.