cockroach: github.com/cockroachdb/cockroach/pkg/config/zonepb Index | Files

package zonepb

import "github.com/cockroachdb/cockroach/pkg/config/zonepb"

Index

Package Files

zone.go zone.pb.go zone_yaml.go

Constants

const (
    DefaultZoneName    = "default"
    LivenessZoneName   = "liveness"
    MetaZoneName       = "meta"
    SystemZoneName     = "system"
    TimeseriesZoneName = "timeseries"
    TenantsZoneName    = "tenants"
)

Several ranges outside of the SQL keyspace are given special names so they can be targeted by zone configs.

Variables

var (
    ErrInvalidLengthZone = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowZone   = fmt.Errorf("proto: integer overflow")
)
var Constraint_Type_name = map[int32]string{
    0:  "DEPRECATED_POSITIVE",
    1:  "REQUIRED",
    2:  "PROHIBITED",
}
var Constraint_Type_value = map[string]int32{
    "DEPRECATED_POSITIVE": 0,
    "REQUIRED":            1,
    "PROHIBITED":          2,
}
var NamedZones = map[string]uint32{
    DefaultZoneName:    keys.RootNamespaceID,
    LivenessZoneName:   keys.LivenessRangesID,
    MetaZoneName:       keys.MetaRangesID,
    SystemZoneName:     keys.SystemRangesID,
    TimeseriesZoneName: keys.TimeseriesRangesID,
    TenantsZoneName:    keys.TenantsRangesID,
}

NamedZones maps named zones to their pseudo-table ID that can be used to install an entry into the system.zones table.

var NamedZonesByID = func() map[uint32]string {
    out := map[uint32]string{}
    for name, id := range NamedZones {
        out[id] = name
    }
    return out
}()

NamedZonesByID is the inverse of NamedZones: it maps pseudo-table IDs to their zone names.

func ResolveZoneSpecifier Uses

func ResolveZoneSpecifier(
    zs *tree.ZoneSpecifier, resolveName func(parentID uint32, name string) (id uint32, err error),
) (uint32, error)

ResolveZoneSpecifier converts a zone specifier to the ID of most specific zone whose config applies.

func StoreMatchesConstraint Uses

func StoreMatchesConstraint(store roachpb.StoreDescriptor, c Constraint) bool

StoreMatchesConstraint returns whether a store's attributes or node's locality match the constraint's spec. It notably ignores whether the constraint is required, prohibited, positive, or otherwise. Also see StoreSatisfiesConstraint().

func StoreSatisfiesConstraint Uses

func StoreSatisfiesConstraint(store roachpb.StoreDescriptor, constraint Constraint) bool

StoreSatisfiesConstraint checks whether a store satisfies the given constraint. If the constraint is of the PROHIBITED type, satisfying it means the store not matching the constraint's spec.

func ZoneSpecifierFromID Uses

func ZoneSpecifierFromID(
    id uint32, resolveID func(id uint32) (parentID uint32, name string, err error),
) (tree.ZoneSpecifier, error)

ZoneSpecifierFromID creates a tree.ZoneSpecifier for the zone with the given ID.

type Constraint Uses

type Constraint struct {
    Type Constraint_Type `protobuf:"varint,1,opt,name=type,enum=cockroach.config.zonepb.Constraint_Type" json:"type"`
    // Key is only set if this is a constraint on locality.
    Key string `protobuf:"bytes,2,opt,name=key" json:"key"`
    // Value to constrain to.
    Value string `protobuf:"bytes,3,opt,name=value" json:"value"`
}

Constraint constrains the stores that a replica can be stored on.

func NewPopulatedConstraint Uses

func NewPopulatedConstraint(r randyZone, easy bool) *Constraint

func (*Constraint) Descriptor Uses

func (*Constraint) Descriptor() ([]byte, []int)

func (*Constraint) Equal Uses

func (this *Constraint) Equal(that interface{}) bool

func (*Constraint) FromString Uses

func (c *Constraint) FromString(short string) error

FromString populates the constraint from the constraint shorthand notation.

