Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi, I need help with a Java Project that I am totally lost in. We are to create

ID: 3837415 • Letter: H

Question

Hi, I need help with a Java Project that I am totally lost in. We are to create a program that makes a to do list, has a text field per task to do, and writes it to a file. If the file does not already exist, it creates it, and if it did already exist, populates the text fields with the tasks. Here are the full requirements.

1. Use of static methods where necessary

2. Read in information from a file

3. Make it graphical with a frame and panel

4. Make sure you use loops, conditionals, logical operators and basic operators

5. Ensure that you have proper class structure

6. Allow users to add new items – depending on your application. If it does not allow for this, please explain why.

7. Use an array to store information

8. Use an ArrayList to store information

Explanation / Answer

As per your requirement iam illstrating Mapreduce program using java on hadoop platform, may it's meet your requirement .. thank you

package wordcount;

import java.io.IOException;

import java.util.*;

import org.apache.hadoop.conf.*;

import org.apache.hadoop.fs.*;

import org.apache.hadoop.conf.*;

import org.apache.hadoop.io.*;

import org.apache.hadoop.mapreduce.*;

import org.apache.hadoop.mapreduce.lib.input.*;

import org.apache.hadoop.mapreduce.lib.output.*;

import org.apache.hadoop.util.*;

public class WordCount extends Configured implements Tool {

public static void main(String args[]) throws Exception {

    int res = ToolRunner.run(new WordCount(), args);

    System.exit(res);

}

public int run(String[] args) throws Exception {

    Path inputPath = new Path(args[0]);

    Path outputPath = new Path(args[1]);

    Configuration conf = getConf();

    Job job = new Job(conf, this.getClass().toString());

    FileInputFormat.setInputPaths(job, inputPath);

    FileOutputFormat.setOutputPath(job, outputPath);

    job.setJobName("WordCount");

    job.setJarByClass(WordCount.class);

    job.setInputFormatClass(TextInputFormat.class);

    job.setOutputFormatClass(TextOutputFormat.class);

    job.setMapOutputKeyClass(Text.class);

    job.setMapOutputValueClass(IntWritable.class);

    job.setOutputKeyClass(Text.class);

    job.setOutputValueClass(IntWritable.class);

    job.setMapperClass(Map.class);

    job.setCombinerClass(Reduce.class);

    job.setReducerClass(Reduce.class);

    return job.waitForCompletion(true) ? 0 : 1;

}

public static class Map extends Mapper<LongWritable, Text, Text, IntWritable> {

    private final static IntWritable IntWritable(1);

    private Text word = new Text();

@Override

    public void map(LongWritable key, Text value,

                    Mapper.Context context) throws IOException, InterruptedException {

      String line = value.toString();

      StringTokenizer tokenizer = new StringTokenizer(line);

      while (tokenizer.hasMoreTokens()) {

        word.set(tokenizer.nextToken());

        context.write(word, one);

      }

    }

}

Public static class Reduce extends Reducer<Text, IntWritable, Text, IntWritable> {

    @Override

    public void reduce(Text key, Iterable<IntWritable> values, Context context) throws IOException, InterruptedException {

      int sum = 0;

      for (IntWritable value : values) {

        sum += value.get();

      }

      context.write(key, new IntWritable(sum));

    }

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote