partmap

package
v0.0.0-...-8510552 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package partmap provide a partitioned map.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map[P packed.Packable] struct {
	// contains filtered or unexported fields
}

Map represent the partitioned map.

func New

func New[P packed.Packable](startState P, numPart uint64) *Map[P]

New creates a new partitioned map instance.

func (*Map[P]) Len

func (pm *Map[P]) Len() int

Len returns the number of entries in the map.

func (*Map[P]) Load

func (pm *Map[P]) Load(k P) (P, bool)

Load reads a map value.

func (*Map[P]) NumPart

func (pm *Map[P]) NumPart() int

NumPart returns the number of partitions.

func (*Map[P]) Source

func (pm *Map[P]) Source(idx int) []P

Source returns the source list for partition idx.

func (*Map[P]) StoreTarget

func (pm *Map[P]) StoreTarget(k, v P) bool

StoreTarget writes a map value if not existent and adds the key to the target list.

func (*Map[P]) Swap

func (pm *Map[P]) Swap()

Swap swaps the source list with the target list.

Jump to

Keyboard shortcuts

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