func (*Constraint) GetKey Uses

func (c *Constraint) GetKey() string

GetKey is part of the cat.Constraint interface.

func (*Constraint) GetValue Uses

func (c *Constraint) GetValue() string

GetValue is part of the cat.Constraint interface.

func (*Constraint) IsRequired Uses

func (c *Constraint) IsRequired() bool

IsRequired is part of the cat.Constraint interface.

func (*Constraint) Marshal Uses

func (m *Constraint) Marshal() (dAtA []byte, err error)

func (*Constraint) MarshalTo Uses

func (m *Constraint) MarshalTo(dAtA []byte) (int, error)

func (*Constraint) ProtoMessage Uses

func (*Constraint) ProtoMessage()

func (*Constraint) Reset Uses

func (m *Constraint) Reset()

func (*Constraint) Size Uses

func (m *Constraint) Size() (n int)

func (Constraint) String Uses

func (c Constraint) String() string

func (*Constraint) Unmarshal Uses

func (m *Constraint) Unmarshal(dAtA []byte) error

func (*Constraint) XXX_DiscardUnknown Uses

func (m *Constraint) XXX_DiscardUnknown()

func (*Constraint) XXX_Marshal Uses

func (m *Constraint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Constraint) XXX_Merge Uses

func (dst *Constraint) XXX_Merge(src proto.Message)

func (*Constraint) XXX_Size Uses

func (m *Constraint) XXX_Size() int

func (*Constraint) XXX_Unmarshal Uses

func (m *Constraint) XXX_Unmarshal(b []byte) error

type Constraint_Type Uses

type Constraint_Type int32
const (
    // DEPRECATED_POSITIVE has no effect on a replica's placement.
    Constraint_DEPRECATED_POSITIVE Constraint_Type = 0
    // REQUIRED ensures all replicas are placed on stores that match the
    // constraint. Replication will fail if there aren't any such stores.
    Constraint_REQUIRED Constraint_Type = 1
    // PROHIBITED will prevent replicas from having this key, value.
    Constraint_PROHIBITED Constraint_Type = 2
)

func (Constraint_Type) Enum Uses

func (x Constraint_Type) Enum() *Constraint_Type

func (Constraint_Type) EnumDescriptor Uses

func (Constraint_Type) EnumDescriptor() ([]byte, []int)

func (Constraint_Type) String Uses

func (x Constraint_Type) String() string

func (*Constraint_Type) UnmarshalJSON Uses

func (x *Constraint_Type) UnmarshalJSON(data []byte) error

type ConstraintsConjunction Uses

type ConstraintsConjunction struct {
    // The number of replicas that should abide by the constraints below. If left
    // unspecified (i.e. set to 0), the constraints will apply to all replicas of
    // the range.
    // As of v2.0, only REQUIRED constraints are allowed when num_replicas is
    // set to a non-zero value.
    NumReplicas int32 `protobuf:"varint,7,opt,name=num_replicas,json=numReplicas" json:"num_replicas"`
    // The set of attributes and/or localities that need to be satisfied by the
    // store.
    Constraints []Constraint `protobuf:"bytes,6,rep,name=constraints" json:"constraints"`
}

