import java.util.Random;
import java.util.*;


	public class main_program {
		 public static void main(String[] args) {
			 
			 
	         Random ran = new Random();  
	         ConsistencyHash hash1 = new ConsistencyHash();
	         hash1.init();
	         hash1.printMap();
	         //循环50次，是为了取50个数来测试效果，当然也可以用其他任何的数据来测试
	         for(int i=0; i<5; i++) {
	        	 System.out.println(hash1.hash(hash1.computeMd5(String.valueOf(i)),ran.nextInt(hash1.VIRTUAL_NUM)));
	             System.out.println(hash1.getShardInfo(hash1.hash(hash1.computeMd5(String.valueOf(i)),ran.nextInt(hash1.VIRTUAL_NUM))));
	         }
	   } 

	
}
