maglev

package module
v0.0.0-...-94c108c Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2018 License: MIT Imports: 2 Imported by: 0

README

maglev: Maglev consistent hashing

godoc: https://godoc.org/github.com/dgryski/go-maglev

Documentation

Overview

Package maglev implements maglev consistent hashing

http://research.google.com/pubs/pub44824.html

Index

Constants

View Source
const (
	SmallM = 65537
	BigM   = 655373
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*options)

func WithHashKey

func WithHashKey(key uint64) Option

func WithModulus

func WithModulus(mod uint64) Option

func WithPermutationRounds

func WithPermutationRounds(rounds int) Option

type Table

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

func New

func New(names []string, partitions uint, args ...Option) *Table

func (*Table) Add

func (t *Table) Add(names ...string)

func (*Table) Lookup

func (t *Table) Lookup(key uint64) string

func (*Table) PartitionOwner

func (t *Table) PartitionOwner(partition uint) string

func (*Table) Rebuild

func (t *Table) Rebuild(dead []string)

func (*Table) Remove

func (t *Table) Remove(names ...string)

Jump to

Keyboard shortcuts

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