Documentation ¶
Overview ¶
Package config is a generated protocol buffer package.
It is generated from these files:
cockroach/config/config.proto
It has these top-level messages:
GCPolicy ZoneConfig SystemConfig
Index ¶
- Variables
- func ObjectIDForKey(key roachpb.RKey) (uint32, bool)
- func TestingDisableTableSplits() func()
- func TestingSetZoneConfig(id uint32, zone *ZoneConfig)
- func TestingSetupZoneConfigHook(stopper *stop.Stopper)
- type GCPolicy
- type SystemConfig
- func (s SystemConfig) ComputeSplitKeys(startKey, endKey roachpb.RKey) []roachpb.RKey
- func (s SystemConfig) GetIndex(key roachpb.Key) (int, bool)
- func (s SystemConfig) GetLargestObjectID() (uint32, error)
- func (s SystemConfig) GetValue(key roachpb.Key) *roachpb.Value
- func (s SystemConfig) GetZoneConfigForKey(key roachpb.RKey) (*ZoneConfig, error)
- func (m *SystemConfig) Marshal() (data []byte, err error)
- func (m *SystemConfig) MarshalTo(data []byte) (int, error)
- func (s SystemConfig) NeedsSplit(startKey, endKey roachpb.RKey) bool
- func (*SystemConfig) ProtoMessage()
- func (m *SystemConfig) Reset()
- func (m *SystemConfig) Size() (n int)
- func (m *SystemConfig) String() string
- func (m *SystemConfig) Unmarshal(data []byte) error
- type ZoneConfig
- func (m *ZoneConfig) Marshal() (data []byte, err error)
- func (m *ZoneConfig) MarshalTo(data []byte) (int, error)
- func (*ZoneConfig) ProtoMessage()
- func (m *ZoneConfig) Reset()
- func (m *ZoneConfig) Size() (n int)
- func (m *ZoneConfig) String() string
- func (m *ZoneConfig) Unmarshal(data []byte) error
- func (z ZoneConfig) Validate() error
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultZoneConfig is the default zone configuration // used when no custom config has been specified. DefaultZoneConfig = &ZoneConfig{ ReplicaAttrs: []roachpb.Attributes{ {}, {}, {}, }, RangeMinBytes: 1048576, RangeMaxBytes: 67108864, GC: &GCPolicy{ TTLSeconds: 24 * 60 * 60, }, } // ZoneConfigHook is a function used to lookup a zone config given a table // or database ID. // This is also used by testing to simplify fake configs. ZoneConfigHook func(SystemConfig, uint32) (*ZoneConfig, error) )
var ( ErrInvalidLengthConfig = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowConfig = fmt.Errorf("proto: integer overflow") )
Functions ¶
func ObjectIDForKey ¶
ObjectIDForKey returns the object ID (table or database) for 'key', or (_, false) if not within the structured key space.
func TestingDisableTableSplits ¶
func TestingDisableTableSplits() func()
TestingDisableTableSplits is a testing-only function that disables splits of tables into separate ranges. It returns a function that re-enables this splitting.
func TestingSetZoneConfig ¶
func TestingSetZoneConfig(id uint32, zone *ZoneConfig)
TestingSetZoneConfig sets the zone config entry for object 'id' in the testing map.
func TestingSetupZoneConfigHook ¶
TestingSetupZoneConfigHook initializes the zone config hook to 'testingZoneConfigHook' which uses 'testingZoneConfig'. Settings go back to their previous values when the stopper runs our closer.
Types ¶
type GCPolicy ¶
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:"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 (*GCPolicy) ProtoMessage ¶
func (*GCPolicy) ProtoMessage()
type SystemConfig ¶
type SystemConfig struct {
Values []cockroach_roachpb1.KeyValue `protobuf:"bytes,1,rep,name=values" json:"values"`
}
func (SystemConfig) ComputeSplitKeys ¶
func (s SystemConfig) ComputeSplitKeys(startKey, endKey roachpb.RKey) []roachpb.RKey
ComputeSplitKeys takes a start and end key and returns an array of keys at which to split the span [start, end). The only required splits are at each user table prefix.
func (SystemConfig) GetIndex ¶
func (s SystemConfig) GetIndex(key roachpb.Key) (int, bool)
GetIndex searches the kv list for 'key' and returns its index if found.
func (SystemConfig) GetLargestObjectID ¶
func (s SystemConfig) GetLargestObjectID() (uint32, error)
GetLargestObjectID returns the largest object ID found in the config. This could be either a table or a database.
func (SystemConfig) GetValue ¶
func (s SystemConfig) GetValue(key roachpb.Key) *roachpb.Value
GetValue searches the kv list for 'key' and returns its roachpb.Value if found.
func (SystemConfig) GetZoneConfigForKey ¶
func (s SystemConfig) GetZoneConfigForKey(key roachpb.RKey) (*ZoneConfig, error)
GetZoneConfigForKey looks up the zone config for the range containing 'key'. It is the caller's responsibility to ensure that the range does not need to be split.
func (*SystemConfig) Marshal ¶
func (m *SystemConfig) Marshal() (data []byte, err error)
func (SystemConfig) NeedsSplit ¶
func (s SystemConfig) NeedsSplit(startKey, endKey roachpb.RKey) bool
NeedsSplit returns whether the range [startKey, endKey) needs a split due to zone configs.
func (*SystemConfig) ProtoMessage ¶
func (*SystemConfig) ProtoMessage()
func (*SystemConfig) Reset ¶
func (m *SystemConfig) Reset()
func (*SystemConfig) Size ¶
func (m *SystemConfig) Size() (n int)
func (*SystemConfig) String ¶
func (m *SystemConfig) String() string
func (*SystemConfig) Unmarshal ¶
func (m *SystemConfig) Unmarshal(data []byte) error
type ZoneConfig ¶
type ZoneConfig struct { // ReplicaAttrs is a slice of Attributes, each describing required attributes // for each replica in the zone. The order in which the attributes are stored // in ReplicaAttrs is arbitrary and may change. ReplicaAttrs []cockroach_roachpb.Attributes `protobuf:"bytes,1,rep,name=replica_attrs" json:"replica_attrs" yaml:"replicas,omitempty"` RangeMinBytes int64 `protobuf:"varint,2,opt,name=range_min_bytes" json:"range_min_bytes" yaml:"range_min_bytes,omitempty"` RangeMaxBytes int64 `protobuf:"varint,3,opt,name=range_max_bytes" json:"range_max_bytes" yaml:"range_max_bytes,omitempty"` // 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" yaml:"gc,omitempty"` }
ZoneConfig holds configuration that is needed for a range of KV pairs.
func (*ZoneConfig) Marshal ¶
func (m *ZoneConfig) Marshal() (data []byte, err error)
func (*ZoneConfig) ProtoMessage ¶
func (*ZoneConfig) ProtoMessage()
func (*ZoneConfig) Reset ¶
func (m *ZoneConfig) Reset()
func (*ZoneConfig) Size ¶
func (m *ZoneConfig) Size() (n int)
func (*ZoneConfig) String ¶
func (m *ZoneConfig) String() string
func (*ZoneConfig) Unmarshal ¶
func (m *ZoneConfig) Unmarshal(data []byte) error
func (ZoneConfig) Validate ¶
func (z ZoneConfig) Validate() error
Validate verifies some ZoneConfig fields. This should be used to validate user input when setting a new zone config.