cockroach: github.com/abhinavdahiya/cockroach/config Index | Files

package config

import "github.com/abhinavdahiya/cockroach/config"

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

Package Files

config.go config.pb.go testutil.go

Variables

var (
    ErrInvalidLengthConfig = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowConfig   = fmt.Errorf("proto: integer overflow")
)
var (

    // 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)
)

func ObjectIDForKey Uses

func ObjectIDForKey(key roachpb.RKey) (uint32, bool)

ObjectIDForKey returns the object ID (table or database) for 'key', or (_, false) if not within the structured key space.

func TestingSetDefaultZoneConfig Uses

func TestingSetDefaultZoneConfig(cfg ZoneConfig) func()

TestingSetDefaultZoneConfig is a testing-only function that changes the default zone config and returns a function that reverts the change.

func TestingSetZoneConfig Uses

func TestingSetZoneConfig(id uint32, zone *ZoneConfig)

TestingSetZoneConfig sets the zone config entry for object 'id' in the testing map.

func TestingSetupZoneConfigHook Uses

func TestingSetupZoneConfigHook(stopper *stop.Stopper)

TestingSetupZoneConfigHook initializes the zone config hook to 'testingZoneConfigHook' which uses 'testingZoneConfig'. Settings go back to their previous values when the stopper runs our closer.

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 (*GCPolicy) Descriptor Uses

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

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) Unmarshal Uses

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

type SystemConfig Uses

type SystemConfig struct {
    Values []cockroach_roachpb1.KeyValue `protobuf:"bytes,1,rep,name=values" json:"values"`
}

func (SystemConfig) ComputeSplitKeys Uses

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) Descriptor Uses

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

func (SystemConfig) GetIndex Uses

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 Uses

func (s SystemConfig) GetLargestObjectID(maxID uint32) (uint32, error)

GetLargestObjectID returns the largest object ID found in the config which is less than or equal to maxID. If maxID is 0, returns the largest ID in the config.

func (SystemConfig) GetValue Uses

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 Uses

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) Hash Uses

func (s SystemConfig) Hash() []byte

Hash returns a SHA1 hash of the SystemConfig contents.

func (*SystemConfig) Marshal Uses

func (m *SystemConfig) Marshal() (data []byte, err error)

func (*SystemConfig) MarshalTo Uses

func (m *SystemConfig) MarshalTo(data []byte) (int, error)

func (SystemConfig) NeedsSplit Uses

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 Uses

func (*SystemConfig) ProtoMessage()

func (*SystemConfig) Reset Uses

func (m *SystemConfig) Reset()

func (*SystemConfig) Size Uses

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

func (*SystemConfig) String Uses

func (m *SystemConfig) String() string

func (*SystemConfig) Unmarshal Uses

func (m *SystemConfig) Unmarshal(data []byte) error

type ZoneConfig Uses

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=replicaAttrs" json:"replica_attrs" yaml:"replicas,omitempty"`
    RangeMinBytes int64                          `protobuf:"varint,2,opt,name=range_min_bytes,json=rangeMinBytes" json:"range_min_bytes" yaml:"range_min_bytes"`
    RangeMaxBytes int64                          `protobuf:"varint,3,opt,name=range_max_bytes,json=rangeMaxBytes" json:"range_max_bytes" 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"`
}

ZoneConfig holds configuration that is needed for a range of KV pairs.

func DefaultZoneConfig Uses

func DefaultZoneConfig() ZoneConfig

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

func (*ZoneConfig) Descriptor Uses

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

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) ProtoMessage Uses

func (*ZoneConfig) ProtoMessage()

func (*ZoneConfig) Reset Uses

func (m *ZoneConfig) Reset()

func (*ZoneConfig) Size Uses

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

func (*ZoneConfig) String Uses

func (m *ZoneConfig) String() string

func (*ZoneConfig) Unmarshal Uses

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

func (ZoneConfig) Validate Uses

func (z ZoneConfig) Validate() error

Validate verifies some ZoneConfig fields. This should be used to validate user input when setting a new zone config.

Package config imports 14 packages (graph). Updated 2017-03-13. Refresh now. Tools for package owners. This is a dead-end fork (no commits since the fork).