package edu.purdue.cs307.team16;

import java.io.IOException;

import org.apache.commons.lang.SerializationUtils;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.*;


import org.apache.commons.codec.binary.Base64;


public class Reduce extends Reducer<Text, Text, Text, Text> {	
	
	Integer passNum = 0;
	ResearcherMapReduceAnalysis analysis = null;
	
	public void reduce(Text keyname, Iterable<Text> str, Context context) throws IOException, InterruptedException {
		if(analysis == null) analysis = new ResearcherMapReduceAnalysis();
    	
    	for(Text val : str) {
    		byte[] dataByte = null;
    		Object obj =  null;
    		dataByte = Base64.decodeBase64(val.toString());
    		System.out.println(val.toString());
    		obj = (MapReduceSerializer) SerializationUtils.deserialize(dataByte);
    		MapReduceSerializer MAS = (MapReduceSerializer)obj;
    		analysis.reduce(MAS.serializeMe);
    		passNum++;
    	}
    	
       	byte[] databyte = SerializationUtils.serialize(analysis.serializer);      	
       	String byte_to_string = Base64.encodeBase64String(databyte);
       	
    	context.write(new Text("Run#" + passNum.toString()), new Text(byte_to_string));

    }

}

@@ -618,26 +618,31 @@
   %09%09
-Object obj =  null
+MapReduceSerializer obj
 ;%0A  
@@ -697,50 +697,8 @@
 ));%0A
-    %09%09System.out.println(val.toString());%0A
     
@@ -773,66 +773,8 @@
 e);%0A
-    %09%09MapReduceSerializer MAS = (MapReduceSerializer)obj;%0A
     
@@ -795,11 +795,11 @@
 uce(
-MAS
+obj
 .ser

Make this more concise