Jumphash
Jump Consistent Hashing algorithm in Java
Install / Use
/learn @streametry/JumphashREADME
JumpHash
Jump Consistent Hashing algorithm in Java
Abstract from the paper http://arxiv.org/abs/1406.2294:
We present jump consistent hash, a fast, minimal memory, consistent hash algorithm that can be expressed in about 5 lines of code. In comparison to the algorithm of Karger et al., jump consistent hash requires no storage, is faster, and does a better job of evenly dividing the key space among the buckets and of evenly dividing the workload when the number of buckets changes. Its main limitation is that the buckets must be numbered sequentially, which makes it more suitable for data storage applications than for distributed web caching.
Uses Guava library for unsigned longs.
Usage
int bucket = JumpHash.consistent(nrOfBuckets, myObject);
Download
Available on Maven central:
- com.streametry:jumphash:1.0
Requires Java 1.8
Build
gradle jar
License
MIT
Related Skills
node-connect
349.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.7kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