ConstraintsConjunction is a set of constraints that need to be satisfied together by a replica (i.e. by the replica's store).

func NewPopulatedConstraintsConjunction Uses

func NewPopulatedConstraintsConjunction(r randyZone, easy bool) *ConstraintsConjunction

func (*ConstraintsConjunction) Constraint Uses

func (c *ConstraintsConjunction) Constraint(i int) cat.Constraint

Constraint is part of the cat.ReplicaConstraints interface.

func (*ConstraintsConjunction) ConstraintCount Uses

func (c *ConstraintsConjunction) ConstraintCount() int

ConstraintCount is part of the cat.ReplicaConstraints interface.

func (*ConstraintsConjunction) Descriptor Uses

func (*ConstraintsConjunction) Descriptor() ([]byte, []int)

func (*ConstraintsConjunction) Equal Uses

func (this *ConstraintsConjunction) Equal(that interface{}) bool

func (*ConstraintsConjunction) Marshal Uses

func (m *ConstraintsConjunction) Marshal() (dAtA []byte, err error)

func (*ConstraintsConjunction) MarshalTo Uses

func (m *ConstraintsConjunction) MarshalTo(dAtA []byte) (int, error)

func (ConstraintsConjunction) MarshalYAML Uses

func (c ConstraintsConjunction) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler.

func (*ConstraintsConjunction) ProtoMessage Uses

func (*ConstraintsConjunction) ProtoMessage()

func (*ConstraintsConjunction) ReplicaCount Uses

func (c *ConstraintsConjunction) ReplicaCount() int32

ReplicaCount is part of the cat.ReplicaConstraints interface.

func (*ConstraintsConjunction) Reset Uses

func (m *ConstraintsConjunction) Reset()

func (*ConstraintsConjunction) Size Uses

func (m *ConstraintsConjunction) Size() (n int)

func (ConstraintsConjunction) String Uses

func (c ConstraintsConjunction) String() string

func (*ConstraintsConjunction) Unmarshal Uses

func (m *ConstraintsConjunction) Unmarshal(dAtA []byte) error

func (*ConstraintsConjunction) UnmarshalYAML Uses

func (c *ConstraintsConjunction) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Marshaler.

func (*ConstraintsConjunction) XXX_DiscardUnknown Uses

func (m *ConstraintsConjunction) XXX_DiscardUnknown()

func (*ConstraintsConjunction) XXX_Marshal Uses

func (m *ConstraintsConjunction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConstraintsConjunction) XXX_Merge Uses

func (dst *ConstraintsConjunction) XXX_Merge(src proto.Message)

func (*ConstraintsConjunction) XXX_Size Uses

func (m *ConstraintsConjunction) XXX_Size() int

func (*ConstraintsConjunction) XXX_Unmarshal Uses

func (m *ConstraintsConjunction) XXX_Unmarshal(b []byte) error

type ConstraintsList Uses

type ConstraintsList struct {
    Constraints []ConstraintsConjunction
    Inherited   bool
}

ConstraintsList is an alias for a slice of Constraints that can be properly marshaled to/from YAML.

func (ConstraintsList) MarshalYAML Uses

func (c ConstraintsList) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler.

We use two different formats here, dependent on whether per-replica constraints are being used in ConstraintsList: 1. A legacy format when there are 0 or 1 Constraints and NumReplicas is

zero:
[c1, c2, c3]

2. A per-replica format when NumReplicas is non-zero:

{"c1,c2,c3": numReplicas1, "c4,c5": numReplicas2}

func (*ConstraintsList) UnmarshalYAML Uses

func (c *ConstraintsList) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler.

type GCPolicy Uses

type GCPolicy struct {
    // TTLSeconds specifies the maximum age of a value before it's
    // garbage collected. Only older versions of values are garbage
    // collected. Specifying <= 0 mean older versions are never GC'd.
    TTLSeconds int32 `protobuf:"varint,1,opt,name=ttl_seconds,json=ttlSeconds" json:"ttl_seconds"`
}

GCPolicy defines garbage collection policies which apply to MVCC values within a zone.

TODO(spencer): flesh this out to include maximum number of values

as well as whether there's an intersection between max values
and TTL or a union.

func NewPopulatedGCPolicy Uses

func NewPopulatedGCPolicy(r randyZone, easy bool) *GCPolicy

func (*GCPolicy) Descriptor Uses

func (*GCPolicy) Descriptor() ([]byte, []int)

func (*GCPolicy) Equal Uses

func (this *GCPolicy) Equal(that interface{}) bool

func (*GCPolicy) Marshal Uses

func (m *GCPolicy) Marshal() (dAtA []byte, err error)

func (*GCPolicy) MarshalTo Uses

func (m *GCPolicy) MarshalTo(dAtA []byte) (int, error)

func (*GCPolicy) ProtoMessage Uses

func (*GCPolicy) ProtoMessage()

func (*GCPolicy) Reset Uses

func (m *GCPolicy) Reset()

func (*GCPolicy) Size Uses

func (m *GCPolicy) Size() (n int)

func (*GCPolicy) String Uses

func (m *GCPolicy) String() string

func (*GCPolicy) TTL Uses

func (m *GCPolicy) TTL() time.Duration

TTL returns the implies TTL as a time.Duration.

func (*GCPolicy) Unmarshal Uses

func (m *GCPolicy) Unmarshal(dAtA []byte) error

func (*GCPolicy) XXX_DiscardUnknown Uses

func (m *GCPolicy) XXX_DiscardUnknown()

func (*GCPolicy) XXX_Marshal Uses

func (m *GCPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GCPolicy) XXX_Merge Uses

func (dst *GCPolicy) XXX_Merge(src proto.Message)

func (*GCPolicy) XXX_Size Uses

func (m *GCPolicy) XXX_Size() int

func (*GCPolicy) XXX_Unmarshal Uses

func (m *GCPolicy) XXX_Unmarshal(b []byte) error

type LeasePreference Uses

type LeasePreference struct {
    Constraints []Constraint `protobuf:"bytes,1,rep,name=constraints" json:"constraints" yaml:"constraints,flow"`
}

LeasePreference specifies a preference about where range leases should be located.

func NewPopulatedLeasePreference Uses

func NewPopulatedLeasePreference(r randyZone, easy bool) *LeasePreference

func (*LeasePreference) Constraint Uses

func (l *LeasePreference) Constraint(i int) cat.Constraint

Constraint is part of the cat.LeasePreference interface.

func (*LeasePreference) ConstraintCount Uses

func (l *LeasePreference) ConstraintCount() int

ConstraintCount is part of the cat.LeasePreference interface.

func (*LeasePreference) Descriptor Uses

func (*LeasePreference) Descriptor() ([]byte, []int)

func (*LeasePreference) Equal Uses

func (this *LeasePreference) Equal(that interface{}) bool

func (*LeasePreference) Marshal Uses

func (m *LeasePreference) Marshal() (dAtA []byte, err error)

func (*LeasePreference) MarshalTo Uses

func (m *LeasePreference) MarshalTo(dAtA []byte) (int, error)

func (LeasePreference) MarshalYAML Uses

func (l LeasePreference) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler.

func (*LeasePreference) ProtoMessage Uses

func (*LeasePreference) ProtoMessage()

func (*LeasePreference) Reset Uses

func (m *LeasePreference) Reset()

func (*LeasePreference) Size Uses

func (m *LeasePreference) Size() (n int)

func (*LeasePreference) String Uses

func (m *LeasePreference) String() string

func (*LeasePreference) Unmarshal Uses

func (m *LeasePreference) Unmarshal(dAtA []byte) error

func (*LeasePreference) UnmarshalYAML Uses

func (l *LeasePreference) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*LeasePreference) XXX_DiscardUnknown Uses

