package testutil

import "go.etcd.io/etcd/server/v3/storage/mvcc/testutil"

Index

Constants

const (
	// CompactionCycle is high prime used to test hash calculation between compactions.
	CompactionCycle = 71
)

Functions

func CorruptBBolt

func CorruptBBolt(fpath string) error

func PickKey

func PickKey(i int64) string

func TestCompactionHash

func TestCompactionHash(ctx context.Context, t *testing.T, h CompactionHashTestCase, compactionBatchLimit int)

Types

type CompactionHashTestCase

type CompactionHashTestCase interface {
	Put(ctx context.Context, key, value string) error
	Delete(ctx context.Context, key string) error
	HashByRev(ctx context.Context, rev int64) (KeyValueHash, error)
	Defrag(ctx context.Context) error
	Compact(ctx context.Context, rev int64) error
}

type KeyValueHash

type KeyValueHash struct {
	Hash            uint32
	CompactRevision int64
	Revision        int64
}

Source Files

hash.go

Version
v3.5.18 (latest)
Published
Jan 24, 2025
Platform
linux/amd64
Imports
8 packages
Last checked
5 days ago

Tools for package owners.