tidb: github.com/pingcap/tidb/util/mvmap Index | Files

package mvmap

import "github.com/pingcap/tidb/util/mvmap"

Index

Package Files

fnv.go mvmap.go

type Iterator Uses

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

Iterator is used to iterate the MVMap.

func (*Iterator) Next Uses

func (i *Iterator) Next() (key, value []byte)

Next returns the next key/value pair of the MVMap. It returns (nil, nil) when there is no more entries to iterate.

type MVMap Uses

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

MVMap stores multiple value for a given key with minimum GC overhead. A given key can store multiple values. It is not thread-safe, should only be used in one goroutine.

func NewMVMap Uses

func NewMVMap() *MVMap

NewMVMap creates a new multi-value map.

func (*MVMap) Get Uses

func (m *MVMap) Get(key []byte, values [][]byte) [][]byte

Get gets the values of the "key" and appends them to "values".

func (*MVMap) Len Uses

func (m *MVMap) Len() int

Len returns the number of values in th mv map, the number of keys may be less than Len if the same key is put more than once.

func (*MVMap) NewIterator Uses

func (m *MVMap) NewIterator() *Iterator

NewIterator creates a iterator for the MVMap.

func (*MVMap) Put Uses

func (m *MVMap) Put(key, value []byte)

Put puts the key/value pairs to the MVMap, if the key already exists, old value will not be overwritten, values are stored in a list.

Package mvmap imports 1 packages (graph) and is imported by 31 packages. Updated 2019-01-25. Refresh now. Tools for package owners.