func (m *LeasePreference) XXX_DiscardUnknown()

func (*LeasePreference) XXX_Marshal Uses

func (m *LeasePreference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LeasePreference) XXX_Merge Uses

func (dst *LeasePreference) XXX_Merge(src proto.Message)

func (*LeasePreference) XXX_Size Uses

func (m *LeasePreference) XXX_Size() int

func (*LeasePreference) XXX_Unmarshal Uses

func (m *LeasePreference) XXX_Unmarshal(b []byte) error

type Subzone Uses

type Subzone struct {
    // IndexID is the ID of the SQL table index that the subzone represents.
    // Always set.
    IndexID uint32 `protobuf:"varint,1,opt,name=index_id,json=indexId" json:"index_id"`
    // PartitionName is the partition of the SQL table index that the subzone
    // represents. It is empty when the subzone represents the entire index.
    PartitionName string `protobuf:"bytes,2,opt,name=partition_name,json=partitionName" json:"partition_name"`
    // Config stores the ZoneConfig that applies to this Subzone. It never
    // contains nested subzones.
    Config ZoneConfig `protobuf:"bytes,3,opt,name=config" json:"config"`
}

func NewPopulatedSubzone Uses

func NewPopulatedSubzone(r randyZone, easy bool) *Subzone

func (*Subzone) Descriptor Uses

