Permalink
Switch branches/tags
v2.2.0-alpha.00000000 v2.1.0-beta.20181015 v2.1.0-beta.20181008 v2.1.0-beta.20181001 v2.1.0-beta.20180924 v2.1.0-beta.20180917 v2.1.0-beta.20180910 v2.1.0-beta.20180904 v2.1.0-beta.20180827 v2.1.0-alpha.20180730 v2.1.0-alpha.20180702 v2.1.0-alpha.20180604 v2.1.0-alpha.20180507 v2.1.0-alpha.20180416 v2.1.0-alpha.00000000 v2.0.6 v2.0.6-rc.1 v2.0.5 v2.0.4 v2.0.3 v2.0.2 v2.0.1 v2.0.0 v2.0-rc.1 v2.0-beta.20180326 v2.0-beta.20180319 v2.0-beta.20180312 v2.0-beta.20180305 v2.0-alpha.20180212 v2.0-alpha.20180129 v2.0-alpha.20180122 v2.0-alpha.20180116 v2.0-alpha.20171218 v2.0-alpha.20171218-plus-left-join-fix v1.2-alpha.20171211 v1.2-alpha.20171204 v1.2-alpha.20171113 v1.2-alpha.20171026 v1.2-alpha.20170901 v1.1.9 v1.1.9-rc.1 v1.1.8 v1.1.7 v1.1.6 v1.1.5 v1.1.4 v1.1.3 v1.1.2 v1.1.1 v1.1.0 v1.1.0-rc.1 v1.1-beta.20170928 v1.1-beta.20170921 v1.1-beta.20170907 v1.1-alpha.20170817 v1.1-alpha.20170810 v1.1-alpha.20170803 v1.1-alpha.20170720 v1.1-alpha.20170713 v1.1-alpha.20170629 v1.1-alpha.20170622 v1.1-alpha.20170608 v1.1-alpha.20170601 v1.0.7 v1.0.6 v1.0.5 v1.0.4 v1.0.3 v1.0.2 v1.0.1 v1.0 v1.0-rc.3 v1.0-rc.2 v1.0-rc.1 v0.1-alpha beta-20170420 beta-20170413 beta-20170406 beta-20170330 beta-20170323 beta-20170309 beta-20170223 beta-20170216 beta-20170209 beta-20170126 beta-20170112 beta-20170105 beta-20161215 beta-20161208 beta-20161201 beta-20161110 beta-20161103 beta-20161027 beta-20161013 beta-20161006 beta-20160929 beta-20160915 beta-20160908 beta-20160829 beta-20160728
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
131 lines (110 sloc) 5.82 KB
// Copyright 2015 The Cockroach Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
// implied. See the License for the specific language governing
// permissions and limitations under the License.
syntax = "proto2";
package cockroach.config;
option go_package = "config";
import "gogoproto/gogo.proto";
// 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.
message GCPolicy {
option (gogoproto.equal) = true;
// 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.
optional int32 ttl_seconds = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "TTLSeconds"];
}
// Constraint constrains the stores a replica can be stored on.
message Constraint {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
enum Type {
// POSITIVE will attempt to ensure all stores the replicas are on has this
// constraint.
POSITIVE = 0;
// REQUIRED is like POSITIVE except replication will fail if not satisfied.
REQUIRED = 1;
// PROHIBITED will prevent replicas from having this key, value.
PROHIBITED = 2;
}
optional Type type = 1 [(gogoproto.nullable) = false];
// Key is only set if this is a constraint on locality.
optional string key = 2 [(gogoproto.nullable) = false];
// Value to constrain to.
optional string value = 3 [(gogoproto.nullable) = false];
}
// Constraints is a collection of constraints.
message Constraints {
option (gogoproto.equal) = true;
repeated Constraint constraints = 6 [(gogoproto.nullable) = false];
}
// ZoneConfig holds configuration that applies to one or more ranges.
message ZoneConfig {
option (gogoproto.equal) = true;
reserved 1;
optional int64 range_min_bytes = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"range_min_bytes\""];
optional int64 range_max_bytes = 3 [(gogoproto.nullable) = false, (gogoproto.moretags) = "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.
optional GCPolicy gc = 4 [(gogoproto.nullable) = false, (gogoproto.customname) = "GC"];
// NumReplicas specifies the desired number of replicas
optional int32 num_replicas = 5 [(gogoproto.nullable) = false, (gogoproto.moretags) = "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
optional Constraints constraints = 6 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"constraints,flow\""];
// 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.)
repeated Subzone subzones = 8 [(gogoproto.nullable) = false, (gogoproto.moretags) = "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.
repeated SubzoneSpan subzone_spans = 7 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"-\""];
}
message Subzone {
option (gogoproto.equal) = true;
// IndexID is the ID of the SQL table index that the subzone represents.
optional uint32 index_id = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "IndexID"];
// PartitionName is the partition of the SQL table index that the subzone
// represents. It is empty when the subzone represents the entire index.
optional string partition_name = 2 [(gogoproto.nullable) = false];
// Config stores the ZoneConfig that applies to this Subzone. It never
// contains nested subzones.
optional ZoneConfig config = 3 [(gogoproto.nullable) = false];
}
message SubzoneSpan {
option (gogoproto.equal) = true;
// 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.
optional bytes key = 1 [(gogoproto.casttype) = "github.com/cockroachdb/cockroach/pkg/roachpb.Key"];
// 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().
optional bytes end_key = 2 [(gogoproto.casttype) = "github.com/cockroachdb/cockroach/pkg/roachpb.Key"];
// SubzoneIndex is the slice index of the Subzone this span belongs to in the
// parent ZoneConfig's Subzones field.
optional int32 subzone_index = 3 [(gogoproto.nullable) = false];
}