public static void main(String[] args) {
		// -------------------------Initialize Job Information------------------------------------
		String startJobId = "job_201301181454_0001";
		//String startJobId = "job_201212172252_0001";
		//String jobName = "uservisits_aggre-pig-256MB";
		//String jobName = "SampleWordCountWiki";
		//String jobName = "BuildCompIndex-m36-r18";
		//String jobName = "Wiki-m36-r18";
		//String jobName = "BigTwitterInDegreeCount";
		//String jobName = "big-uservisits_aggre-pig-256MB";
		//String jobName = "BigTwitterBiDirectEdgeCount";
		//String jobName = "BigTeraSort";
		//String jobName = "SampleTeraSort-1G";
		String jobName = "Big-uservisits_aggre-pig-50G";
		//String jobName = "Big-uservisits_aggre-pig-50G";
		//String baseDir = "/home/xulijie/MR-MEM/NewExperiments2/";
		//String baseDir = "/home/xulijie/MR-MEM/NewExperiments3/";
		//String baseDir = "/home/xulijie/MR-MEM/NewExperiments3/";
		//String baseDir = "/home/xulijie/MR-MEM/SampleExperiments/";
		String baseDir = "/home/xulijie/MR-MEM/BigExperiments/";
		
		int reduceBase = 9;
		boolean onlineEstimate = false;
		String hostname = "master";
		int iterateNum = 192;
		int[] splitMBs = {64, 128, 256};
		
		
		//String outputDir = "/home/xulijie/MR-MEM/NewExperiments/Wiki-m36-r18-256MB/estimatedJvmCost/";
		//String outputDir = "/home/xulijie/MR-MEM/NewExperiments/uservisits_aggre-pig-256MB/estimatedJvmCost/";
		//String outputDir = "/home/xulijie/MR-MEM/NewExperiments/TeraSort-256MB-m36-r18/estimatedJvmCost/";
		//String outputDir = "/home/xulijie/MR-MEM/NewExperiments2/BuildCompIndex-m36-r18-256MB/estimatedJvmCost/";
		String outputDir = baseDir + jobName + "/estimatedJvmCost/";
		
		
		
		boolean needMetrics = true; //going to analyze task counters/metrics/jvm?
		int sampleMapperNum = 0; // only analyze the first sampleMapperNum mappers (0 means all the mappers)
		int sampleReducerNum = 0; // only analyze the first sampleReducerNum reducers (0 means all the reducers)
		boolean useRuntimeMaxJvmHeap = false; //since reducers' actual JVM heap is less than mapred.child.java.opts, 
											 //this parameter determines whether to use the actual JVM heap to estimate
		
		//--------------------------Setting ends------------------------------------
		
		
		
		DecimalFormat nf = new DecimalFormat("0000");
		
		for(int i = 0; i < iterateNum; i++) {
			String prefix = startJobId.substring(0, startJobId.length() - 4);
			int suffix = Integer.parseInt(startJobId.substring(startJobId.length() - 4));
			String jobId = prefix + nf.format(suffix + i);		
			//--------------------------Profiling the run job-----------------------------
			AllBatchJobMemoryEstimator je = new AllBatchJobMemoryEstimator();
			boolean successful;
			if(onlineEstimate == true)
				successful = je.profile(hostname, jobId, needMetrics, sampleMapperNum, sampleReducerNum);
			else
				successful = je.profile(baseDir, jobName, "serialJob", jobId);
			//--------------------------Profiling ends-----------------------------
			
			if(splitMap.isEmpty())
				computeSplitMap(splitMBs, je.job.getJobConfiguration());
			//--------------------------Estimating Data Flow and Memory-----------------------------
			if(successful == false) {
				System.err.println("[" + jobId + "] is a failed job");
				continue;
			}
					
			try {
				je.batchEstimateDataAndMemory(useRuntimeMaxJvmHeap, outputDir + jobId, reduceBase);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}	
			//--------------------------Estimating ends-----------------------------
			System.out.println("Finish estimating " + jobId);
		}	
	}