Can anyone explain why we are writing arguments in angle brackets in below statement and why we are defining output key/value pairs in arguments.
public static class Map extends Mapper <LongWritable, Text, Text, IntWritable>
What is context object and why we are using in the below statement.
public void map(LongWritable key, Text value, Context context ) throws IOException, InterruptedException
<> is used to indicate generics in Java.
Mapper
<LongWritable, Text, Text, IntWritable>takes only<LongWritable,Text>as keys and<Text,IntWritable>as values. If you try to provide any other writable types to your mapper, this will throw an error.Contextcontext object is used to write outputKey-Valuesas well as getconfiguration, counters, cacheFilesetc in theMapper.