README ¶ go实现一个分片的哈希表 使用方法: // 线程安全 cs := NewCamp() cs.Set("shgopher",shgopher) cs.Get("shgopher") 本方法就是一种使用了,一致性哈希,然后将问题分布式的一种算法。通过哈希函数,将这些写入和读取的过程分为不同的组去处理,然后锁的颗粒度自然就降低了 Expand ▾ Collapse ▴ Documentation ¶ Index ¶ Constants func FnvHash(key string) uint32 type CampSlice func NewCmap() CampSlice func (c CampSlice) Get(key string) interface{} func (c CampSlice) Set(key string, value interface{}) Constants ¶ View Source const ( PIECE_NUMBER = 32 ) Variables ¶ This section is empty. Functions ¶ func FnvHash ¶ func FnvHash(key string) uint32 Types ¶ type CampSlice ¶ type CampSlice []*cmap func NewCmap ¶ func NewCmap() CampSlice func (CampSlice) Get ¶ func (c CampSlice) Get(key string) interface{} func (CampSlice) Set ¶ func (c CampSlice) Set(key string, value interface{}) Source Files ¶ View all Source files cmap.go Click to show internal directories. Click to hide internal directories.