index

package
v0.0.0-...-58691e3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DATAFILE          = "./alldata"
	MIN_KEY_SIZE      = 1
	MAX_KEY_SIZE      = 1024
	MIN_VALUE_SIZE    = 1
	MAX_VALUE_SIZE    = 1024 // 2^20
	MAX_ROUTINE_LIMIT = 2000
	CACHE_SIZE        = 100
	CHUNK_NUM         = 1000
	NUM_KV            = 1e3
)

Variables

This section is empty.

Functions

func GetSizeAndContent

func GetSizeAndContent(f *os.File) (size uint64, content []byte, err error)

func Hash

func Hash(key []byte) uint32

Types

type Index

type Index struct {
	LRUCache  *cache.Cache
	SplayRoot *splay.Tree
	// contains filtered or unexported fields
}

func New

func New(useLru bool, useSplay bool) Index

func (*Index) Index

func (i *Index) Index(key string, idx int32, wg *sync.WaitGroup) (err error)

func (*Index) Query

func (i *Index) Query(keys []string, startIdx int32)

Jump to

Keyboard shortcuts

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