roachpb

package
v0.0.0-...-1b6ad0c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2020 License: Apache-2.0 Imports: 5 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxTenantID = MakeTenantID(math.MaxUint64)

MaxTenantID is the maximum ID of a (non-system) tenant in a multi-tenant cluster.

View Source
var MinTenantID = MakeTenantID(2)

MinTenantID is the minimum ID of a (non-system) tenant in a multi-tenant cluster.

View Source
var SystemTenantID = MakeTenantID(1)

SystemTenantID is the ID associated with the system's internal tenant in a multi-tenant cluster and the only tenant in a single-tenant cluster.

The system tenant differs from all other tenants in four important ways: 1. the system tenant's keyspace is not prefixed with a tenant specifier. 2. the system tenant is created by default during cluster initialization. 3. the system tenant is always present and can never be destroyed. 4. the system tenant has the ability to create and destroy other tenants.

Functions

func IsSystemTenantID

func IsSystemTenantID(id uint64) bool

IsSystemTenantID returns whether the provided ID corresponds to that of the system tenant.

Types

type TenantID

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

A TenantID is a unique ID associated with a tenant in a multi-tenant cluster. Each tenant is granted exclusive access to a portion of the keyspace and a collection of SQL tables in that keyspace which comprise a "logical" cluster.

The type is intentionally opaque to require deliberate use.

func MakeTenantID

func MakeTenantID(id uint64) TenantID

MakeTenantID constructs a new TenantID from the provided uint64.

func (TenantID) String

func (t TenantID) String() string

String implements the fmt.Stringer interface.

func (TenantID) ToUint64

func (t TenantID) ToUint64() uint64

ToUint64 returns the TenantID as a uint64.

type Version

type Version struct {
	Major int32 `protobuf:"varint,1,opt,name=major_val,json=majorVal" json:"major_val"`
	Minor int32 `protobuf:"varint,2,opt,name=minor_val,json=minorVal" json:"minor_val"`
	// Note that patch is a placeholder and will always be zero.
	Patch int32 `protobuf:"varint,3,opt,name=patch" json:"patch"`
	// The unstable version is used to migrate during development.
	// Users of stable, public releases will only use binaries
	// with unstable set to 0.
	Unstable int32 `protobuf:"varint,4,opt,name=unstable" json:"unstable"`
}

func MustParseVersion

func MustParseVersion(s string) Version

MustParseVersion calls ParseVersion and panics on error.

func ParseVersion

func ParseVersion(s string) (Version, error)

ParseVersion parses a Version from a string of the form "<major>.<minor>-<unstable>" where the "-<unstable>" is optional. We don't use the Patch component, so it is always zero.

func (Version) Less

func (v Version) Less(otherV Version) bool

Less compares two Versions.

func (Version) String

func (v Version) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL