extendiblehash

package
v0.22.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtendibleHashTable

type ExtendibleHashTable struct {
	// contains filtered or unexported fields
}

ExtendibleHashTable is an extendible hash table implementation backed by a buffer pool

func NewExtendibleHashTable

func NewExtendibleHashTable(keyLength int, valueLength int, bufferPool *bufferpool.BufferPool) (*ExtendibleHashTable, error)

NewExtendibleHashTable creates a new ExtendibleHashTable

func (*ExtendibleHashTable) Close

func (e *ExtendibleHashTable) Close()

Close cleans up the hash table after its use.

func (*ExtendibleHashTable) Get

func (e *ExtendibleHashTable) Get(key []byte) ([]byte, bool, error)

Get gets a key from the hash table. It returns the value, a bool set to true if the key is found (false if the key is not found) or an error.

func (*ExtendibleHashTable) Put

func (e *ExtendibleHashTable) Put(key, value []byte) error

Put puts a key/value pair into the hash table. It returns an error if one occurs.

type Hashable

type Hashable interface {
	Hash() uint64
}

type Key

type Key []byte

func (Key) Hash

func (k Key) Hash() uint64

BEWARE - not concurrent!!

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL