cockroach: Index | Files

package container

import ""


Package Files

container.go noop.go


const (

    // StorageBucketScale determines the (exponential) spacing of storage buckets.
    // For example, a scale of 5s means that the second bucket will attempt to hold
    // a closed timestamp 5s in the past from the first, and the third 5*5=25s from
    // the first, etc.
    // TODO(tschottdorf): it's straightforward to make this dynamic. It should track
    // the interval at which timestamps are closed out, ideally being a little shorter.
    // The effect of that would be that the most recent closed timestamp and the previous
    // one can be queried against separately.
    StorageBucketScale = 10 * time.Second

type Config Uses

type Config struct {
    Settings *cluster.Settings
    Stopper  *stop.Stopper
    Clock    closedts.LiveClockFn
    Refresh  closedts.RefreshFn
    Dialer   closedts.Dialer

Config is a container that holds references to all of the components required to set up a full closed timestamp subsystem.

type Container Uses

type Container struct {
    // Initialized on Start().
    Tracker  closedts.TrackerI
    Storage  closedts.Storage
    Provider closedts.Provider
    Server   ctpb.Server
    Clients  closedts.ClientRegistry
    // contains filtered or unexported fields

A Container is a full closed timestamp subsystem along with the Config it was created from.

func NewContainer Uses

func NewContainer(cfg Config) *Container

NewContainer initializes a Container from the given Config. The Container will need to be started separately, and will only be populated during Start().

However, its RegisterClosedTimestampServer method can only be called before the Container is started.

func NoopContainer Uses

func NoopContainer() *Container

NoopContainer returns a Container for which all parts of the subsystem are mocked out. This is for usage in testing where there just needs to be a structure that stays out of the way.

The returned container will behave correctly. It will never allow any time- stamps to be closed out, so it never makes any promises; it doesn't use any locking and it does not consume any (nontrivial) resources.

func (*Container) RegisterClosedTimestampServer Uses

func (c *Container) RegisterClosedTimestampServer(s *grpc.Server)

RegisterClosedTimestampServer registers the Server contained in the container with gRPC.

func (*Container) Start Uses

func (c *Container) Start(nodeID roachpb.NodeID)

Start starts the Container. The Stopper used to create the Container is in charge of stopping it.

Package container imports 15 packages (graph) and is imported by 5 packages. Updated 2020-08-12. Refresh now. Tools for package owners.