cockroach: github.com/cockroachdb/cockroach/pkg/storage/closedts/provider/testutils Index | Files

package testutils

import "github.com/cockroachdb/cockroach/pkg/storage/closedts/provider/testutils"

Index

Package Files

clock.go storage.go

type TestClock Uses

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

A TestClock provides a blocking LiveClockFn that can be triggered at will.

func NewTestClock Uses

func NewTestClock(stopper *stop.Stopper) *TestClock

NewTestClock sets up a test clock that returns errors once the Stopper starts quiescing.

func (*TestClock) LiveNow Uses

func (c *TestClock) LiveNow(roachpb.NodeID) (liveNow hlc.Timestamp, liveEpoch ctpb.Epoch, _ error)

LiveNow implements closedts.LiveClockFn.

func (*TestClock) Tick Uses

func (c *TestClock) Tick(liveNow hlc.Timestamp, liveEpoch ctpb.Epoch, err error)

Tick is called by tests to manually emit a single clock tick. The tick will only returned to a single caller of LiveNow().

type TestStorage Uses

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

TestStorage is a storage backed by a map[NodeID]Entry.

func (*TestStorage) Add Uses

func (s *TestStorage) Add(nodeID roachpb.NodeID, entry ctpb.Entry)

Add implements closedts.Storage.

func (*TestStorage) Clear Uses

func (s *TestStorage) Clear()

Clear implements closedts.Storage.

func (*TestStorage) Snapshot Uses

func (s *TestStorage) Snapshot() map[roachpb.NodeID][]ctpb.Entry

Snapshot returns a copy of the data contain within the TestStorage.

func (*TestStorage) VisitAscending Uses

func (s *TestStorage) VisitAscending(nodeID roachpb.NodeID, f func(ctpb.Entry) (done bool))

VisitAscending implements closedts.Storage.

func (*TestStorage) VisitDescending Uses

func (s *TestStorage) VisitDescending(nodeID roachpb.NodeID, f func(entry ctpb.Entry) (done bool))

VisitDescending implements closedts.Storage.

Package testutils imports 7 packages (graph). Updated 2019-08-17. Refresh now. Tools for package owners.