Documentation
¶
Overview ¶
Package kvtest supplies coordinators for tests outside package kv.
Index ¶
- type LocalCoordinator
- type LocalOptions
- type NopCoordinator
- func (c *NopCoordinator) Clock() *kv.HLC
- func (*NopCoordinator) Dispatch(context.Context, *kv.OperationGroup[kv.OP]) (*kv.CoordinateResponse, error)
- func (*NopCoordinator) IsLeader() bool
- func (*NopCoordinator) IsLeaderForKey([]byte) bool
- func (*NopCoordinator) LinearizableRead(context.Context) (uint64, error)
- func (*NopCoordinator) RaftLeader() string
- func (*NopCoordinator) RaftLeaderForKey([]byte) string
- func (*NopCoordinator) VerifyLeader(context.Context) error
- func (*NopCoordinator) VerifyLeaderForKey(context.Context, []byte) error
- type OCCMode
- type PrefixMode
- type TimestampSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalCoordinator ¶
type LocalCoordinator struct {
NopCoordinator
// contains filtered or unexported fields
}
func NewLocalCoordinator ¶
func NewLocalCoordinator(st store.MVCCStore, options LocalOptions) *LocalCoordinator
func (*LocalCoordinator) Dispatch ¶
func (c *LocalCoordinator) Dispatch(ctx context.Context, req *kv.OperationGroup[kv.OP]) (*kv.CoordinateResponse, error)
func (*LocalCoordinator) LinearizableRead ¶
func (c *LocalCoordinator) LinearizableRead(ctx context.Context) (uint64, error)
type LocalOptions ¶
type LocalOptions struct {
DelPrefix PrefixMode
CommitTimestamp TimestampSource
OCC OCCMode
ValidateReadKeys bool
PatchCommitTS bool
// AdvanceCommitTS raises caller-supplied timestamps to at least store+1
// and, for transactions, StartTS+1 (the filesystem fake's policy).
AdvanceCommitTS bool
// Clock, when set, is the HLC the coordinator issues and observes
// timestamps on, so a wrapper can share it with its own Clock().
Clock *kv.HLC
}
LocalOptions explicitly selects behaviours that historically differed among local fakes. Zero values reject prefix deletes, use the HLC, skip OCC and do not patch values. OCC-disabled writes are applied sequentially, like the old adapter fake; OCC-enabled groups go through the store's atomic validation.
type NopCoordinator ¶
type NopCoordinator struct {
// contains filtered or unexported fields
}
NopCoordinator implements only Coordinator; it always reports local leadership. The zero value is ready for use, including concurrent Clock calls.
func (*NopCoordinator) Clock ¶
func (c *NopCoordinator) Clock() *kv.HLC
func (*NopCoordinator) Dispatch ¶
func (*NopCoordinator) Dispatch(context.Context, *kv.OperationGroup[kv.OP]) (*kv.CoordinateResponse, error)
func (*NopCoordinator) IsLeader ¶
func (*NopCoordinator) IsLeader() bool
func (*NopCoordinator) IsLeaderForKey ¶
func (*NopCoordinator) IsLeaderForKey([]byte) bool
func (*NopCoordinator) LinearizableRead ¶
func (*NopCoordinator) LinearizableRead(context.Context) (uint64, error)
func (*NopCoordinator) RaftLeader ¶
func (*NopCoordinator) RaftLeader() string
func (*NopCoordinator) RaftLeaderForKey ¶
func (*NopCoordinator) RaftLeaderForKey([]byte) string
func (*NopCoordinator) VerifyLeader ¶
func (*NopCoordinator) VerifyLeader(context.Context) error
func (*NopCoordinator) VerifyLeaderForKey ¶
func (*NopCoordinator) VerifyLeaderForKey(context.Context, []byte) error
type PrefixMode ¶
type PrefixMode uint8
const ( PrefixReject PrefixMode = iota // PrefixApply permits standalone, non-transactional prefix deletes. PrefixApply PrefixIgnore )
type TimestampSource ¶
type TimestampSource uint8
const ( TimestampHLC TimestampSource = iota TimestampStoreIncrement TimestampRequest )
Click to show internal directories.
Click to hide internal directories.