-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove openhft hashing from source dependency
- Loading branch information
Showing
8 changed files
with
60 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/redis/clients/jedis/csc/hash/SimpleCommandHasher.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package redis.clients.jedis.csc.hash; | ||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* This {@link CommandLongHasher} implementation is simply based on {@link Arrays#hashCode(long[])} | ||
* and {@link Arrays#hashCode(byte[])}. These methods actually produce 32-bit hash codes. It is | ||
* advised to use proper 64-bit hash codes in production. | ||
*/ | ||
public final class SimpleCommandHasher extends AbstractSimpleCommandHasher { | ||
|
||
public static final SimpleCommandHasher INSTANCE = new SimpleCommandHasher(); | ||
|
||
public SimpleCommandHasher() { } | ||
|
||
@Override | ||
protected long hashLongs(long[] longs) { | ||
return Arrays.hashCode(longs); | ||
} | ||
|
||
@Override | ||
protected long hashBytes(byte[] bytes) { | ||
return Arrays.hashCode(bytes); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 3 additions & 17 deletions
20
src/test/java/redis/clients/jedis/csc/MapClientSideCache.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 7 additions & 2 deletions
9
.../jedis/csc/hash/OpenHftCommandHasher.java → ...ients/jedis/csc/OpenHftCommandHasher.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters