 public static class MasteringHadoopReduceSideJoinCountryMap extends Mapper<LongWritable, Text, CompositeJoinKeyWritable, Text>{
 
         private static short COUNTRY_CODE_INDEX = 0;
         private static short COUNTRY_NAME_INDEX = 1;
 
         private static CompositeJoinKeyWritable joinKeyWritable = new CompositeJoinKeyWritable("", 1);
         private static Text recordValue = new Text("");
 
         @Override
         protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
 
             String[] tokens = value.toString().split(",", -1);
 
             if(tokens != null){
                 joinKeyWritable.setKey(tokens[COUNTRY_CODE_INDEX]);
                 recordValue.set(tokens[COUNTRY_NAME_INDEX]);
                 context.write(joinKeyWritable, recordValue);
             }
 
 
         }
     }
 
     public static class MasteringHadoopReduceSideJoinCityMap extends Mapper<LongWritable, Text, CompositeJoinKeyWritable, Text>{
 
         private static short COUNTRY_CODE_INDEX = 0;
 
 
         private static CompositeJoinKeyWritable joinKeyWritable = new CompositeJoinKeyWritable("", 2);
         private static Text record = new Text("");
 
         @Override
         protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
 
             String[] tokens = value.toString().split(",", -1);
 
             if(tokens != null){
                 joinKeyWritable.setKey(tokens[COUNTRY_CODE_INDEX]);
                 record.set(value.toString());
                 context.write(joinKeyWritable, record);
             }
 
 
         }
     }
 
 
