Documentation ¶
Index ¶
Constants ¶
View Source
const (
LOAD_FACTOR = 5
)
LOAD_FACTOR
in order to reduce the conflict of hash * hash array can be LOAD_FACTOR times larger than nodePool
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashSet ¶
type HashSet struct {
// contains filtered or unexported fields
}
func NewHashSet ¶
func NewHashSet(elemNum int, elemSize int, isFixKeyLen bool, hashFunc func([]byte) uint64) (*HashSet, error)
NewHashSet creates a newHashSet
PARAMS:
- elemNum: max element num of hashSet
- elemSize: maxSize of hashKey after it converted to []byte
- isFixKeyLen: fixed element size or not
- hashFunc: hash function
RETURNS:
- (*HashSet, nil), if success
- (nil, error), if fail
func (*HashSet) Add ¶
Add - add an element into the set
PARAMS:
- key: []byte, element of the set
RETURNS:
- nil, if succeed
- error, if fail
Click to show internal directories.
Click to hide internal directories.