public void Run() {
		try {
			this.heartBeatThread.start();
			ArrayList<KeyValuePair<Key1, Value1>> inputList = new ArrayList<KeyValuePair<Key1, Value1>>();
			for(String path:localInputPaths){
				FileInputStream fis = new FileInputStream(path);
				ObjectInputStream ois = new ObjectInputStream(fis);
				ArrayList<KeyValuePair<Key1, Value1>> subList = (ArrayList<KeyValuePair<Key1, Value1>>) ois.readObject();
				ois.close();
				inputList.addAll(subList);
			}
			//TODO merge sort
			Collections.sort(inputList);
			
			Reducer<Key1, Value1, Key2, Value2> r = reducerClass.newInstance();

			Logger.log(outputLocalPath);
			Context<Key2, Value2> context = new Context<Key2, Value2>(outputLocalPath);
			Key1 previousKey = null;
			ArrayList<Value1> valueList = null;
			for(KeyValuePair<Key1, Value1> p: inputList){
				if(previousKey == null || !previousKey.equals(p.key)){
					if(valueList !=null)
						r.reduce(previousKey, valueList, context);
					
					valueList = new ArrayList<Value1>();
					valueList.add(p.value);
					previousKey = p.key;
						
				}
				else
					valueList.add(p.value);
			}
			if(valueList!=null && previousKey!=null)
				r.reduce(previousKey, valueList, context);
			
			context.dumpToFile();

			this.percent = 100;
		} catch (InstantiationException|IllegalAccessException e) {
			Logger.log(e.getMessage());
			e.printStackTrace();
		}catch(Exception ex){
			Logger.log("2"+ex.getMessage());
		}

	}