util

package
v0.0.0-debug-20260702 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressFunc added in v1.0.0

func AddressFunc(
	service string,
	getClient func() HAKeeperClient,
) func(context.Context, bool) (string, error)

func CoreDump added in v1.2.0

func CoreDump()

func DisableCoreDump added in v1.2.0

func DisableCoreDump()

func DumpConfig added in v1.1.0

func DumpConfig(cfg any, defCfg any) (map[string]*logservicepb.ConfigItem, error)

func EnableCoreDump added in v1.2.0

func EnableCoreDump()

func FastUuid

func FastUuid() (types.Uuid, error)

FastUuid generates UUID v7 with high performance and no global lock.

Performance:

  • Single-threaded: ~60 ns/op (1.7x faster than google/uuid)
  • Concurrent: ~17 ns/op (10.9x faster than google/uuid)
  • Zero memory allocation

Guarantees:

  • Uniqueness: crypto/rand provides 74 bits of randomness
  • Time monotonicity: time increases → UUID increases
  • No global lock: fully concurrent

Trade-offs:

  • No strict monotonicity within the same millisecond
  • Random order for UUIDs generated in the same millisecond

This is suitable for MatrixOne's point query scenario where:

  • UUIDs are used for identification, not strict ordering
  • High concurrency performance is critical
  • Time-based ordering is sufficient

func Fastrand64

func Fastrand64() uint64

Fastrand64 returns a lock free uint64 value. Compared to rand.Int63(), this implementation scales.

func MergeConfig added in v1.1.0

func MergeConfig(dst *ConfigData, src map[string]*logservicepb.ConfigItem)

MergeConfig copy all items from src to dst and overwrite the existed item.

func SetUUIDNodeID

func SetUUIDNodeID(ctx context.Context, nodeUuid []byte) error

SetUUIDNodeID set all uuid generator's node_id

Types

type ConfigData added in v1.1.0

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

func NewConfigData added in v1.1.0

func NewConfigData(data map[string]*logservicepb.ConfigItem) *ConfigData

func (*ConfigData) DecrCount added in v1.1.0

func (cd *ConfigData) DecrCount()

func (*ConfigData) GetData added in v1.1.0

func (cd *ConfigData) GetData() *logservicepb.ConfigData

type HAKeeperClient added in v1.0.0

type HAKeeperClient interface {
	// GetClusterDetails queries the HAKeeper and return CN and TN nodes that are
	// known to the HAKeeper.
	GetClusterDetails(ctx context.Context) (pb.ClusterDetails, error)
	// GetClusterState queries the cluster state
	GetClusterState(ctx context.Context) (pb.CheckerState, error)
}

HAKeeperClient is an interface which is mainly used to avoid cycle import.

type RunResult added in v1.0.0

type RunResult struct {
	AffectRows uint64
}

Directories

Path Synopsis
A common util to export data (trace and metric for now) as batch
A common util to export data (trace and metric for now) as batch
debug
test
Package mock_executor is a generated GoMock package.
Package mock_executor is a generated GoMock package.
etl
example command
Bin to show how Merge Task work.
Bin to show how Merge Task work.
A very simple fault injection tool.
A very simple fault injection tool.
Package gpumode declares a process-wide GpuMode flag and a session- sysvar–aware EffectiveGpuMode resolver, used by vector-index dispatch sites (brute force, kmeans, adhoc brute force, pairwise distance) to decide between GPU (cuvs) and CPU implementations at runtime.
Package gpumode declares a process-wide GpuMode flag and a session- sysvar–aware EffectiveGpuMode resolver, used by vector-index dispatch sites (brute force, kmeans, adhoc brute force, pairwise distance) to decide between GPU (cuvs) and CPU implementations at runtime.
v2
v2/dashboard
Package dashboard provides Grafana dashboard creation utilities for MatrixOne metrics.
Package dashboard provides Grafana dashboard creation utilities for MatrixOne metrics.

Jump to

Keyboard shortcuts

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