public static void main(String[] args) throws RemoteException, AlreadyBoundException, NotBoundException, InterruptedException {
		try {
			Parser.hdfsCoreConf();
			Parser.mapreduceCoreConf();
			Parser.mapreduceJobTrackerConf();
			Parser.mapreduceTaskTrackerIndividualConf();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		JobTrackerSimulator jt = new JobTrackerSimulator();
		
		Registry registry = LocateRegistry.createRegistry(MapReduce.Core.JOB_TRACKER_REGISTRY_PORT);
		JobTrackerRemoteInterface jtStub = (JobTrackerRemoteInterface) UnicastRemoteObject.exportObject(jt, 0);
		registry.bind(MapReduce.Core.JOB_TRACKER_SERVICE_NAME, jtStub);
		
		int chunksNum = 8;
		int reducerNum = 1;
		
		
		String jid = "job001";
		
		String tidPrefix = "task";
		int taskCounter = 1;
		
		/* Open file */
		Registry nameNodeR = LocateRegistry.getRegistry(Hdfs.Core.NAME_NODE_IP, Hdfs.Core.NAME_NODE_REGISTRY_PORT);
		NameNodeRemoteInterface nameNodeS = (NameNodeRemoteInterface) nameNodeR.lookup(Hdfs.Core.NAME_NODE_SERVICE_NAME);
		HDFSFile file1 = null;
		try {
			file1 = nameNodeS.open("hello");
		} catch (IOException e) {
			e.printStackTrace();
			return;
		}
		
		Thread.sleep(1000 * 3);
		
//		String mapperClassName = null;
//		String reducerClassName = null;
		
//		try {
//			mapperClassName = jt.loadMapperClass();
//			reducerClassName = jt.loadReducerClass();
//		} catch (IOException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		} catch (ClassNotFoundException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
		
		for (int mapperSEQ = 0; mapperSEQ < chunksNum; mapperSEQ++) {
			Split split = new Split(file1, mapperSEQ);
			JarFileEntry jarEntry = new JarFileEntry("128.237.222.59", "/Users/JeremyFu/Dropbox/WordCount.jar");
			jt.taskList.add(new MapperTask(jid, String.format("%s%03d", tidPrefix, taskCounter++), split, "WordCount.WordCountMapper", reducerNum, jarEntry));
		}

		Thread.sleep(1000 * 15);
		
		for (int reducerSEQ = 0; reducerSEQ < reducerNum; reducerSEQ++) {
			PartitionEntry[] partitionEntry = new PartitionEntry[chunksNum];
			for (int i = 0; i < chunksNum; i++) {
				partitionEntry[i] = new PartitionEntry(String.format("%s%03d", tidPrefix, (i+1)), "localhost", MapReduce.TaskTracker.Individual.TASK_TRACKER_SERVER_PORT);
				System.err.println(String.format("%s%03d", tidPrefix, (i+1)));
			}
			JarFileEntry jarEntry = new JarFileEntry("localhost", "/Users/JeremyFu/Dropbox/WordCount.jar");
			jt.taskList.add(new ReducerTask(jid, String.format("%s%03d", tidPrefix, taskCounter++), reducerSEQ, "WordCount.WordCountReducer", partitionEntry, "output-part" + reducerSEQ, jarEntry));

		}	

	}