Documentation ¶
Index ¶
- Constants
- type HashMap
- func (m *HashMap) Close()
- func (m *HashMap) Del(key string) ([]byte, bool)
- func (m *HashMap) Get(key string) ([]byte, bool)
- func (m *HashMap) GetHighestDIB() uint8
- func (m *HashMap) Len() int
- func (m *HashMap) PercentFull() float64
- func (m *HashMap) Range(it Iterator)
- func (m *HashMap) Set(key string, value []byte) ([]byte, bool)
- type HashMapGP
- func (m *HashMapGP) Close()
- func (m *HashMapGP) Del(key string) (interface{}, bool)
- func (m *HashMapGP) Get(key string) (interface{}, bool)
- func (m *HashMapGP) GetHighestDIB() uint8
- func (m *HashMapGP) Len() int
- func (m *HashMapGP) PercentFull() float64
- func (m *HashMapGP) Range(it IteratorGP)
- func (m *HashMapGP) Set(key string, value interface{}) (interface{}, bool)
- type HashMapU64
- func (m *HashMapU64) Close()
- func (m *HashMapU64) Del(key uint64) (uint64, bool)
- func (m *HashMapU64) Get(key uint64) (uint64, bool)
- func (m *HashMapU64) GetHighestDIB() uint8
- func (m *HashMapU64) Len() int
- func (m *HashMapU64) PercentFull() float64
- func (m *HashMapU64) Range(it IteratorU64)
- func (m *HashMapU64) Set(key uint64, value uint64) (uint64, bool)
- type Iterator
- type IteratorGP
- type IteratorU64
- type ShardedHashMap
- func (s *ShardedHashMap) Add(key string, val []byte) ([]byte, bool)
- func (s *ShardedHashMap) Close()
- func (s *ShardedHashMap) Del(key string) ([]byte, bool)
- func (s *ShardedHashMap) Get(key string) ([]byte, bool)
- func (s *ShardedHashMap) GetBit(key string, idx uint) (uint, bool)
- func (s *ShardedHashMap) GetUint(key string) (uint64, bool)
- func (s *ShardedHashMap) Len() int
- func (s *ShardedHashMap) Range(it Iterator)
- func (s *ShardedHashMap) Set(key string, val []byte) ([]byte, bool)
- func (s *ShardedHashMap) SetBit(key string, idx uint, bit uint) bool
- func (s *ShardedHashMap) SetUint(key string, num uint64) (uint64, bool)
- func (s *ShardedHashMap) Stats()
Constants ¶
const ( DefaultLoadFactor = 0.90 // load factor must exceed 50% DefaultMapSize = 16 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashMap ¶
type HashMap struct {
// contains filtered or unexported fields
}
HashMap represents a closed hashing hashtable implementation
func NewHashMap ¶
NewHashMap returns a new HashMap instantiated with the specified size or the DefaultMapSize, whichever is larger
func (*HashMap) Close ¶
func (m *HashMap) Close()
Close closes and frees the current hashmap. Calling any method on the HashMap after this will most likely result in a panic
func (*HashMap) Del ¶
Del removes a value for a given key and returns the deleted value, or false Del can be considered the exported version of the delete call
func (*HashMap) Get ¶
Get returns a value for a given key, or returns false if none could be found Get can be considered the exported version of the lookup call
func (*HashMap) GetHighestDIB ¶
GetHighestDIB returns the highest distance to initial bucket value in the table
func (*HashMap) PercentFull ¶
PercentFull returns the current load factor of the HashMap
type HashMapGP ¶ added in v1.7.0
type HashMapGP struct {
// contains filtered or unexported fields
}
HashMapGP represents a closed hashing hashtable implementation
func NewHashMapGP ¶ added in v1.7.0
NewHashMapGP returns a new HashMapGP instantiated with the specified size or the DefaultMapSize, whichever is larger
func (*HashMapGP) Close ¶ added in v1.7.0
func (m *HashMapGP) Close()
Close closes and frees the current hashmap. Calling any method on the HashMapGP after this will most likely result in a panic
func (*HashMapGP) Del ¶ added in v1.7.0
Del removes a value for a given key and returns the deleted value, or false Del can be considered the exported version of the delete call
func (*HashMapGP) Get ¶ added in v1.7.0
Get returns a value for a given key, or returns false if none could be found Get can be considered the exported version of the lookup call
func (*HashMapGP) GetHighestDIB ¶ added in v1.7.0
GetHighestDIB returns the highest distance to initial bucketGP value in the table
func (*HashMapGP) Len ¶ added in v1.7.0
Len returns the number of entries currently in the HashMapGP
func (*HashMapGP) PercentFull ¶ added in v1.7.0
PercentFull returns the current load factor of the HashMapGP
func (*HashMapGP) Range ¶ added in v1.7.0
func (m *HashMapGP) Range(it IteratorGP)
Range takes an Iterator and ranges the HashMapGP as long as long as the iterator function continues to be true. Range is not safe to perform an insert or remove operation while ranging!
type HashMapU64 ¶
type HashMapU64 struct {
// contains filtered or unexported fields
}
HashMapU64 represents a closed hashing hashtable implementation
func NewHashMapU64 ¶
func NewHashMapU64(size uint) *HashMapU64
NewHashMapU64 returns a new HashMapU64 instantiated with the specified size or the DefaultMapSize, whichever is larger
func (*HashMapU64) Close ¶
func (m *HashMapU64) Close()
Close closes and frees the current hashmap. Calling any method on the HashMapU64 after this will most likely result in a panic
func (*HashMapU64) Del ¶
func (m *HashMapU64) Del(key uint64) (uint64, bool)
Del removes a value for a given key and returns the deleted value, or false Del can be considered the exported version of the delete call
func (*HashMapU64) Get ¶
func (m *HashMapU64) Get(key uint64) (uint64, bool)
Get returns a value for a given key, or returns false if none could be found Get can be considered the exported version of the lookup call
func (*HashMapU64) GetHighestDIB ¶
func (m *HashMapU64) GetHighestDIB() uint8
GetHighestDIB returns the highest distance to initial bucketU64 value in the table
func (*HashMapU64) Len ¶
func (m *HashMapU64) Len() int
Len returns the number of entries currently in the HashMapU64
func (*HashMapU64) PercentFull ¶
func (m *HashMapU64) PercentFull() float64
PercentFull returns the current load factor of the HashMapU64
func (*HashMapU64) Range ¶
func (m *HashMapU64) Range(it IteratorU64)
Range takes an Iterator and ranges the HashMapU64 as long as long as the iterator function continues to be true. Range is not safe to perform an insert or remove operation while ranging!
type IteratorGP ¶ added in v1.7.0
IteratorGP is an iterator function type
type IteratorU64 ¶
IteratorU64 is an iterator function type
type ShardedHashMap ¶
type ShardedHashMap struct {
// contains filtered or unexported fields
}
func NewShardedHashMap ¶
func NewShardedHashMap(size uint) *ShardedHashMap
NewShardedHashMap returns a new hashMap instantiated with the specified size or the defaultMapSize, whichever is larger
func (*ShardedHashMap) Close ¶
func (s *ShardedHashMap) Close()
func (*ShardedHashMap) Len ¶
func (s *ShardedHashMap) Len() int
func (*ShardedHashMap) Range ¶
func (s *ShardedHashMap) Range(it Iterator)
func (*ShardedHashMap) SetBit ¶
func (s *ShardedHashMap) SetBit(key string, idx uint, bit uint) bool
func (*ShardedHashMap) SetUint ¶
func (s *ShardedHashMap) SetUint(key string, num uint64) (uint64, bool)
func (*ShardedHashMap) Stats ¶
func (s *ShardedHashMap) Stats()