maglevhash

package
v0.0.0-...-1fb8944 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package maglevhash implements the hash function from Maglev, Google's fast load balancer.

https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/44824.pdf

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MaglevHasher

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

func New

func New(members []string, replicas int) (*MaglevHasher, error)

New creates a new MaglevHasher consisting of members.

func (*MaglevHasher) Dispatch

func (m *MaglevHasher) Dispatch(i uint64) []string

Dispatch gets the members corresponding to i. Dispatch evenly distributes all possible unsigned integers i across members.

func (*MaglevHasher) Len

func (m *MaglevHasher) Len() int

Jump to

Keyboard shortcuts

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