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

package provider

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

Index

Package Files

provider.go

type Config Uses

type Config struct {
    // NodeID is the ID of the node on which the Provider is housed.
    NodeID   roachpb.NodeID
    Settings *cluster.Settings
    Stopper  *stop.Stopper
    Storage  closedts.Storage
    Clock    closedts.LiveClockFn
    Close    closedts.CloseFn
}

Config holds the information necessary to create a Provider.

type Provider Uses

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

Provider implements closedts.Provider. It orchestrates the flow of closed timestamps and lets callers check whether they can serve reads.

func NewProvider Uses

func NewProvider(cfg *Config) *Provider

NewProvider initializes a Provider, that has yet to be started.

func (*Provider) MaxClosed Uses

func (p *Provider) MaxClosed(
    nodeID roachpb.NodeID, rangeID roachpb.RangeID, epoch ctpb.Epoch, lai ctpb.LAI,
) hlc.Timestamp

MaxClosed implements closedts.Provider.

func (*Provider) Notify Uses

func (p *Provider) Notify(nodeID roachpb.NodeID) chan<- ctpb.Entry

Notify implements closedts.Notifyee. It passes the incoming stream of Entries to the local Storage.

func (*Provider) Start Uses

func (p *Provider) Start()

Start implements closedts.Provider.

TODO(tschottdorf): the closer functionality could be extracted into its own component, which would make the interfaces a little cleaner. Decide whether it's worth it during testing.

func (*Provider) Subscribe Uses

func (p *Provider) Subscribe(ctx context.Context, ch chan<- ctpb.Entry)

Subscribe implements closedts.Producer. It produces a stream of Entries pertaining to the local Node.

TODO(tschottdorf): consider not forcing the caller to launch the goroutine.

Directories

PathSynopsis
testutils

Package provider imports 14 packages (graph) and is imported by 1 packages. Updated 2019-07-28. Refresh now. Tools for package owners.