Documentation ¶
Index ¶
- Constants
- type Cell_LT_
- type EmptyStruct_LT_
- type HashTableCustomMetadata_LT_
- type HashTableMetadata_LT_
- type HashTable_LT_
- func (t *HashTable_LT_) Bytes() []byte
- func (t *HashTable_LT_) Clear()
- func (t *HashTable_LT_) Compact()
- func (t *HashTable_LT_) DeleteCell_LT_(cell *Cell_LT_)
- func (t *HashTable_LT_) DeleteKey(key uint64)
- func (t *HashTable_LT_) DestroyHashTable()
- func (t *HashTable_LT_) Insert(key uint64) (*Cell_LT_, bool)
- func (t *HashTable_LT_) Lookup(key uint64) *Cell_LT_
- func (h *HashTable_LT_) NewIterator() *_LT_Iterator
- func (t *HashTable_LT_) Repopulate(desiredSize uint64)
- func (t *HashTable_LT_) Save()
- func (t *HashTable_LT_) UpdateChecksum()
Constants ¶
const MAGIC_NUMBER_LT_ = 0x123456789ABCDEF
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmptyStruct_LT_ ¶
type EmptyStruct_LT_ struct{}
type HashTableCustomMetadata_LT_ ¶
type HashTableCustomMetadata_LT_ struct {
// contains filtered or unexported fields
}
type HashTableMetadata_LT_ ¶
type HashTable_LT_ ¶
type HashTable_LT_ struct { *HashTableMetadata_LT_ *HashTableCustomMetadata_LT_ // contains filtered or unexported fields }
func NewHashTable_LT_ ¶
func NewHashTable_LT_(initialSize uint64) *HashTable_LT_
Create a new hash table, able to hold initialSize count of keys.
func NewHashTable_LT_FileBacked ¶
func NewHashTable_LT_FileBacked(initialSize uint64, filepath string) (*HashTable_LT_, error)
func OpenHashTable_LT_FileBacked ¶
func OpenHashTable_LT_FileBacked(filepath string) (*HashTable_LT_, error)
func (*HashTable_LT_) Bytes ¶
func (t *HashTable_LT_) Bytes() []byte
func (*HashTable_LT_) Clear ¶
func (t *HashTable_LT_) Clear()
Clear does not resize the table, but zeroes-out all entries and the custom metadata
func (*HashTable_LT_) Compact ¶
func (t *HashTable_LT_) Compact()
Compact will compress the hashtable so that it is at most 75% full.
func (*HashTable_LT_) DeleteCell_LT_ ¶
func (t *HashTable_LT_) DeleteCell_LT_(cell *Cell_LT_)
DeleteCell_LT_ deletes the cell pointed to by cell.
func (*HashTable_LT_) DeleteKey ¶
func (t *HashTable_LT_) DeleteKey(key uint64)
DeleteKey will delete the contents of the cell associated with key.
func (*HashTable_LT_) DestroyHashTable ¶
func (t *HashTable_LT_) DestroyHashTable()
DestroyHashTable frees the memory-mapping, returning the memory containing the hash table and its cells to the OS. By default the save-to-file-on-disk functionality in malloc.go is not used, but that can be easily activated. See malloc.go. Deferencing any cells/pointers into the hash table after destruction will result in crashing your process, almost surely.
func (*HashTable_LT_) Lookup ¶
func (t *HashTable_LT_) Lookup(key uint64) *Cell_LT_
Lookup a cell based on a uint64 key value. Returns nil if key not found.
func (*HashTable_LT_) NewIterator ¶
func (h *HashTable_LT_) NewIterator() *_LT_Iterator
NewIterator creates a new iterator for HashTable tab.
func (*HashTable_LT_) Repopulate ¶
func (t *HashTable_LT_) Repopulate(desiredSize uint64)
Repopulate expands the hashtable to the desiredSize count of cells.
func (*HashTable_LT_) Save ¶
func (t *HashTable_LT_) Save()
Save syncs the memory mapped file to disk using MmapMalloc::BlockUntilSync()
func (*HashTable_LT_) UpdateChecksum ¶
func (t *HashTable_LT_) UpdateChecksum()