...

Package testutil

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

Overview ▾

Constants

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

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)

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
}