phtable

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2015 License: BSD-3-Clause, MIT, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CHD

type CHD struct {
	StoreKeys        bool
	ValuesAreVarints bool
	// contains filtered or unexported fields
}

CHD hash table lookup.

func Mmap

func Mmap(b []byte, isVarints bool) (*CHD, error)

Mmap creates a new CHD aliasing the CHD structure over an existing byte region (typically mmapped).

func Read

func Read(r io.Reader) (*CHD, error)

Read a serialized CHD.

func ReadVarints

func ReadVarints(r io.Reader) (*CHD, error)

func (*CHD) Get

func (c *CHD) Get(key []byte) []byte

Get an entry from the hash table.

func (*CHD) GetUint64

func (c *CHD) GetUint64(key []byte) (uint64, bool)

func (*CHD) Iterate

func (c *CHD) Iterate() *Iterator

Iterate over entries in the hash table.

func (*CHD) Len

func (c *CHD) Len() int

func (*CHD) Write

func (c *CHD) Write(w io.Writer) error

Serialize the CHD. The serialized form is conducive to mmapped access. See the Mmap function for details.

type CHDBuilder

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

Build a new CDH MPH.

func Builder

func Builder(size int) *CHDBuilder

Create a new CHD hash table builder.

func Uvarint64Builder

func Uvarint64Builder(size int) *CHDBuilder

func (*CHDBuilder) Add

func (b *CHDBuilder) Add(key []byte, value []byte)

Add a key and value to the hash table.

func (*CHDBuilder) AddUvarint64

func (b *CHDBuilder) AddUvarint64(key []byte, value uint64)

AddUvarint64 a key and value to the hash table.

func (*CHDBuilder) Build

func (b *CHDBuilder) Build() (*CHD, error)

type Iterator

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

func (*Iterator) Get

func (c *Iterator) Get() (key []byte, value []byte)

func (*Iterator) Next

func (c *Iterator) Next() *Iterator

Jump to

Keyboard shortcuts

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