public static void rerunMap(List<String> brokenNode) {
       /* while(true){
            if(MPCoordinator.getTaskMap().isEmpty())
                break;
        }*/
	System.out.println("-------------Start rerunning!--------------------");
       // curTaskId = 0;
        for(MapReduceJob newJob : jobDump){
            List<Task> allTasks = new ArrayList<>();
            List<Integer> mapperTaskId = new ArrayList<>();
            List<Integer> reducerTaskId = new ArrayList<>();
	 

		String MPFinalOutputFile = Config.MAP_RESULTS_FOLDER + "MP_Result_" + newJob.getInputFile();
            File file = new File(MPFinalOutputFile);

            if(file.delete()){
                System.out.println(file.getName() + " is deleted!");
            }else{
                System.out.println("Delete operation is failed.");
            }



	   String hostname;
            for (int slaveid=0;slaveid < Config.SLAVE_NODES.length;slaveid++) {
                 if( brokenNode.contains(Config.SLAVE_NODES[slaveid])) {
                    hostname = Config.SLAVE_NODES[slaveid+1];
                    ;
                }
                else {
                    hostname = Config.SLAVE_NODES[slaveid];
                }
		allTasks.add(new MapperTask(newJob.getMapper(), hostname, curTaskId, newJob.getInputFile()));
                mapperTaskId.add(curTaskId++);
            }

            for (int i = 0; i < Config.SLAVE_NODES.length - jobDump.size(); i++) {
                ReducerTask reducetask = new ReducerTask(newJob.getReducer(), i, mapperTaskId, curTaskId, newJob.getInputFile());
                allTasks.add(reducetask);
                reducerTaskId.add(curTaskId++);
            }
            relatedReducers.put(newJob.getInputFile(), reducerTaskId);
            coordinator.scheduleMapperTasks(allTasks);
        }

    }