package com.mapreduce;
import java.io.IOException;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import com.commons.UrlData;
import com.utils.LoggerUtils;
public class DataGettingMapper extends Mapper<Object, Text, Text, Text> {
protected void map(
Object key,
Text value,
org.apache.hadoop.mapreduce.Mapper<Object, Text, Text, Text>.Context context)
throws IOException, InterruptedException {
LoggerUtils.log(DataGettingMapper.class.getName(), "map key:" + key
+ " value:" + value);
UrlData data = new UrlData();
data.decode(value.toString());
Text outputKey = new Text();
outputKey.set(data.getUrlName());
Text url = new Text();
url.set(data.getUrl());
context.write(outputKey, url);
}
}