idalloc

package
v0.10.3-0...-930112e Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMAllocator

func NewMAllocator(allocator Allocator) allocator.Interface

Types

type Allocator

type Allocator interface {
	// Allocate allocates a timestamp.
	Allocate(ctx context.Context) (uint64, error)

	// Sync expire the local allocator messages,
	// syncs the local allocator and remote allocator.
	Sync()

	// SyncIfExpired syncs the local allocator and remote allocator if the duration since last sync operation is greater than expire.
	SyncIfExpired(expire time.Duration)
}

func NewIDAllocator

func NewIDAllocator(rc types.RootCoordClient) Allocator

NewIDAllocator creates a new allocator.

func NewTSOAllocator

func NewTSOAllocator(rc types.RootCoordClient) Allocator

NewTSOAllocator creates a new allocator.

Jump to

Keyboard shortcuts

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