func (*Subzone) Descriptor() ([]byte, []int)

func (*Subzone) Equal Uses

func (this *Subzone) Equal(that interface{}) bool

func (*Subzone) Marshal Uses

func (m *Subzone) Marshal() (dAtA []byte, err error)

func (*Subzone) MarshalTo Uses

func (m *Subzone) MarshalTo(dAtA []byte) (int, error)

func (*Subzone) ProtoMessage Uses

func (*Subzone) ProtoMessage()

func (*Subzone) Reset Uses

func (m *Subzone) Reset()

func (*Subzone) Size Uses

func (m *Subzone) Size() (n int)

func (*Subzone) String Uses

func (m *Subzone) String() string

func (*Subzone) Unmarshal Uses

func (m *Subzone) Unmarshal(dAtA []byte) error

func (*Subzone) XXX_DiscardUnknown Uses

func (m *Subzone) XXX_DiscardUnknown()

func (*Subzone) XXX_Marshal Uses

func (m *Subzone) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Subzone) XXX_Merge Uses

func (dst *Subzone) XXX_Merge(src proto.Message)

func (*Subzone) XXX_Size Uses

func (m *Subzone) XXX_Size() int

func (*Subzone) XXX_Unmarshal Uses

func (m *Subzone) XXX_Unmarshal(b []byte) error

type SubzoneSpan Uses

type SubzoneSpan struct {
    // Key stores a key suffix that represents the inclusive lower bound for this
    // span. The SQL table prefix, like /Table/51/, is omitted.
    //
    // Both Key and EndKey, below, are cast to roachpb.Key for convenience, but
    // there's no technical restriction that prevents switching them to []byte or
    // another type that communicates their missing prefix.
    Key github_com_cockroachdb_cockroach_pkg_roachpb.Key `protobuf:"bytes,1,opt,name=key,casttype=github.com/cockroachdb/cockroach/pkg/roachpb.Key" json:"key,omitempty"`
    // EndKey stores a key suffix that represents the exclusive upper bound for
    // this span. Like with Key, the SQL table prefix is omitted. If EndKey is
    // empty, it is assumed to be Key.PrefixEnd().
    EndKey github_com_cockroachdb_cockroach_pkg_roachpb.Key `protobuf:"bytes,2,opt,name=end_key,json=endKey,casttype=github.com/cockroachdb/cockroach/pkg/roachpb.Key" json:"end_key,omitempty"`
    // SubzoneIndex is the slice index of the Subzone this span belongs to in the
    // parent ZoneConfig's Subzones field.
    SubzoneIndex int32 `protobuf:"varint,3,opt,name=subzone_index,json=subzoneIndex" json:"subzone_index"`
}

func NewPopulatedSubzoneSpan Uses

func NewPopulatedSubzoneSpan(r randyZone, easy bool) *SubzoneSpan

func (*SubzoneSpan) Descriptor Uses

func (*SubzoneSpan) Descriptor() ([]byte, []int)

func (*SubzoneSpan) Equal Uses

func (this *SubzoneSpan) Equal(that interface{}) bool

func (*SubzoneSpan) Marshal Uses

func (m *SubzoneSpan) Marshal() (dAtA []byte, err error)

func (*SubzoneSpan) MarshalTo Uses

func (m *SubzoneSpan) MarshalTo(dAtA []byte) (int, error)

func (*SubzoneSpan) ProtoMessage Uses

func (*SubzoneSpan) ProtoMessage()

func (*SubzoneSpan) Reset Uses

func (m *SubzoneSpan) Reset()

func (*SubzoneSpan) Size Uses

func (m *SubzoneSpan) Size() (n int)

func (*SubzoneSpan) String Uses

func (m *SubzoneSpan) String() string

func (*SubzoneSpan) Unmarshal Uses

func (m *SubzoneSpan) Unmarshal(dAtA []byte) error

