void resampleProcess() throws FileNotFoundException{
	//Scan entries in the index
	java.util.Iterator<Entry<String, long[]>> iter = index.entrySet().iterator();

	long conNo ;
	int evictCount=0;
	while(iter.hasNext()){
		entryCount++;
		long meta[] = iter.next().getValue();	
		if(meta[0]<=threshold && evictCount < samplingRate*evict){ //pick out entries which have low hitting rate
			lowHit++;
			evictCount++;
			conNo = meta[1];
			if(!segRecord.containsKey(conNo)){//if this segment has not been processed				
					segRecord.put(conNo, 1);//record the container that has been resampled
					//locate the specific container
					File conToResample = new File(storageFileFolder+"/"+ conNo);
					Scanner inputStream = new Scanner(conToResample);	
					//use another folder to record the new sampled de segment
	            
					PrintWriter out = new PrintWriter(dirFile+"/"+ conNo);
					out.println("Segment No,FileName,ChunkName,ChunkSize,HashValue,reSampleTag,Hitting Rate, ContainerNo");	
					//start to resample, put old indexes into the temp hash record for the future use
					inputStream.nextLine();
					while(inputStream.hasNextLine()){
						String[] ary= inputStream.nextLine().split(",");
						out.print(ary[0]);
						out.print(",");
						out.print(ary[1]);
						out.print(",");
						out.print(ary[2]);
						out.print(",");
						out.print(ary[3]);
						out.print(",");
						out.print(ary[4]);
						out.print(",");		
					long hash = Long.parseLong(ary[4].substring(30),16);
					if(((ary[5].substring(0,3).equals("Not"))) && check(hash)){//if the chunk was not sampled, process it
															// otherwise, put it into the temp hash record
						out.print("Re"+ary[4]); 
	    				out.print(",");
	                    out.print((long)0);
	    				out.print(",");
	    				out.println(ary[7]);	
					}else if(ary[5].substring(0,6).equals("DupNot") && check(hash)){
						out.print("DupRe"+ary[4]); 
	    				out.print(",");
	                    out.print((long)0);
	    				out.print(",");
	    				out.println(ary[7]);
					}else{ //if(!ary[5].substring(0,3).equals("Not") || !ary[5].substring(0,6).equals("DupNot")){	
						out.print(ary[5]); 
	    				out.print(",");
	                    out.print(ary[6]);
	    				out.print(",");
	    				out.println(ary[7]);			
					}
					}
					out.close();
			}		
		}
	}

	
}