Assignment5_P3_PartitionPattern.Partition_IPAddress_By_Month_Reducer.java Source code

Java tutorial

Introduction

Here is the source code for Assignment5_P3_PartitionPattern.Partition_IPAddress_By_Month_Reducer.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Assignment5_P3_PartitionPattern;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 *
 * @author Chintan
 */
public class Partition_IPAddress_By_Month_Reducer extends Reducer<IntWritable, Text, Text, NullWritable> {

    public void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
        for (Text value : values) {
            context.write(value, NullWritable.get());
        }
    }
}