func (*SubzoneSpan) XXX_DiscardUnknown Uses

func (m *SubzoneSpan) XXX_DiscardUnknown()

func (*SubzoneSpan) XXX_Marshal Uses

func (m *SubzoneSpan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SubzoneSpan) XXX_Merge Uses

func (dst *SubzoneSpan) XXX_Merge(src proto.Message)

func (*SubzoneSpan) XXX_Size Uses

func (m *SubzoneSpan) XXX_Size() int

func (*SubzoneSpan) XXX_Unmarshal Uses

func (m *SubzoneSpan) XXX_Unmarshal(b []byte) error

type ZoneConfig Uses

type ZoneConfig struct {
    RangeMinBytes *int64 `protobuf:"varint,2,opt,name=range_min_bytes,json=rangeMinBytes" json:"range_min_bytes,omitempty" yaml:"range_min_bytes"`
    RangeMaxBytes *int64 `protobuf:"varint,3,opt,name=range_max_bytes,json=rangeMaxBytes" json:"range_max_bytes,omitempty" yaml:"range_max_bytes"`
    // If GC policy is not set, uses the next highest, non-null policy
    // in the zone config hierarchy, up to the default policy if necessary.
    GC  *GCPolicy `protobuf:"bytes,4,opt,name=gc" json:"gc,omitempty"`
    // NumReplicas specifies the desired number of replicas
    NumReplicas *int32 `protobuf:"varint,5,opt,name=num_replicas,json=numReplicas" json:"num_replicas,omitempty" yaml:"num_replicas"`
    // Constraints constrains which stores the replicas can be stored on. The
    // order in which the constraints are stored is arbitrary and may change.
    // https://github.com/cockroachdb/cockroach/blob/master/docs/RFCS/20160706_expressive_zone_config.md#constraint-system
    //
    // NOTE: The sum of the num_replicas fields of the Constraints must add up to
    // ZoneConfig.num_replicas, or there must be no more than a single Constraints
    // field with num_replicas set to 0.
    Constraints []ConstraintsConjunction `protobuf:"bytes,6,rep,name=constraints" json:"constraints" yaml:"constraints,flow"`
    // InheritedContraints specifies if the value in the Constraints field was
    // inherited from the zone's parent or specified explicitly by the user.
    InheritedConstraints bool `protobuf:"varint,10,opt,name=inherited_constraints,json=inheritedConstraints" json:"inherited_constraints"`
    // LeasePreference stores information about where the user would prefer for
    // range leases to be placed. Leases are allowed to be placed elsewhere if
    // needed, but will follow the provided preference when possible.
    //
    // More than one lease preference is allowed, but they should be ordered from
    // most preferred to lease preferred. The first preference that an existing
    // replica of a range matches will take priority.
    LeasePreferences []LeasePreference `protobuf:"bytes,9,rep,name=lease_preferences,json=leasePreferences" json:"lease_preferences" yaml:"lease_preferences,flow"`
    // InheritedLeasePreferences specifies if the value in the LeasePreferences field
    // was inherited from the zone's parent or specified explicitly by the user.
    InheritedLeasePreferences bool `protobuf:"varint,11,opt,name=inherited_lease_preferences,json=inheritedLeasePreferences" json:"inherited_lease_preferences"`
    // Subzones stores config overrides for "subzones", each of which represents
    // either a SQL table index or a partition of a SQL table index. Subzones are
    // not applicable when the zone does not represent a SQL table (i.e., when the
    // zone represents a database, a special system range, or is itself a
    // subzone.)
    Subzones []Subzone `protobuf:"bytes,8,rep,name=subzones" json:"subzones" yaml:"-"`
    // SubzoneSpans maps each key span in a subzone to the slice index of an entry
    // in SubzoneConfig. Spans are non-overlapping and sorted by start key to
    // allow binary searching. SubzoneSpans can be easily derived from a
    // TableDescriptor, but are denormalized here to make GetZoneConfigForKey
    // lookups efficient.
    SubzoneSpans []SubzoneSpan `protobuf:"bytes,7,rep,name=subzone_spans,json=subzoneSpans" json:"subzone_spans" yaml:"-"`
}

