public static void dumpFilesAndValidate(Properties props, HashMap<Integer, Integer>[] seqTracker , HashMap<Integer, Integer>[] staleSeqTracker, HashMap<String, Integer> stalenessStats, PrintWriter outpS, String dir){ 

		// open files for all threads one by one and read the records into the memory
		ConcurrentHashMap<String, resourceUpdateStat> updateStats = new ConcurrentHashMap<String, resourceUpdateStat>();
		HashMap<String, Integer> initCnt = CoreWorkload.initStats;		
		int numUpdates = 0;
		String ratingMode = props.getProperty(Client.RATING_MODE_PROPERTY, Client.RATING_MODE_PROPERTY_DEFAULT);
		String approach = props.getProperty(VALIDATION_APPROACH_PROPERTY,
				VALIDATION_APPROACH_PROPERTY_DEFAULT);


		if(ratingMode.equals("true")){
			outpS.write("StartingValidation ");
			outpS.flush();
		}
		long validationStart = System.currentTimeMillis();
		//read all the updates and update UpdateStats
		System.out.println("\t-- Starting to read update files...");
		long fileReadStart = System.currentTimeMillis();
		numUpdates = readUpdateFiles(props, updateStats, dir);
		if(ratingMode.equals("true")){
			outpS.write("UpdatesInDB ");
			outpS.flush();
		}
		System.out.println("\t-- Done reading update files..");
		System.out.println("\t-- UpdateProcessingDuration(ms):"+(System.currentTimeMillis()-fileReadStart));
		if(approach.equalsIgnoreCase("RDBMS")){
			buildValidationIndexes(props);
		}
		//create validation status thread
		System.out.println("\t-- Starting to read the read files...");
		fileReadStart = System.currentTimeMillis();
		TotalValidationThreadResults finalRes = readReadFiles(props, updateStats, dir, seqTracker, initCnt, staleSeqTracker);
		System.out.println("\t-- Done reading read files...");
		System.out.println("\t-- ReadValidationDuration(ms):"+(System.currentTimeMillis()-fileReadStart));
		if(ratingMode.equals("true")){
			outpS.write("DoneReadCycles ");
			outpS.flush();
			outpS.write("DOneReadValidation ");
			outpS.flush();
		}

		//populate statistics
		stalenessStats.put("NumReadOps",(finalRes.getNumReadOpsProcessed()+finalRes.getPruned()));
		stalenessStats.put("NumProcessed",finalRes.getNumReadOpsProcessed());
		stalenessStats.put("NumWriteOps",numUpdates);
		stalenessStats.put("NumStaleOps",finalRes.getNumStaleReadsreturned());
		stalenessStats.put("NumPruned",finalRes.getPruned()); 
		System.out.println("\t TotalReadOps = " + (finalRes.getNumReadOpsProcessed()+finalRes.getPruned()) + " ,staleReadOps="
				+ finalRes.getNumStaleReadsreturned() + " ,staleness Perc (gran:user)="
				+ (((double) (finalRes.getNumStaleReadsreturned()) / (finalRes.getNumReadOpsProcessed()+finalRes.getPruned()))));

		int totalSeq = 0;
		for(int j=0; j<Integer.parseInt(props.getProperty("threadcount","1")); j++){
			if(seqTracker[j] != null)
				totalSeq += seqTracker[j].size();
		}
		
		int totalStaleSeq = 0;
		for(int j=0; j<Integer.parseInt(props.getProperty("threadcount","1")); j++){
			if(staleSeqTracker[j] != null)
				totalStaleSeq += staleSeqTracker[j].size();
		}
		
		System.out.println("\t TotalSeqRead = " + totalSeq + " ,staleSeqRead="
				+ totalStaleSeq + " ,staleness Perc (gran:user)="
				+ (((double) (totalStaleSeq)) / totalSeq));
		stalenessStats.put("NumReadSessions",totalSeq);
		stalenessStats.put("NumStaleSessions",totalStaleSeq);
		stalenessStats.put("ValidationTime", (int)(System.currentTimeMillis()-validationStart));
		if(ratingMode.equals("true")){
			outpS.write("PopulateStats ");
			outpS.flush();
		}

	}