Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            int result = JumpHash.JumpConsistentHash(3, 15);

            Console.WriteLine($"buckets: {result}");
            result = JumpHash.JumpConsistentHash(3, 17);
            Console.WriteLine($"buckets: {result}");

            var ip = "192.168.1.10";

            Console.WriteLine(ip.GetHashCode());
            result = JumpHash.JumpConsistentHash(ip, 20);
            Console.WriteLine($"buckets: {result}");
            Console.WriteLine(ip.GetHashCode());
            result = JumpHash.JumpConsistentHash(ip, 22);
            Console.WriteLine($"buckets: {result}");
        }
Ejemplo n.º 2
0
 public int GetJumpHashTimeDifference()
 {
     return(JumpHash.JumpConsistentHash(Convert.ToUInt64(Major) + Convert.ToUInt64(Minor), AppConstants.NumberOfGroup));
 }
Ejemplo n.º 3
0
 public int GetJumpHashTime()
 {
     return(JumpHash.JumpConsistentHash(JumpConsistentSeed, 86400));
 }
Ejemplo n.º 4
0
 public int GetJumpHashTimeDifference()
 {
     return(JumpHash.JumpConsistentHash(JumpConsistentSeed, AppConstants.NumberOfGroup));
 }