ZoneConfig holds configuration that applies to one or more ranges.

Note: when adding/removing fields here, be sure to update supportedZoneConfigOptions in the sql package, to synchronize with the code for ALTER ... CONFIGURE ZONE.

func DefaultSystemZoneConfig Uses

func DefaultSystemZoneConfig() ZoneConfig

DefaultSystemZoneConfig is the default zone configuration used when no custom config has been specified. The DefaultSystemZoneConfig is like the DefaultZoneConfig but has a replication factor of 5 instead of 3.

func DefaultSystemZoneConfigRef Uses

func DefaultSystemZoneConfigRef() *ZoneConfig

DefaultSystemZoneConfigRef is the default zone configuration used when no custom config has been specified.

func DefaultZoneConfig Uses

func DefaultZoneConfig() ZoneConfig

DefaultZoneConfig is the default zone configuration used when no custom config has been specified.

func DefaultZoneConfigRef Uses

func DefaultZoneConfigRef() *ZoneConfig

DefaultZoneConfigRef is the default zone configuration used when no custom config has been specified.

func EmptyCompleteZoneConfig Uses

func EmptyCompleteZoneConfig() *ZoneConfig

EmptyCompleteZoneConfig is the zone configuration where all fields are set but set to their respective zero values.

func NewPopulatedZoneConfig Uses

func NewPopulatedZoneConfig(r randyZone, easy bool) *ZoneConfig

func NewZoneConfig Uses

func NewZoneConfig() *ZoneConfig

NewZoneConfig is the zone configuration used when no custom config has been specified.

func (*ZoneConfig) CopyFromZone Uses

func (z *ZoneConfig) CopyFromZone(other ZoneConfig, fieldList []tree.Name)

CopyFromZone copies over the specified fields from the other zone.

func (*ZoneConfig) DeleteIndexSubzones Uses

func (z *ZoneConfig) DeleteIndexSubzones(indexID uint32)

DeleteIndexSubzones deletes all subzones that refer to the index with the specified ID. This includes subzones for partitions of the index as well as the index subzone itself.

func (*ZoneConfig) DeleteSubzone Uses

func (z *ZoneConfig) DeleteSubzone(indexID uint32, partition string) bool

DeleteSubzone removes the subzone with the specified index ID and partition. It returns whether it performed any work.

func (*ZoneConfig) DeleteTableConfig Uses

func (z *ZoneConfig) DeleteTableConfig()

DeleteTableConfig removes any configuration that applies to the table targeted by this ZoneConfig, leaving only its subzone configs, if any. After calling DeleteTableConfig, IsSubzonePlaceholder will return true.

Only table zones can have subzones, so it does not make sense to call this method on non-table ZoneConfigs.

func (*ZoneConfig) Descriptor Uses

func (*ZoneConfig) Descriptor() ([]byte, []int)

func (*ZoneConfig) Equal Uses

func (this *ZoneConfig) Equal(that interface{}) bool

func (*ZoneConfig) GetSubzone Uses

func (z *ZoneConfig) GetSubzone(indexID uint32, partition string) *Subzone

GetSubzone returns the most specific Subzone that applies to the specified index ID and partition, if any exists. The partition can be left unspecified to get the Subzone for an entire index, if it exists. indexID, however, must always be provided, even when looking for a partition's Subzone.

func (*ZoneConfig) GetSubzoneExact Uses

func (z *ZoneConfig) GetSubzoneExact(indexID uint32, partition string) *Subzone

GetSubzoneExact is similar to GetSubzone but does not find the most specific subzone that applies to a specified index and partition, as it finds either the exact config that applies, or returns nil.

func (ZoneConfig) GetSubzoneForKeySuffix Uses

func (z ZoneConfig) GetSubzoneForKeySuffix(keySuffix []byte) (*Subzone, int32)

GetSubzoneForKeySuffix returns the ZoneConfig for the subzone that contains keySuffix, if it exists and its position in the subzones slice.

