Example usage for org.apache.hadoop.mapred Mapper interface-usage

List of usage examples for org.apache.hadoop.mapred Mapper interface-usage

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred Mapper interface-usage.

Usage

From source file crimeScoreMapper.java

public class crimeScoreMapper extends MapReduceBase implements Mapper<LongWritable, Text, Text, IntWritable> {

    public void map(LongWritable key, Text value, OutputCollector<Text, IntWritable> output, Reporter reporter)
            throws IOException {

        StringTokenizer tokenizer = new StringTokenizer(value.toString(), ",");

From source file BinomialSamplerMapper.java

public class BinomialSamplerMapper extends MapReduceBase implements Mapper<LongWritable, Text, IntWritable, Text> {
    private int reducersNum;
    private int datasetSize;

    @Override
    public void configure(JobConf conf) {

From source file DistribCountingMapper.java

public class DistribCountingMapper extends MapReduceBase implements Mapper<LongWritable, Text, Text, IntWritable> {
    @Override
    public void map(LongWritable lineNum, Text value, OutputCollector<Text, IntWritable> output, Reporter reporter)
            throws IOException {
        IntWritable one = new IntWritable(1);
        HashSet<String> transactionItems = new HashSet<String>();

From source file PartitionMapper.java

public class PartitionMapper extends MapReduceBase implements Mapper<LongWritable, Text, IntWritable, Text> {
    private int reducersNum;

    @Override
    public void configure(JobConf conf) {
        reducersNum = conf.getInt("PARMM.reducersNum", 64);

From source file RandIntPartSamplerMapper.java

public class RandIntPartSamplerMapper extends MapReduceBase
        implements Mapper<NullWritable, TextArrayWritable, IntWritable, Text> {
    private int id;
    private int reducersNum;
    private int toSample;
    private IntWritable[] sampleDestinations;

From source file CoinFlipSamplerMapper.java

public class CoinFlipSamplerMapper extends MapReduceBase implements Mapper<LongWritable, Text, IntWritable, Text> {
    private int reducersNum;
    private int datasetSize;

    @Override
    public void configure(JobConf conf) {

From source file AnagramMapper.java

/**
 * The Anagram mapper class gets a word as a line from the HDFS input and sorts the
 * letters in the word and writes its back to the output collector as 
 * Key : sorted word (letters in the word sorted)
 * Value: the word itself as the value.
 * When the reducer runs then we can group anagrams togather based on the sorted key.

From source file SleepJob.java

/**
 * Dummy class for testing MR framefork. Sleeps for a defined period 
 * of time in mapper and reducer. Generates fake input for map / reduce 
 * jobs. Note that generated number of input pairs is in the order 
 * of <code>numMappers * mapSleepTime / 100</code>, so the job uses
 * some disk space.

From source file FriendsMapper.java

/**
 * The Anagram mapper class gets a word as a line from the HDFS input and sorts the
 * letters in the word and writes its back to the output collector as 
 * Key : sorted word (letters in the word sorted)
 * Value: the word itself as the value.
 * When the reducer runs then we can group anagrams togather based on the sorted key.

From source file Gapper.java

public class Gapper extends MapReduceBase implements Mapper<Text, Text, Text, Text> {
    public void map(Text attacker, Text victim, OutputCollector<Text, Text> output, Reporter reporter)
            throws IOException {
        output.collect(victim, attacker);
    }
}