hashring

package
v0.0.0-...-15b7eb6 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: MIT Imports: 3 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

An implementation of consistent hashing or hash-rings, specifically, static, non-migrating hash-rings. These rings are static and non-migrating by not being designed to change at runtime (no insertion or removal of nodes). This departs this implementation from other hash-ring systems, that are designed to dynamically distribute data onto a cluster while nodes are constantly being added and removed.

This implementation is designed with empathis on systems, in which "nodes" have limited disk-space while storing a dataset that possibly exceeds their disk-capacity, rendering certain "nodes" incapable to store further records.

In order not to loose those records, techniques such as those similar to Cuckoo-Hashing are applied.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IHashRing

type IHashRing interface {
	AddNode(u uint64, node interface{})
	MutateStore(key []byte, m Mutator) bool
}

type MultiJumpSeedRing64

type MultiJumpSeedRing64 struct {
	SeedRing64
	N int
}

func (*MultiJumpSeedRing64) MutateStore

func (s *MultiJumpSeedRing64) MutateStore(key []byte, m Mutator) bool

type MultiStepSeedRing64

type MultiStepSeedRing64 struct {
	SeedRing64
	N int
}

func (*MultiStepSeedRing64) MutateStore

func (s *MultiStepSeedRing64) MutateStore(key []byte, m Mutator) bool

type Mutator

type Mutator interface {
	Mutate(hash uint64, obj interface{}) bool
}

type Ring64

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

func (*Ring64) AddNode

func (s *Ring64) AddNode(u uint64, node interface{})

func (*Ring64) Init

func (s *Ring64) Init()

func (*Ring64) MutateStore

func (s *Ring64) MutateStore(key []byte, m Mutator) bool

type SeedRing64

type SeedRing64 struct {
	Ring64
	Seed uint64
}

func (*SeedRing64) MutateStore

func (s *SeedRing64) MutateStore(key []byte, m Mutator) bool

Directories

Path Synopsis
A group of hash functions based on siphash.
A group of hash functions based on siphash.

Jump to

Keyboard shortcuts

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