func (*ZoneConfig) InheritFromParent Uses

func (z *ZoneConfig) InheritFromParent(parent *ZoneConfig)

InheritFromParent hydrates a zones missing fields from its parent.

func (*ZoneConfig) IsComplete Uses

func (z *ZoneConfig) IsComplete() bool

IsComplete returns whether all the fields are set.

func (*ZoneConfig) IsSubzonePlaceholder Uses

func (z *ZoneConfig) IsSubzonePlaceholder() bool

IsSubzonePlaceholder returns whether the ZoneConfig exists only to store subzones. The configuration fields (e.g., RangeMinBytes) in a subzone placeholder should be ignored; instead, the configuration from the parent ZoneConfig applies.

func (*ZoneConfig) LeasePreference Uses

func (z *ZoneConfig) LeasePreference(i int) cat.ConstraintSet

LeasePreference is part of the cat.Zone interface.

func (*ZoneConfig) LeasePreferenceCount Uses

func (z *ZoneConfig) LeasePreferenceCount() int

LeasePreferenceCount is part of the cat.Zone interface.

func (*ZoneConfig) Marshal Uses

func (m *ZoneConfig) Marshal() (dAtA []byte, err error)

func (*ZoneConfig) MarshalTo Uses

func (m *ZoneConfig) MarshalTo(dAtA []byte) (int, error)

func (ZoneConfig) MarshalYAML Uses

func (c ZoneConfig) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler.

func (*ZoneConfig) ProtoMessage Uses

func (*ZoneConfig) ProtoMessage()

func (*ZoneConfig) ReplicaConstraints Uses

func (z *ZoneConfig) ReplicaConstraints(i int) cat.ReplicaConstraints

ReplicaConstraints is part of the cat.Zone interface.

func (*ZoneConfig) ReplicaConstraintsCount Uses

func (z *ZoneConfig) ReplicaConstraintsCount() int

ReplicaConstraintsCount is part of the cat.Zone interface.

func (*ZoneConfig) Reset Uses

func (m *ZoneConfig) Reset()

func (*ZoneConfig) SetSubzone Uses

func (z *ZoneConfig) SetSubzone(subzone Subzone)

SetSubzone installs subzone into the ZoneConfig, overwriting any existing subzone with the same IndexID and PartitionName.

func (*ZoneConfig) Size Uses

func (m *ZoneConfig) Size() (n int)

func (*ZoneConfig) String Uses

func (m *ZoneConfig) String() string

func (ZoneConfig) SubzoneSplits Uses

func (z ZoneConfig) SubzoneSplits() []roachpb.RKey

SubzoneSplits returns the split points determined by a ZoneConfig's subzones.

func (*ZoneConfig) Unmarshal Uses

func (m *ZoneConfig) Unmarshal(dAtA []byte) error

func (*ZoneConfig) UnmarshalYAML Uses

func (c *ZoneConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler.

func (*ZoneConfig) Validate Uses

func (z *ZoneConfig) Validate() error

Validate returns an error if the ZoneConfig specifies a known-dangerous or disallowed configuration.

func (*ZoneConfig) ValidateTandemFields Uses

func (z *ZoneConfig) ValidateTandemFields() error

ValidateTandemFields returns an error if the ZoneConfig to be written specifies a configuration that could cause problems with the introduction of cascading zone configs.

func (*ZoneConfig) XXX_DiscardUnknown Uses

func (m *ZoneConfig) XXX_DiscardUnknown()

func (*ZoneConfig) XXX_Marshal Uses

func (m *ZoneConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ZoneConfig) XXX_Merge Uses

func (dst *ZoneConfig) XXX_Merge(src proto.Message)

func (*ZoneConfig) XXX_Size Uses

func (m *ZoneConfig) XXX_Size() int

func (*ZoneConfig) XXX_Unmarshal Uses

func (m *ZoneConfig) XXX_Unmarshal(b []byte) error

Package zonepb imports 18 packages (graph) and is imported by 57 packages. Updated 2020-07-02. Refresh now. Tools for package owners.