cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cassandra] dcapwell commented on a change in pull request #435: repair token boundary in-jvm tests for CASSANDRA-15542
Date Wed, 05 Feb 2020 02:12:12 GMT
dcapwell commented on a change in pull request #435: repair token boundary in-jvm tests for
CASSANDRA-15542
URL: https://github.com/apache/cassandra/pull/435#discussion_r375026687
 
 

 ##########
 File path: src/java/org/apache/cassandra/utils/MurmurHash.java
 ##########
 @@ -248,4 +251,108 @@ public static void hash3_x64_128(ByteBuffer key, int offset, int length,
long se
         result[1] = h2;
     }
 
+    protected static long invRotl64(long v, int n)
+    {
+        return ((v >>> n) | (v << (64 - n)));
+    }
+
+    protected static long invRShiftXor(long value, int shift)
+    {
+        long output = 0;
+        long i = 0;
+        while (i * shift < 64)
+        {
+            long c = (0xffffffffffffffffL << (64 - shift)) >>> (shift * i);
+            long partOutput = value & c;
+            value ^= partOutput >>> shift;
+            output |= partOutput;
+            i += 1;
+        }
+        return output;
+    }
+
+    protected static long invFmix(long k)
+    {
+        k = invRShiftXor(k, 33);
+        k *= 0x9cb4b2f8129337dbL;
+        k = invRShiftXor(k, 33);
+        k *= 0x4f74430c22a54005L;
+        k = invRShiftXor(k, 33);
+        return k;
+    }
+
+    /**
+     * This gives a correct reversal of the tail byte flip which is needed if want a non
mod16==0 byte hash inv or to
+     * target a hash for a given schema.
+     */
+    public static long invTailReverse(long num)
 
 Review comment:
   dead code?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message