Documentation ¶
Overview ¶
Package proto is a generated protocol buffer package.
It is generated from these files:
cockroach/proto/api.proto cockroach/proto/config.proto cockroach/proto/data.proto cockroach/proto/errors.proto cockroach/proto/gossip.proto cockroach/proto/heartbeat.proto cockroach/proto/internal.proto
It has these top-level messages:
ClientCmdID RequestHeader ResponseHeader ContainsRequest ContainsResponse GetRequest GetResponse PutRequest PutResponse ConditionalPutRequest ConditionalPutResponse IncrementRequest IncrementResponse DeleteRequest DeleteResponse DeleteRangeRequest DeleteRangeResponse ScanRequest ScanResponse EndTransactionRequest EndTransactionResponse ReapQueueRequest ReapQueueResponse EnqueueUpdateRequest EnqueueUpdateResponse EnqueueMessageRequest EnqueueMessageResponse RequestUnion ResponseUnion BatchRequest BatchResponse AdminSplitRequest AdminSplitResponse AdminMergeRequest AdminMergeResponse
Index ¶
- Constants
- Variables
- func CreateArgsAndReply(method string) (args Request, reply Response, err error)
- func IsAdmin(method string) bool
- func IsInternal(method string) bool
- func IsPublic(method string) bool
- func IsReadOnly(method string) bool
- func IsReadWrite(method string) bool
- func IsTransactional(method string) bool
- func MD5Equal(a, b [md5.Size]byte) bool
- func MakePriority(userPriority int32) int32
- func MethodForRequest(req Request) (string, error)
- func NeedAdminPerm(method string) bool
- func NeedReadPerm(method string) bool
- func NeedWritePerm(method string) bool
- type AcctConfig
- type Addr
- type AdminMergeRequest
- type AdminMergeResponse
- type AdminSplitRequest
- type AdminSplitResponse
- type Attributes
- type BatchRequest
- type BatchResponse
- type ChangeReplicasTrigger
- type ClientCmdID
- type Combinable
- type ConditionFailedError
- type ConditionalPutRequest
- type ConditionalPutResponse
- type ContainsRequest
- type ContainsResponse
- type DeleteRangeRequest
- type DeleteRangeResponse
- type DeleteRequest
- type DeleteResponse
- type EncodedKey
- func (k EncodedKey) Equal(l EncodedKey) bool
- func (k EncodedKey) Less(l EncodedKey) bool
- func (k EncodedKey) Marshal() ([]byte, error)
- func (k EncodedKey) Next() EncodedKey
- func (k EncodedKey) PrefixEnd() EncodedKey
- func (k *EncodedKey) Unmarshal(bytes []byte) error
- func (k *EncodedKey) UnmarshalJSON(bytes []byte) error
- type EndTransactionRequest
- type EndTransactionResponse
- type EnqueueMessageRequest
- type EnqueueMessageResponse
- type EnqueueUpdateRequest
- type EnqueueUpdateResponse
- type Error
- func (m *Error) GetConditionFailed() *ConditionFailedError
- func (m *Error) GetGeneric() *GenericError
- func (m *Error) GetNotLeader() *NotLeaderError
- func (m *Error) GetOpRequiresTxn() *OpRequiresTxnError
- func (m *Error) GetRangeKeyMismatch() *RangeKeyMismatchError
- func (m *Error) GetRangeNotFound() *RangeNotFoundError
- func (m *Error) GetReadWithinUncertaintyInterval() *ReadWithinUncertaintyIntervalError
- func (m *Error) GetTransactionAborted() *TransactionAbortedError
- func (m *Error) GetTransactionPush() *TransactionPushError
- func (m *Error) GetTransactionRetry() *TransactionRetryError
- func (m *Error) GetTransactionStatus() *TransactionStatusError
- func (this *Error) GetValue() interface{}
- func (m *Error) GetWriteIntent() *WriteIntentError
- func (m *Error) GetWriteTooOld() *WriteTooOldError
- func (*Error) ProtoMessage()
- func (m *Error) Reset()
- func (this *Error) SetValue(value interface{}) bool
- func (m *Error) String() string
- type GCMetadata
- type GCPolicy
- type GenericError
- type GetRequest
- type GetResponse
- type GossipRequest
- type GossipResponse
- type IncrementRequest
- type IncrementResponse
- type Int32Slice
- type InternalCommitTrigger
- func (m *InternalCommitTrigger) GetChangeReplicasTrigger() *ChangeReplicasTrigger
- func (m *InternalCommitTrigger) GetMergeTrigger() *MergeTrigger
- func (m *InternalCommitTrigger) GetSplitTrigger() *SplitTrigger
- func (*InternalCommitTrigger) ProtoMessage()
- func (m *InternalCommitTrigger) Reset()
- func (m *InternalCommitTrigger) String() string
- type InternalGCRequest
- type InternalGCRequest_GCKey
- type InternalGCResponse
- type InternalHeartbeatTxnRequest
- type InternalHeartbeatTxnResponse
- type InternalMergeRequest
- type InternalMergeResponse
- type InternalPushTxnRequest
- type InternalPushTxnResponse
- type InternalRaftCommand
- type InternalRaftCommandUnion
- func (m *InternalRaftCommandUnion) GetBatch() *BatchRequest
- func (m *InternalRaftCommandUnion) GetConditionalPut() *ConditionalPutRequest
- func (m *InternalRaftCommandUnion) GetContains() *ContainsRequest
- func (m *InternalRaftCommandUnion) GetDelete() *DeleteRequest
- func (m *InternalRaftCommandUnion) GetDeleteRange() *DeleteRangeRequest
- func (m *InternalRaftCommandUnion) GetEndTransaction() *EndTransactionRequest
- func (m *InternalRaftCommandUnion) GetEnqueueMessage() *EnqueueMessageRequest
- func (m *InternalRaftCommandUnion) GetEnqueueUpdate() *EnqueueUpdateRequest
- func (m *InternalRaftCommandUnion) GetGet() *GetRequest
- func (m *InternalRaftCommandUnion) GetIncrement() *IncrementRequest
- func (m *InternalRaftCommandUnion) GetInternalGc() *InternalGCRequest
- func (m *InternalRaftCommandUnion) GetInternalHeartbeatTxn() *InternalHeartbeatTxnRequest
- func (m *InternalRaftCommandUnion) GetInternalMergeResponse() *InternalMergeRequest
- func (m *InternalRaftCommandUnion) GetInternalPushTxn() *InternalPushTxnRequest
- func (m *InternalRaftCommandUnion) GetInternalRangeLookup() *InternalRangeLookupRequest
- func (m *InternalRaftCommandUnion) GetInternalResolveIntent() *InternalResolveIntentRequest
- func (m *InternalRaftCommandUnion) GetInternalTruncateLog() *InternalTruncateLogRequest
- func (m *InternalRaftCommandUnion) GetPut() *PutRequest
- func (m *InternalRaftCommandUnion) GetReapQueue() *ReapQueueRequest
- func (m *InternalRaftCommandUnion) GetScan() *ScanRequest
- func (this *InternalRaftCommandUnion) GetValue() interface{}
- func (*InternalRaftCommandUnion) ProtoMessage()
- func (m *InternalRaftCommandUnion) Reset()
- func (this *InternalRaftCommandUnion) SetValue(value interface{}) bool
- func (m *InternalRaftCommandUnion) String() string
- type InternalRangeLookupRequest
- type InternalRangeLookupResponse
- type InternalResolveIntentRequest
- type InternalResolveIntentResponse
- type InternalTimeSeriesData
- func (m *InternalTimeSeriesData) GetSampleDurationNanos() int64
- func (m *InternalTimeSeriesData) GetSamples() []*InternalTimeSeriesSample
- func (m *InternalTimeSeriesData) GetStartTimestampNanos() int64
- func (*InternalTimeSeriesData) ProtoMessage()
- func (m *InternalTimeSeriesData) Reset()
- func (m *InternalTimeSeriesData) String() string
- func (ts *InternalTimeSeriesData) ToValue() (*Value, error)
- type InternalTimeSeriesSample
- func (m *InternalTimeSeriesSample) GetFloatCount() uint32
- func (m *InternalTimeSeriesSample) GetFloatMax() float32
- func (m *InternalTimeSeriesSample) GetFloatMin() float32
- func (m *InternalTimeSeriesSample) GetFloatSum() float32
- func (m *InternalTimeSeriesSample) GetIntCount() uint32
- func (m *InternalTimeSeriesSample) GetIntMax() int64
- func (m *InternalTimeSeriesSample) GetIntMin() int64
- func (m *InternalTimeSeriesSample) GetIntSum() int64
- func (m *InternalTimeSeriesSample) GetOffset() int32
- func (*InternalTimeSeriesSample) ProtoMessage()
- func (m *InternalTimeSeriesSample) Reset()
- func (m *InternalTimeSeriesSample) String() string
- type InternalTruncateLogRequest
- type InternalTruncateLogResponse
- type InternalValueType
- type IsolationType
- type Key
- func (k Key) Compare(b interval.Comparable) int
- func (k Key) Equal(l Key) bool
- func (k Key) Less(l Key) bool
- func (k Key) Marshal() ([]byte, error)
- func (k Key) Next() Key
- func (k Key) PrefixEnd() Key
- func (k Key) String() string
- func (k *Key) Unmarshal(bytes []byte) error
- func (k *Key) UnmarshalJSON(bytes []byte) error
- type KeyGetter
- type KeySlice
- type KeyValue
- type MVCCMetadata
- func (m *MVCCMetadata) GetDeleted() bool
- func (m *MVCCMetadata) GetKeyBytes() int64
- func (m *MVCCMetadata) GetTimestamp() Timestamp
- func (m *MVCCMetadata) GetTxn() *Transaction
- func (m *MVCCMetadata) GetValBytes() int64
- func (m *MVCCMetadata) GetValue() *Value
- func (mvcc *MVCCMetadata) IsInline() bool
- func (*MVCCMetadata) ProtoMessage()
- func (m *MVCCMetadata) Reset()
- func (m *MVCCMetadata) String() string
- func (m *MVCCMetadata) Unmarshal(data []byte) error
- type MVCCValue
- type MergeTrigger
- type NodeID
- type NodeList
- type NotLeaderError
- type OpRequiresTxnError
- type PermConfig
- type PingRequest
- type PingResponse
- type PutRequest
- type PutResponse
- type RaftTruncatedState
- type RangeDescriptor
- func (r *RangeDescriptor) ContainsKey(key []byte) bool
- func (r *RangeDescriptor) ContainsKeyRange(start, end []byte) bool
- func (r *RangeDescriptor) FindReplica(storeID StoreID) *Replica
- func (m *RangeDescriptor) GetRaftID() int64
- func (m *RangeDescriptor) GetReplicas() []Replica
- func (*RangeDescriptor) ProtoMessage()
- func (m *RangeDescriptor) Reset()
- func (m *RangeDescriptor) String() string
- type RangeKeyMismatchError
- type RangeNotFoundError
- type RangeTree
- type RangeTreeNode
- func (m *RangeTreeNode) GetBlack() bool
- func (m *RangeTreeNode) GetLeftID() int64
- func (m *RangeTreeNode) GetParentID() int64
- func (m *RangeTreeNode) GetRaftID() int64
- func (m *RangeTreeNode) GetRightID() int64
- func (*RangeTreeNode) ProtoMessage()
- func (m *RangeTreeNode) Reset()
- func (m *RangeTreeNode) String() string
- type RawKeyValue
- type ReadWithinUncertaintyIntervalError
- func (e *ReadWithinUncertaintyIntervalError) Error() string
- func (m *ReadWithinUncertaintyIntervalError) GetExistingTimestamp() Timestamp
- func (m *ReadWithinUncertaintyIntervalError) GetTimestamp() Timestamp
- func (*ReadWithinUncertaintyIntervalError) ProtoMessage()
- func (m *ReadWithinUncertaintyIntervalError) Reset()
- func (m *ReadWithinUncertaintyIntervalError) String() string
- type ReadWriteCmdResponse
- func (m *ReadWriteCmdResponse) GetConditionalPut() *ConditionalPutResponse
- func (m *ReadWriteCmdResponse) GetDelete() *DeleteResponse
- func (m *ReadWriteCmdResponse) GetDeleteRange() *DeleteRangeResponse
- func (m *ReadWriteCmdResponse) GetEndTransaction() *EndTransactionResponse
- func (m *ReadWriteCmdResponse) GetEnqueueMessage() *EnqueueMessageResponse
- func (m *ReadWriteCmdResponse) GetEnqueueUpdate() *EnqueueUpdateResponse
- func (m *ReadWriteCmdResponse) GetIncrement() *IncrementResponse
- func (m *ReadWriteCmdResponse) GetInternalGc() *InternalGCResponse
- func (m *ReadWriteCmdResponse) GetInternalHeartbeatTxn() *InternalHeartbeatTxnResponse
- func (m *ReadWriteCmdResponse) GetInternalMerge() *InternalMergeResponse
- func (m *ReadWriteCmdResponse) GetInternalPushTxn() *InternalPushTxnResponse
- func (m *ReadWriteCmdResponse) GetInternalResolveIntent() *InternalResolveIntentResponse
- func (m *ReadWriteCmdResponse) GetInternalTruncateLog() *InternalTruncateLogResponse
- func (m *ReadWriteCmdResponse) GetPut() *PutResponse
- func (m *ReadWriteCmdResponse) GetReapQueue() *ReapQueueResponse
- func (this *ReadWriteCmdResponse) GetValue() interface{}
- func (*ReadWriteCmdResponse) ProtoMessage()
- func (m *ReadWriteCmdResponse) Reset()
- func (this *ReadWriteCmdResponse) SetValue(value interface{}) bool
- func (m *ReadWriteCmdResponse) String() string
- type ReapQueueRequest
- type ReapQueueResponse
- type RemoteOffset
- type Replica
- type ReplicaChangeType
- type Request
- type RequestHeader
- func (m *RequestHeader) GetCmdID() ClientCmdID
- func (m *RequestHeader) GetRaftID() int64
- func (m *RequestHeader) GetReplica() Replica
- func (m *RequestHeader) GetTimestamp() Timestamp
- func (m *RequestHeader) GetTxn() *Transaction
- func (m *RequestHeader) GetUser() string
- func (m *RequestHeader) GetUserPriority() int32
- func (rh *RequestHeader) Header() *RequestHeader
- func (*RequestHeader) ProtoMessage()
- func (m *RequestHeader) Reset()
- func (m *RequestHeader) String() string
- type RequestUnion
- func (m *RequestUnion) GetConditionalPut() *ConditionalPutRequest
- func (m *RequestUnion) GetContains() *ContainsRequest
- func (m *RequestUnion) GetDelete() *DeleteRequest
- func (m *RequestUnion) GetDeleteRange() *DeleteRangeRequest
- func (m *RequestUnion) GetEndTransaction() *EndTransactionRequest
- func (m *RequestUnion) GetEnqueueMessage() *EnqueueMessageRequest
- func (m *RequestUnion) GetEnqueueUpdate() *EnqueueUpdateRequest
- func (m *RequestUnion) GetGet() *GetRequest
- func (m *RequestUnion) GetIncrement() *IncrementRequest
- func (m *RequestUnion) GetPut() *PutRequest
- func (m *RequestUnion) GetReapQueue() *ReapQueueRequest
- func (m *RequestUnion) GetScan() *ScanRequest
- func (this *RequestUnion) GetValue() interface{}
- func (*RequestUnion) ProtoMessage()
- func (m *RequestUnion) Reset()
- func (this *RequestUnion) SetValue(value interface{}) bool
- func (m *RequestUnion) String() string
- type Response
- type ResponseHeader
- func (rh *ResponseHeader) Combine(otherRH *ResponseHeader)
- func (m *ResponseHeader) GetError() *Error
- func (m *ResponseHeader) GetTimestamp() Timestamp
- func (m *ResponseHeader) GetTxn() *Transaction
- func (rh *ResponseHeader) GoError() error
- func (rh *ResponseHeader) Header() *ResponseHeader
- func (*ResponseHeader) ProtoMessage()
- func (m *ResponseHeader) Reset()
- func (rh *ResponseHeader) SetGoError(err error)
- func (m *ResponseHeader) String() string
- func (rh *ResponseHeader) Verify(req Request) error
- type ResponseUnion
- func (m *ResponseUnion) GetConditionalPut() *ConditionalPutResponse
- func (m *ResponseUnion) GetContains() *ContainsResponse
- func (m *ResponseUnion) GetDelete() *DeleteResponse
- func (m *ResponseUnion) GetDeleteRange() *DeleteRangeResponse
- func (m *ResponseUnion) GetEndTransaction() *EndTransactionResponse
- func (m *ResponseUnion) GetEnqueueMessage() *EnqueueMessageResponse
- func (m *ResponseUnion) GetEnqueueUpdate() *EnqueueUpdateResponse
- func (m *ResponseUnion) GetGet() *GetResponse
- func (m *ResponseUnion) GetIncrement() *IncrementResponse
- func (m *ResponseUnion) GetPut() *PutResponse
- func (m *ResponseUnion) GetReapQueue() *ReapQueueResponse
- func (m *ResponseUnion) GetScan() *ScanResponse
- func (this *ResponseUnion) GetValue() interface{}
- func (*ResponseUnion) ProtoMessage()
- func (m *ResponseUnion) Reset()
- func (this *ResponseUnion) SetValue(value interface{}) bool
- func (m *ResponseUnion) String() string
- type ScanRequest
- type ScanResponse
- type SplitTrigger
- type StoreID
- type StoreIdent
- type TimeSeriesData
- func (m *TimeSeriesData) GetDatapoints() []*TimeSeriesDatapoint
- func (m *TimeSeriesData) GetName() string
- func (*TimeSeriesData) ProtoMessage()
- func (m *TimeSeriesData) Reset()
- func (m *TimeSeriesData) String() string
- func (ts TimeSeriesData) ToInternal(keyDuration int64, sampleDuration int64) ([]*InternalTimeSeriesData, error)
- func (m *TimeSeriesData) Unmarshal(data []byte) error
- type TimeSeriesDatapoint
- func (m *TimeSeriesDatapoint) GetFloatValue() float32
- func (m *TimeSeriesDatapoint) GetIntValue() int64
- func (m *TimeSeriesDatapoint) GetTimestampNanos() int64
- func (*TimeSeriesDatapoint) ProtoMessage()
- func (m *TimeSeriesDatapoint) Reset()
- func (m *TimeSeriesDatapoint) String() string
- func (m *TimeSeriesDatapoint) Unmarshal(data []byte) error
- type Timestamp
- func (t Timestamp) Add(wallTime int64, logical int32) Timestamp
- func (t *Timestamp) Backward(s Timestamp)
- func (t Timestamp) Equal(s Timestamp) bool
- func (t *Timestamp) Forward(s Timestamp)
- func (m *Timestamp) GetLogical() int32
- func (m *Timestamp) GetWallTime() int64
- func (t Timestamp) Less(s Timestamp) bool
- func (*Timestamp) ProtoMessage()
- func (m *Timestamp) Reset()
- func (t Timestamp) String() string
- func (m *Timestamp) Unmarshal(data []byte) error
- type Transaction
- func (m *Transaction) GetCertainNodes() NodeList
- func (m *Transaction) GetEpoch() int32
- func (m *Transaction) GetID() []byte
- func (m *Transaction) GetIsolation() IsolationType
- func (m *Transaction) GetLastHeartbeat() *Timestamp
- func (m *Transaction) GetMaxTimestamp() Timestamp
- func (m *Transaction) GetName() string
- func (m *Transaction) GetOrigTimestamp() Timestamp
- func (m *Transaction) GetPriority() int32
- func (m *Transaction) GetStatus() TransactionStatus
- func (m *Transaction) GetTimestamp() Timestamp
- func (t *Transaction) MD5() [md5.Size]byte
- func (*Transaction) ProtoMessage()
- func (m *Transaction) Reset()
- func (t *Transaction) Restart(userPriority, upgradePriority int32, timestamp Timestamp)
- func (t Transaction) String() string
- func (m *Transaction) Unmarshal(data []byte) error
- func (t *Transaction) Update(o *Transaction)
- func (t *Transaction) UpgradePriority(minPriority int32)
- type TransactionAbortedError
- type TransactionPushError
- type TransactionRetryError
- type TransactionStatus
- type TransactionStatusError
- type Value
- func (m *Value) GetBytes() []byte
- func (m *Value) GetChecksum() uint32
- func (m *Value) GetInteger() int64
- func (m *Value) GetTag() string
- func (m *Value) GetTimestamp() *Timestamp
- func (v *Value) InitChecksum(key []byte)
- func (*Value) ProtoMessage()
- func (m *Value) Reset()
- func (m *Value) String() string
- func (m *Value) Unmarshal(data []byte) error
- func (v *Value) Verify(key []byte) error
- type WriteIntentError
- type WriteTooOldError
- type ZoneConfig
Constants ¶
const ( // Contains determines whether the KV map contains the specified key. Contains = "Contains" // Get fetches the value for a key from the KV map, respecting a // possibly historical timestamp. If the timestamp is 0, returns // the most recent value. Get = "Get" // Put sets the value for a key at the specified timestamp. If the // timestamp is 0, the value is set with the current time as timestamp. Put = "Put" // ConditionalPut sets the value for a key if the existing value // matches the value specified in the request. Specifying a null value // for existing means the value must not yet exist. ConditionalPut = "ConditionalPut" // Increment increments the value at the specified key. Once called // for a key, Put & Get will return errors; only Increment will // continue to be a valid command. The value must be deleted before // it can be reset using Put. Increment = "Increment" // Delete removes the value for the specified key. Delete = "Delete" // DeleteRange removes all values for keys which fall between // args.RequestHeader.Key and args.RequestHeader.EndKey, with // the latter endpoint excluded. DeleteRange = "DeleteRange" // Scan fetches the values for all keys which fall between // args.RequestHeader.Key and args.RequestHeader.EndKey, with // the latter endpoint excluded. Scan = "Scan" // EndTransaction either commits or aborts an ongoing transaction. EndTransaction = "EndTransaction" // ReapQueue scans and deletes messages from a recipient message // queue. ReapQueueRequest invocations must be part of an extant // transaction or they fail. Returns the reaped queue messsages, up to // the requested maximum. If fewer than the maximum were returned, // then the queue is empty. ReapQueue = "ReapQueue" // EnqueueUpdate enqueues an update for eventual execution. EnqueueUpdate = "EnqueueUpdate" // EnqueueMessage enqueues a message for delivery to an inbox. EnqueueMessage = "EnqueueMessage" // Batch executes a set of commands in parallel. Batch = "Batch" // AdminSplit is called to coordinate a split of a range. AdminSplit = "AdminSplit" // AdminMerge is called to coordinate a merge of two adjacent ranges. AdminMerge = "AdminMerge" )
TODO(spencer): change these string constants into a type.
const ( // KeyMaxLength is the maximum length of a Key in bytes. KeyMaxLength = 4096 // MaxPriority is the maximum allowed priority. MaxPriority = math.MaxInt32 )
const ( // InternalRangeLookup looks up range descriptors, containing the // locations of replicas for the range containing the specified key. InternalRangeLookup = "InternalRangeLookup" // InternalHeartbeatTxn sends a periodic heartbeat to extant // transaction rows to indicate the client is still alive and // the transaction should not be considered abandoned. InternalHeartbeatTxn = "InternalHeartbeatTxn" // InternalGC garbage collects values based on expired timestamps // for a list of keys in a range. This method is called by the // range leader after a snapshot scan. The call goes through Raft, // so all range replicas GC the exact same values. InternalGC = "InternalGC" // InternalPushTxn attempts to resolve read or write conflicts between // transactions. Both the pusher (args.Txn) and the pushee // (args.PushTxn) are supplied. However, args.Key should be set to the // transaction ID of the pushee, as it must be directed to the range // containing the pushee's transaction record in order to consult the // most up to date txn state. If the conflict resolution can be // resolved in favor of the pusher, returns success; otherwise returns // an error code either indicating the pusher must retry or abort and // restart the transaction. InternalPushTxn = "InternalPushTxn" // InternalResolveIntent resolves existing write intents for a key or // key range. InternalResolveIntent = "InternalResolveIntent" // InternalMerge merges a given value into the specified key. Merge is a // high-performance operation provided by underlying data storage for values // which are accumulated over several writes. Because it is not // transactional, Merge is currently not made available to external clients. // // The logic used to merge values of different types is described in more // detail by the "Merge" method of engine.Engine. InternalMerge = "InternalMerge" // InternalTruncateLog discards a prefix of the raft log. InternalTruncateLog = "InternalTruncateLog" )
const Default_RequestHeader_UserPriority int32 = 1
Variables ¶
var ( // KeyMin is a minimum key value which sorts before all other keys. KeyMin = Key("") // KeyMax is a maximum key value which sorts after all other keys. KeyMax = Key(encoding.Infinity) )
var ( // MaxTimestamp is the max value allowed for Timestamp. MaxTimestamp = Timestamp{WallTime: math.MaxInt64, Logical: math.MaxInt32} // MinTimestamp is the min value allowed for Timestamp. MinTimestamp = Timestamp{WallTime: 0, Logical: 1} // ZeroTimestamp is an empty timestamp. ZeroTimestamp = Timestamp{WallTime: 0, Logical: 0} // NoTxnMD5 is a zero-filled md5 byte array, used to indicate a nil transaction. NoTxnMD5 = [md5.Size]byte{} )
Timestamp constant values.
var AllMethods = stringSet{ Contains: {}, Get: {}, Put: {}, ConditionalPut: {}, Increment: {}, Delete: {}, DeleteRange: {}, Scan: {}, EndTransaction: {}, ReapQueue: {}, EnqueueUpdate: {}, EnqueueMessage: {}, AdminSplit: {}, AdminMerge: {}, Batch: {}, InternalHeartbeatTxn: {}, InternalGC: {}, InternalPushTxn: {}, InternalResolveIntent: {}, InternalMerge: {}, InternalTruncateLog: {}, }
AllMethods specifies the complete set of methods.
var InfiniteOffset = RemoteOffset{ Offset: math.MaxInt64, Error: 0, }
InfiniteOffset is the offset value used if we fail to detect a heartbeat.
var InternalMethods = stringSet{
InternalHeartbeatTxn: {},
InternalGC: {},
InternalPushTxn: {},
InternalResolveIntent: {},
InternalMerge: {},
InternalTruncateLog: {},
}
InternalMethods specifies the set of methods accessible only via the internal node RPC API.
var InternalValueType_name = map[int32]string{
1: "_CR_TS",
}
var InternalValueType_value = map[string]int32{
"_CR_TS": 1,
}
var IsolationType_name = map[int32]string{
0: "SERIALIZABLE",
1: "SNAPSHOT",
}
var IsolationType_value = map[string]int32{
"SERIALIZABLE": 0,
"SNAPSHOT": 1,
}
var PublicMethods = stringSet{ Contains: {}, Get: {}, Put: {}, ConditionalPut: {}, Increment: {}, Delete: {}, DeleteRange: {}, Scan: {}, EndTransaction: {}, ReapQueue: {}, EnqueueUpdate: {}, EnqueueMessage: {}, Batch: {}, AdminSplit: {}, }
PublicMethods specifies the set of methods accessible via the public key-value API.
var ReadMethods = stringSet{ Contains: {}, Get: {}, ConditionalPut: {}, Increment: {}, Scan: {}, ReapQueue: {}, InternalRangeLookup: {}, }
ReadMethods specifies the set of methods which read and return data.
var ReplicaChangeType_name = map[int32]string{
0: "ADD_REPLICA",
1: "REMOVE_REPLICA",
}
var ReplicaChangeType_value = map[string]int32{
"ADD_REPLICA": 0,
"REMOVE_REPLICA": 1,
}
var TransactionStatus_name = map[int32]string{
0: "PENDING",
1: "COMMITTED",
2: "ABORTED",
}
var TransactionStatus_value = map[string]int32{
"PENDING": 0,
"COMMITTED": 1,
"ABORTED": 2,
}
var TxnMethods = stringSet{ Put: {}, ConditionalPut: {}, Increment: {}, Delete: {}, DeleteRange: {}, ReapQueue: {}, EnqueueUpdate: {}, EnqueueMessage: {}, }
TxnMethods specifies the set of methods which leave key intents during transactions.
var WriteMethods = stringSet{ Put: {}, ConditionalPut: {}, Increment: {}, Delete: {}, DeleteRange: {}, EndTransaction: {}, ReapQueue: {}, EnqueueUpdate: {}, EnqueueMessage: {}, Batch: {}, InternalHeartbeatTxn: {}, InternalGC: {}, InternalPushTxn: {}, InternalResolveIntent: {}, InternalMerge: {}, InternalTruncateLog: {}, }
WriteMethods specifies the set of methods which write data.
Functions ¶
func CreateArgsAndReply ¶
CreateArgsAndReply returns allocated request and response pairs according to the specified method.
func IsInternal ¶
IsInternal returns true if the specified method is only available via the internal node RPC API.
func IsReadOnly ¶
IsReadOnly returns true if the specified method only requires read permissions.
func IsReadWrite ¶
IsReadWrite returns true if the specified method requires write permissions.
func IsTransactional ¶
IsTransactional returns true if the specified method can be part of a transaction.
func MakePriority ¶
MakePriority generates a random priority value, biased by the specified userPriority. If userPriority=100, the resulting priority is 100x more likely to be probabilistically greater than a similar invocation with userPriority=1.
func MethodForRequest ¶
MethodForRequest returns the method name corresponding to the type of the request.
func NeedAdminPerm ¶
NeedAdminPerm returns true if the specified method requires admin permissions.
func NeedReadPerm ¶
NeedReadPerm returns true if the specified method requires read permissions.
func NeedWritePerm ¶
NeedWritePerm returns true if the specified method requires write permissions.
Types ¶
type AcctConfig ¶
type AcctConfig struct { ClusterId string `protobuf:"bytes,1,opt,name=cluster_id" json:"cluster_id" yaml:"cluster_id,omitempty"` XXX_unrecognized []byte `json:"-"` }
AcctConfig holds accounting configuration.
func (*AcctConfig) GetClusterId ¶
func (m *AcctConfig) GetClusterId() string
func (*AcctConfig) ProtoMessage ¶
func (*AcctConfig) ProtoMessage()
func (*AcctConfig) Reset ¶
func (m *AcctConfig) Reset()
func (*AcctConfig) String ¶
func (m *AcctConfig) String() string
type Addr ¶
type Addr struct { Network string `protobuf:"bytes,1,opt,name=network" json:"network"` Address string `protobuf:"bytes,2,opt,name=address" json:"address"` XXX_unrecognized []byte `json:"-"` }
func FromNetAddr ¶
FromNetAddr returns an Addr object based on the supplied net.Addr.
func (*Addr) GetAddress ¶
func (*Addr) GetNetwork ¶
func (*Addr) ProtoMessage ¶
func (*Addr) ProtoMessage()
type AdminMergeRequest ¶
type AdminMergeRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` SubsumedRange RangeDescriptor `protobuf:"bytes,2,opt,name=subsumed_range" json:"subsumed_range"` XXX_unrecognized []byte `json:"-"` }
An AdminMergeRequest is arguments to the AdminMerge() method. A merge is always performed by calling AdminMerge on the range that is subsuming the passed in subsumed_range. The ranges must be consecutive in the key space, such that the end_key of the subsuming range must match the start_key of the range being subsumed. After the merge operation, the subsumed_range will no longer exist and the subsuming range will now encompass all keys from its original start_key to the end_key of the subsumed_range.
func (*AdminMergeRequest) GetSubsumedRange ¶
func (m *AdminMergeRequest) GetSubsumedRange() RangeDescriptor
func (*AdminMergeRequest) ProtoMessage ¶
func (*AdminMergeRequest) ProtoMessage()
func (*AdminMergeRequest) Reset ¶
func (m *AdminMergeRequest) Reset()
func (*AdminMergeRequest) String ¶
func (m *AdminMergeRequest) String() string
type AdminMergeResponse ¶
type AdminMergeResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
An AdminMergeResponse is the return value from the AdminMerge() method.
func (*AdminMergeResponse) ProtoMessage ¶
func (*AdminMergeResponse) ProtoMessage()
func (*AdminMergeResponse) Reset ¶
func (m *AdminMergeResponse) Reset()
func (*AdminMergeResponse) String ¶
func (m *AdminMergeResponse) String() string
type AdminSplitRequest ¶
type AdminSplitRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` SplitKey Key `protobuf:"bytes,2,opt,name=split_key,customtype=Key" json:"split_key"` XXX_unrecognized []byte `json:"-"` }
An AdminSplitRequest is arguments to the AdminSplit() method. The existing range which contains RequestHeader.Key is split by split_key. If split_key is not specified, then this method will determine a split key that is roughly halfway through the range. The existing range is resized to cover only its start key to the split key. The new range created by the split starts at the split key and extends to the original range's end key. If split_key is known, header.key should also be set to split_key.
New range IDs for each of the split range's replica and a new Raft ID are generated by the operation. Split requests are done in the context of a distributed transaction which updates range addressing records, range metadata and finally, provides a commit trigger to update bookkeeping and instantiate the new range on commit.
The new range contains range replicas located on the same stores; no range data is moved during this operation. The split can be thought of as a mostly logical operation, though some other metadata (e.g. response cache and range stats must be copied or recomputed).
func (*AdminSplitRequest) ProtoMessage ¶
func (*AdminSplitRequest) ProtoMessage()
func (*AdminSplitRequest) Reset ¶
func (m *AdminSplitRequest) Reset()
func (*AdminSplitRequest) String ¶
func (m *AdminSplitRequest) String() string
type AdminSplitResponse ¶
type AdminSplitResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
An AdminSplitResponse is the return value from the AdminSplit() method.
func (*AdminSplitResponse) ProtoMessage ¶
func (*AdminSplitResponse) ProtoMessage()
func (*AdminSplitResponse) Reset ¶
func (m *AdminSplitResponse) Reset()
func (*AdminSplitResponse) String ¶
func (m *AdminSplitResponse) String() string
type Attributes ¶
type Attributes struct { Attrs []string `protobuf:"bytes,1,rep,name=attrs" json:"attrs" yaml:"attrs,flow"` XXX_unrecognized []byte `json:"-"` }
Attributes specifies a list of arbitrary strings describing node topology, store type, and machine capabilities.
func (*Attributes) GetAttrs ¶
func (m *Attributes) GetAttrs() []string
func (Attributes) IsSubset ¶
func (a Attributes) IsSubset(b Attributes) bool
IsSubset returns whether attributes list a is a subset of attributes list b.
func (*Attributes) ProtoMessage ¶
func (*Attributes) ProtoMessage()
func (*Attributes) Reset ¶
func (m *Attributes) Reset()
func (Attributes) SortedString ¶
func (a Attributes) SortedString() string
SortedString returns a sorted, de-duplicated, comma-separated list of the attributes.
func (*Attributes) String ¶
func (m *Attributes) String() string
type BatchRequest ¶
type BatchRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` Requests []RequestUnion `protobuf:"bytes,2,rep,name=requests" json:"requests"` XXX_unrecognized []byte `json:"-"` }
A BatchRequest contains one or more requests to be executed in parallel, or if applicable (based on write-only commands and range-locality), as a single update.
func (*BatchRequest) Add ¶
func (br *BatchRequest) Add(args Request)
Add adds a request to the batch request. The batch inherits the key range of the first request added to it.
TODO(spencer): batches should include a list of key ranges
representing the constituent requests.
func (*BatchRequest) GetRequests ¶
func (m *BatchRequest) GetRequests() []RequestUnion
func (*BatchRequest) ProtoMessage ¶
func (*BatchRequest) ProtoMessage()
func (*BatchRequest) Reset ¶
func (m *BatchRequest) Reset()
func (*BatchRequest) String ¶
func (m *BatchRequest) String() string
type BatchResponse ¶
type BatchResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` Responses []ResponseUnion `protobuf:"bytes,2,rep,name=responses" json:"responses"` XXX_unrecognized []byte `json:"-"` }
A BatchResponse contains one or more responses, one per request corresponding to the requests in the matching BatchRequest. The error in the response header is set to the first error from the slice of responses, if applicable.
func (*BatchResponse) Add ¶
func (br *BatchResponse) Add(reply Response)
Add adds a response to the batch response.
func (*BatchResponse) GetResponses ¶
func (m *BatchResponse) GetResponses() []ResponseUnion
func (*BatchResponse) ProtoMessage ¶
func (*BatchResponse) ProtoMessage()
func (*BatchResponse) Reset ¶
func (m *BatchResponse) Reset()
func (*BatchResponse) String ¶
func (m *BatchResponse) String() string
type ChangeReplicasTrigger ¶
type ChangeReplicasTrigger struct { NodeID NodeID `protobuf:"varint,1,opt,name=node_id,customtype=NodeID" json:"node_id"` StoreID StoreID `protobuf:"varint,2,opt,name=store_id,customtype=StoreID" json:"store_id"` ChangeType ReplicaChangeType `protobuf:"varint,3,opt,name=change_type,enum=cockroach.proto.ReplicaChangeType" json:"change_type"` // The new replica list with this change applied. UpdatedReplicas []Replica `protobuf:"bytes,4,rep,name=updated_replicas" json:"updated_replicas"` XXX_unrecognized []byte `json:"-"` }
func (*ChangeReplicasTrigger) GetChangeType ¶
func (m *ChangeReplicasTrigger) GetChangeType() ReplicaChangeType
func (*ChangeReplicasTrigger) GetUpdatedReplicas ¶
func (m *ChangeReplicasTrigger) GetUpdatedReplicas() []Replica
func (*ChangeReplicasTrigger) ProtoMessage ¶
func (*ChangeReplicasTrigger) ProtoMessage()
func (*ChangeReplicasTrigger) Reset ¶
func (m *ChangeReplicasTrigger) Reset()
func (*ChangeReplicasTrigger) String ¶
func (m *ChangeReplicasTrigger) String() string
type ClientCmdID ¶
type ClientCmdID struct { // Nanoseconds since Unix epoch. WallTime int64 `protobuf:"varint,1,opt,name=wall_time" json:"wall_time"` Random int64 `protobuf:"varint,2,opt,name=random" json:"random"` XXX_unrecognized []byte `json:"-"` }
ClientCmdID provides a unique ID for client commands. Clients which provide ClientCmdID gain operation idempotence. In other words, clients can submit the same command multiple times and always receive the same response. This is common on retries over flaky networks. However, the system imposes a limit on how long idempotence is provided. Retries over an hour old are not guaranteed idempotence and may be executed more than once with potentially different results.
ClientCmdID contains the client's timestamp and a client-generated random number. The client Timestamp is specified in unix nanoseconds and is used for some uniqueness but also to provide a rough ordering of requests, useful for data locality on the server. The Random is specified for additional uniqueness. NOTE: An accurate time signal IS NOT required for correctness.
func (*ClientCmdID) GetRandom ¶
func (m *ClientCmdID) GetRandom() int64
func (*ClientCmdID) GetWallTime ¶
func (m *ClientCmdID) GetWallTime() int64
func (ClientCmdID) IsEmpty ¶
func (ccid ClientCmdID) IsEmpty() bool
IsEmpty returns true if the client command ID has zero values.
func (*ClientCmdID) ProtoMessage ¶
func (*ClientCmdID) ProtoMessage()
func (*ClientCmdID) Reset ¶
func (m *ClientCmdID) Reset()
func (*ClientCmdID) String ¶
func (m *ClientCmdID) String() string
type Combinable ¶
type Combinable interface {
Combine(Response)
}
Combinable is implemented by response types whose corresponding requests may cross range boundaries, such as Scan or DeleteRange. Combine() allows responses from individual ranges to be aggregated into a single one. It is not expected that Combine() perform any error checking; this should be done by the caller instead.
type ConditionFailedError ¶
type ConditionFailedError struct { ActualValue *Value `protobuf:"bytes,1,opt,name=actual_value" json:"actual_value,omitempty"` XXX_unrecognized []byte `json:"-"` }
A ConditionFailedError indicates that the expected value of a ConditionalPutRequest was not found, either because it was missing or was not equal. The error will contain the actual value found.
func (*ConditionFailedError) Error ¶
func (e *ConditionFailedError) Error() string
Error formats error.
func (*ConditionFailedError) GetActualValue ¶
func (m *ConditionFailedError) GetActualValue() *Value
func (*ConditionFailedError) ProtoMessage ¶
func (*ConditionFailedError) ProtoMessage()
func (*ConditionFailedError) Reset ¶
func (m *ConditionFailedError) Reset()
func (*ConditionFailedError) String ¶
func (m *ConditionFailedError) String() string
type ConditionalPutRequest ¶
type ConditionalPutRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` // The value to put. Value Value `protobuf:"bytes,2,opt,name=value" json:"value"` // ExpValue.Bytes empty to test for non-existence. Specify as nil // to indicate there should be no existing entry. This is different // from the expectation that the value exists but is empty. ExpValue *Value `protobuf:"bytes,3,opt,name=exp_value" json:"exp_value,omitempty"` XXX_unrecognized []byte `json:"-"` }
A ConditionalPutRequest is arguments to the ConditionalPut() method.
- Returns true and sets value if ExpValue equals existing value. - If key doesn't exist and ExpValue is nil, sets value. - If key exists, but value is empty and ExpValue is not nil but empty, sets value. - Otherwise, returns error and the actual value of the key in the response.
func (*ConditionalPutRequest) GetExpValue ¶
func (m *ConditionalPutRequest) GetExpValue() *Value
func (*ConditionalPutRequest) GetValue ¶
func (m *ConditionalPutRequest) GetValue() Value
func (*ConditionalPutRequest) ProtoMessage ¶
func (*ConditionalPutRequest) ProtoMessage()
func (*ConditionalPutRequest) Reset ¶
func (m *ConditionalPutRequest) Reset()
func (*ConditionalPutRequest) String ¶
func (m *ConditionalPutRequest) String() string
type ConditionalPutResponse ¶
type ConditionalPutResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
A ConditionalPutResponse is the return value from the ConditionalPut() method.
func (*ConditionalPutResponse) ProtoMessage ¶
func (*ConditionalPutResponse) ProtoMessage()
func (*ConditionalPutResponse) Reset ¶
func (m *ConditionalPutResponse) Reset()
func (*ConditionalPutResponse) String ¶
func (m *ConditionalPutResponse) String() string
type ContainsRequest ¶
type ContainsRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
A ContainsRequest is arguments to the Contains() method.
func (*ContainsRequest) ProtoMessage ¶
func (*ContainsRequest) ProtoMessage()
func (*ContainsRequest) Reset ¶
func (m *ContainsRequest) Reset()
func (*ContainsRequest) String ¶
func (m *ContainsRequest) String() string
type ContainsResponse ¶
type ContainsResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` Exists bool `protobuf:"varint,2,opt,name=exists" json:"exists"` XXX_unrecognized []byte `json:"-"` }
A ContainsResponse is the return value of the Contains() method.
func (*ContainsResponse) GetExists ¶
func (m *ContainsResponse) GetExists() bool
func (*ContainsResponse) ProtoMessage ¶
func (*ContainsResponse) ProtoMessage()
func (*ContainsResponse) Reset ¶
func (m *ContainsResponse) Reset()
func (*ContainsResponse) String ¶
func (m *ContainsResponse) String() string
type DeleteRangeRequest ¶
type DeleteRangeRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` // If 0, *all* entries between Key (inclusive) and EndKey // (exclusive) are deleted. Must be >= 0 MaxEntriesToDelete int64 `protobuf:"varint,2,opt,name=max_entries_to_delete" json:"max_entries_to_delete"` XXX_unrecognized []byte `json:"-"` }
A DeleteRangeRequest is arguments to the DeleteRange method. It specifies the range of keys to delete.
func DeleteRangeArgs ¶
func DeleteRangeArgs(startKey, endKey Key) *DeleteRangeRequest
DeleteRangeArgs returns a DeleteRangeRequest object initialized to delete the values in the given key range (excluding the endpoint).
func (*DeleteRangeRequest) GetMaxEntriesToDelete ¶
func (m *DeleteRangeRequest) GetMaxEntriesToDelete() int64
func (*DeleteRangeRequest) ProtoMessage ¶
func (*DeleteRangeRequest) ProtoMessage()
func (*DeleteRangeRequest) Reset ¶
func (m *DeleteRangeRequest) Reset()
func (*DeleteRangeRequest) String ¶
func (m *DeleteRangeRequest) String() string
type DeleteRangeResponse ¶
type DeleteRangeResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` // Number of entries removed. NumDeleted int64 `protobuf:"varint,2,opt,name=num_deleted" json:"num_deleted"` XXX_unrecognized []byte `json:"-"` }
A DeleteRangeResponse is the return value from the DeleteRange() method.
func (*DeleteRangeResponse) Combine ¶
func (dr *DeleteRangeResponse) Combine(c Response)
Combine implements the Combinable interface for DeleteRangeResponse.
func (*DeleteRangeResponse) GetNumDeleted ¶
func (m *DeleteRangeResponse) GetNumDeleted() int64
func (*DeleteRangeResponse) ProtoMessage ¶
func (*DeleteRangeResponse) ProtoMessage()
func (*DeleteRangeResponse) Reset ¶
func (m *DeleteRangeResponse) Reset()
func (*DeleteRangeResponse) String ¶
func (m *DeleteRangeResponse) String() string
type DeleteRequest ¶
type DeleteRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
A DeleteRequest is arguments to the Delete() method.
func DeleteArgs ¶
func DeleteArgs(key Key) *DeleteRequest
DeleteArgs returns a DeleteRequest object initialized to delete the value at key.
func (*DeleteRequest) ProtoMessage ¶
func (*DeleteRequest) ProtoMessage()
func (*DeleteRequest) Reset ¶
func (m *DeleteRequest) Reset()
func (*DeleteRequest) String ¶
func (m *DeleteRequest) String() string
type DeleteResponse ¶
type DeleteResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
A DeleteResponse is the return value from the Delete() method.
func (*DeleteResponse) ProtoMessage ¶
func (*DeleteResponse) ProtoMessage()
func (*DeleteResponse) Reset ¶
func (m *DeleteResponse) Reset()
func (*DeleteResponse) String ¶
func (m *DeleteResponse) String() string
type EncodedKey ¶
type EncodedKey []byte
EncodedKey is an encoded key, distinguished from Key in that it is an encoded version.
func (EncodedKey) Equal ¶
func (k EncodedKey) Equal(l EncodedKey) bool
Equal returns whether two keys are identical.
func (EncodedKey) Less ¶
func (k EncodedKey) Less(l EncodedKey) bool
Less implements the util.Ordered interface.
func (EncodedKey) Marshal ¶
func (k EncodedKey) Marshal() ([]byte, error)
Marshal implements the gogoproto Marshaler interface.
func (EncodedKey) Next ¶
func (k EncodedKey) Next() EncodedKey
Next returns the next key in lexicographic sort order.
func (EncodedKey) PrefixEnd ¶
func (k EncodedKey) PrefixEnd() EncodedKey
PrefixEnd determines the key directly after the last key which has this key as a prefix. See comments for Key.
func (*EncodedKey) Unmarshal ¶
func (k *EncodedKey) Unmarshal(bytes []byte) error
Unmarshal implements the gogoproto Unmarshaler interface.
func (*EncodedKey) UnmarshalJSON ¶
func (k *EncodedKey) UnmarshalJSON(bytes []byte) error
UnmarshalJSON implements the json Unmarshaler interface.
type EndTransactionRequest ¶
type EndTransactionRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` // False to abort and rollback. Commit bool `protobuf:"varint,2,opt,name=commit" json:"commit"` // Optional commit triggers. Note that commit triggers are for // internal use only and will be ignored if requested through the // public-facing KV API. InternalCommitTrigger *InternalCommitTrigger `protobuf:"bytes,3,opt,name=internal_commit_trigger" json:"internal_commit_trigger,omitempty"` XXX_unrecognized []byte `json:"-"` }
An EndTransactionRequest is arguments to the EndTransaction() method. It specifies whether to commit or roll back an extant transaction.
func (*EndTransactionRequest) GetCommit ¶
func (m *EndTransactionRequest) GetCommit() bool
func (*EndTransactionRequest) GetInternalCommitTrigger ¶
func (m *EndTransactionRequest) GetInternalCommitTrigger() *InternalCommitTrigger
func (*EndTransactionRequest) ProtoMessage ¶
func (*EndTransactionRequest) ProtoMessage()
func (*EndTransactionRequest) Reset ¶
func (m *EndTransactionRequest) Reset()
func (*EndTransactionRequest) String ¶
func (m *EndTransactionRequest) String() string
type EndTransactionResponse ¶
type EndTransactionResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` // Remaining time (ns). CommitWait int64 `protobuf:"varint,2,opt,name=commit_wait" json:"commit_wait"` XXX_unrecognized []byte `json:"-"` }
An EndTransactionResponse is the return value from the EndTransaction() method. The final transaction record is returned as part of the response header. In particular, transaction status and timestamp will be updated to reflect final committed values. Clients may propagate the transaction timestamp as the final txn commit timestamp in order to preserve causal ordering between subsequent transactions. CommitWait specifies the commit wait, which is the remaining time the client MUST wait before signalling completion of the transaction to another distributed node to maintain consistency.
func (*EndTransactionResponse) GetCommitWait ¶
func (m *EndTransactionResponse) GetCommitWait() int64
func (*EndTransactionResponse) ProtoMessage ¶
func (*EndTransactionResponse) ProtoMessage()
func (*EndTransactionResponse) Reset ¶
func (m *EndTransactionResponse) Reset()
func (*EndTransactionResponse) String ¶
func (m *EndTransactionResponse) String() string
type EnqueueMessageRequest ¶
type EnqueueMessageRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` // Message value to delivery to inbox. Msg Value `protobuf:"bytes,2,opt,name=msg" json:"msg"` XXX_unrecognized []byte `json:"-"` }
An EnqueueMessageRequest is arguments to the EnqueueMessage() method. It specifies the recipient inbox key and the message (an arbitrary byte slice value).
func (*EnqueueMessageRequest) GetMsg ¶
func (m *EnqueueMessageRequest) GetMsg() Value
func (*EnqueueMessageRequest) ProtoMessage ¶
func (*EnqueueMessageRequest) ProtoMessage()
func (*EnqueueMessageRequest) Reset ¶
func (m *EnqueueMessageRequest) Reset()
func (*EnqueueMessageRequest) String ¶
func (m *EnqueueMessageRequest) String() string
type EnqueueMessageResponse ¶
type EnqueueMessageResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
An EnqueueMessageResponse is the return value from the EnqueueMessage() method.
func (*EnqueueMessageResponse) ProtoMessage ¶
func (*EnqueueMessageResponse) ProtoMessage()
func (*EnqueueMessageResponse) Reset ¶
func (m *EnqueueMessageResponse) Reset()
func (*EnqueueMessageResponse) String ¶
func (m *EnqueueMessageResponse) String() string
type EnqueueUpdateRequest ¶
type EnqueueUpdateRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
An EnqueueUpdateRequest is arguments to the EnqueueUpdate() method. It specifies the update to enqueue for asynchronous execution. Update is an instance of one of the following messages: PutRequest, IncrementRequest, DeleteRequest, DeleteRangeRequest, or AccountingRequest.
func (*EnqueueUpdateRequest) ProtoMessage ¶
func (*EnqueueUpdateRequest) ProtoMessage()
func (*EnqueueUpdateRequest) Reset ¶
func (m *EnqueueUpdateRequest) Reset()
func (*EnqueueUpdateRequest) String ¶
func (m *EnqueueUpdateRequest) String() string
type EnqueueUpdateResponse ¶
type EnqueueUpdateResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
An EnqueueUpdateResponse is the return value from the EnqueueUpdate() method.
func (*EnqueueUpdateResponse) ProtoMessage ¶
func (*EnqueueUpdateResponse) ProtoMessage()
func (*EnqueueUpdateResponse) Reset ¶
func (m *EnqueueUpdateResponse) Reset()
func (*EnqueueUpdateResponse) String ¶
func (m *EnqueueUpdateResponse) String() string
type Error ¶
type Error struct { Generic *GenericError `protobuf:"bytes,1,opt,name=generic" json:"generic,omitempty"` NotLeader *NotLeaderError `protobuf:"bytes,2,opt,name=not_leader" json:"not_leader,omitempty"` RangeNotFound *RangeNotFoundError `protobuf:"bytes,3,opt,name=range_not_found" json:"range_not_found,omitempty"` RangeKeyMismatch *RangeKeyMismatchError `protobuf:"bytes,4,opt,name=range_key_mismatch" json:"range_key_mismatch,omitempty"` ReadWithinUncertaintyInterval *ReadWithinUncertaintyIntervalError `protobuf:"bytes,5,opt,name=read_within_uncertainty_interval" json:"read_within_uncertainty_interval,omitempty"` TransactionAborted *TransactionAbortedError `protobuf:"bytes,6,opt,name=transaction_aborted" json:"transaction_aborted,omitempty"` TransactionPush *TransactionPushError `protobuf:"bytes,7,opt,name=transaction_push" json:"transaction_push,omitempty"` TransactionRetry *TransactionRetryError `protobuf:"bytes,8,opt,name=transaction_retry" json:"transaction_retry,omitempty"` TransactionStatus *TransactionStatusError `protobuf:"bytes,9,opt,name=transaction_status" json:"transaction_status,omitempty"` WriteIntent *WriteIntentError `protobuf:"bytes,10,opt,name=write_intent" json:"write_intent,omitempty"` WriteTooOld *WriteTooOldError `protobuf:"bytes,11,opt,name=write_too_old" json:"write_too_old,omitempty"` OpRequiresTxn *OpRequiresTxnError `protobuf:"bytes,12,opt,name=op_requires_txn" json:"op_requires_txn,omitempty"` ConditionFailed *ConditionFailedError `protobuf:"bytes,13,opt,name=condition_failed" json:"condition_failed,omitempty"` XXX_unrecognized []byte `json:"-"` }
Error is a union type containing all available errors.
func (*Error) GetConditionFailed ¶
func (m *Error) GetConditionFailed() *ConditionFailedError
func (*Error) GetGeneric ¶
func (m *Error) GetGeneric() *GenericError
func (*Error) GetNotLeader ¶
func (m *Error) GetNotLeader() *NotLeaderError
func (*Error) GetOpRequiresTxn ¶
func (m *Error) GetOpRequiresTxn() *OpRequiresTxnError
func (*Error) GetRangeKeyMismatch ¶
func (m *Error) GetRangeKeyMismatch() *RangeKeyMismatchError
func (*Error) GetRangeNotFound ¶
func (m *Error) GetRangeNotFound() *RangeNotFoundError
func (*Error) GetReadWithinUncertaintyInterval ¶
func (m *Error) GetReadWithinUncertaintyInterval() *ReadWithinUncertaintyIntervalError
func (*Error) GetTransactionAborted ¶
func (m *Error) GetTransactionAborted() *TransactionAbortedError
func (*Error) GetTransactionPush ¶
func (m *Error) GetTransactionPush() *TransactionPushError
func (*Error) GetTransactionRetry ¶
func (m *Error) GetTransactionRetry() *TransactionRetryError
func (*Error) GetTransactionStatus ¶
func (m *Error) GetTransactionStatus() *TransactionStatusError
func (*Error) GetWriteIntent ¶
func (m *Error) GetWriteIntent() *WriteIntentError
func (*Error) GetWriteTooOld ¶
func (m *Error) GetWriteTooOld() *WriteTooOldError
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
type GCMetadata ¶
type GCMetadata struct { // The last GC scan timestamp in nanoseconds since the Unix epoch. LastScanNanos int64 `protobuf:"varint,1,opt,name=last_scan_nanos" json:"last_scan_nanos"` // The oldest unresolved write intent in nanoseconds since epoch. // Null if there are no unresolved write intents. OldestIntentNanos *int64 `protobuf:"varint,2,opt,name=oldest_intent_nanos" json:"oldest_intent_nanos,omitempty"` XXX_unrecognized []byte `json:"-"` }
GCMetadata holds information about the last complete key/value garbage collection scan of a range.
func NewGCMetadata ¶
func NewGCMetadata(nowNanos int64) *GCMetadata
NewGCMetadata returns a GCMetadata initialized to have a ByteCounts slice with ten byte count values set to zero. Now is specified as nanoseconds since the Unix epoch.
func (*GCMetadata) GetLastScanNanos ¶
func (m *GCMetadata) GetLastScanNanos() int64
func (*GCMetadata) GetOldestIntentNanos ¶
func (m *GCMetadata) GetOldestIntentNanos() int64
func (*GCMetadata) ProtoMessage ¶
func (*GCMetadata) ProtoMessage()
func (*GCMetadata) Reset ¶
func (m *GCMetadata) Reset()
func (*GCMetadata) String ¶
func (m *GCMetadata) String() string
func (*GCMetadata) Unmarshal ¶
func (m *GCMetadata) Unmarshal(data []byte) error
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"` XXX_unrecognized []byte `json:"-"` }
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) GetTTLSeconds ¶
func (*GCPolicy) ProtoMessage ¶
func (*GCPolicy) ProtoMessage()
type GenericError ¶
type GenericError struct { Message string `protobuf:"bytes,1,opt,name=message" json:"message"` Retryable bool `protobuf:"varint,2,opt,name=retryable" json:"retryable"` XXX_unrecognized []byte `json:"-"` }
A GenericError is a generic representation of a go error including the string message and whether or not the error is retryable.
func (*GenericError) CanRetry ¶
func (ge *GenericError) CanRetry() bool
CanRetry implements the util/Retryable interface.
func (*GenericError) Error ¶
func (ge *GenericError) Error() string
Error implements the Go error interface.
func (*GenericError) GetMessage ¶
func (m *GenericError) GetMessage() string
func (*GenericError) GetRetryable ¶
func (m *GenericError) GetRetryable() bool
func (*GenericError) ProtoMessage ¶
func (*GenericError) ProtoMessage()
func (*GenericError) Reset ¶
func (m *GenericError) Reset()
func (*GenericError) String ¶
func (m *GenericError) String() string
type GetRequest ¶
type GetRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
A GetRequest is arguments to the Get() method.
func GetArgs ¶
func GetArgs(key Key) *GetRequest
GetArgs returns a GetRequest object initialized to get the value at key.
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) Reset ¶
func (m *GetRequest) Reset()
func (*GetRequest) String ¶
func (m *GetRequest) String() string
type GetResponse ¶
type GetResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` Value *Value `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` XXX_unrecognized []byte `json:"-"` }
A GetResponse is the return value from the Get() method. If the key doesn't exist, returns nil for Value.Bytes.
func (*GetResponse) GetValue ¶
func (m *GetResponse) GetValue() *Value
func (*GetResponse) ProtoMessage ¶
func (*GetResponse) ProtoMessage()
func (*GetResponse) Reset ¶
func (m *GetResponse) Reset()
func (*GetResponse) String ¶
func (m *GetResponse) String() string
func (*GetResponse) Verify ¶
func (gr *GetResponse) Verify(req Request) error
Verify verifies the integrity of the get response value.
type GossipRequest ¶
type GossipRequest struct { // Address of requesting node's server. Addr Addr `protobuf:"bytes,1,opt,name=addr" json:"addr"` // Local address of client on requesting node. LAddr Addr `protobuf:"bytes,2,opt,name=l_addr" json:"l_addr"` // Maximum sequence number of gossip from this peer. MaxSeq int64 `protobuf:"varint,3,opt,name=max_seq" json:"max_seq"` // Reciprocal delta of new info since last gossip. Delta []byte `protobuf:"bytes,4,opt,name=delta" json:"delta"` XXX_unrecognized []byte `json:"-"` }
GossipRequest is the request struct passed with the Gossip RPC.
func (*GossipRequest) GetAddr ¶
func (m *GossipRequest) GetAddr() Addr
func (*GossipRequest) GetDelta ¶
func (m *GossipRequest) GetDelta() []byte
func (*GossipRequest) GetLAddr ¶
func (m *GossipRequest) GetLAddr() Addr
func (*GossipRequest) GetMaxSeq ¶
func (m *GossipRequest) GetMaxSeq() int64
func (*GossipRequest) ProtoMessage ¶
func (*GossipRequest) ProtoMessage()
func (*GossipRequest) Reset ¶
func (m *GossipRequest) Reset()
func (*GossipRequest) String ¶
func (m *GossipRequest) String() string
type GossipResponse ¶
type GossipResponse struct { // Requested delta of server's infostore. Delta []byte `protobuf:"bytes,1,opt,name=delta" json:"delta"` // Non-nil means client should retry with this address. Alternate *Addr `protobuf:"bytes,2,opt,name=alternate" json:"alternate,omitempty"` XXX_unrecognized []byte `json:"-"` }
GossipResponse is returned from the Gossip.Gossip RPC. Delta will be nil in the event that Alternate is set.
func (*GossipResponse) GetAlternate ¶
func (m *GossipResponse) GetAlternate() *Addr
func (*GossipResponse) GetDelta ¶
func (m *GossipResponse) GetDelta() []byte
func (*GossipResponse) ProtoMessage ¶
func (*GossipResponse) ProtoMessage()
func (*GossipResponse) Reset ¶
func (m *GossipResponse) Reset()
func (*GossipResponse) String ¶
func (m *GossipResponse) String() string
type IncrementRequest ¶
type IncrementRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` Increment int64 `protobuf:"varint,2,opt,name=increment" json:"increment"` XXX_unrecognized []byte `json:"-"` }
An IncrementRequest is arguments to the Increment() method. It increments the value for key, and returns the new value. If no value exists for a key, incrementing by 0 is not a noop, but will create a zero value. IncrementRequest cannot be called on a key set by Put() or ConditionalPut(). Similarly, Get(), Put() and ConditionalPut() cannot be invoked on an incremented key.
func IncrementArgs ¶
func IncrementArgs(key Key, increment int64) *IncrementRequest
IncrementArgs returns an IncrementRequest object initialized to increment the value at key by increment.
func (*IncrementRequest) GetIncrement ¶
func (m *IncrementRequest) GetIncrement() int64
func (*IncrementRequest) ProtoMessage ¶
func (*IncrementRequest) ProtoMessage()
func (*IncrementRequest) Reset ¶
func (m *IncrementRequest) Reset()
func (*IncrementRequest) String ¶
func (m *IncrementRequest) String() string
type IncrementResponse ¶
type IncrementResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` NewValue int64 `protobuf:"varint,2,opt,name=new_value" json:"new_value"` XXX_unrecognized []byte `json:"-"` }
An IncrementResponse is the return value from the Increment method. The new value after increment is specified in NewValue. If the value could not be decoded as specified, Error will be set.
func (*IncrementResponse) GetNewValue ¶
func (m *IncrementResponse) GetNewValue() int64
func (*IncrementResponse) ProtoMessage ¶
func (*IncrementResponse) ProtoMessage()
func (*IncrementResponse) Reset ¶
func (m *IncrementResponse) Reset()
func (*IncrementResponse) String ¶
func (m *IncrementResponse) String() string
type Int32Slice ¶
type Int32Slice []int32
Int32Slice implements sort.Interface.
func (Int32Slice) Len ¶
func (s Int32Slice) Len() int
func (Int32Slice) Less ¶
func (s Int32Slice) Less(i, j int) bool
func (Int32Slice) Swap ¶
func (s Int32Slice) Swap(i, j int)
type InternalCommitTrigger ¶
type InternalCommitTrigger struct { SplitTrigger *SplitTrigger `protobuf:"bytes,1,opt,name=split_trigger" json:"split_trigger,omitempty"` MergeTrigger *MergeTrigger `protobuf:"bytes,2,opt,name=merge_trigger" json:"merge_trigger,omitempty"` ChangeReplicasTrigger *ChangeReplicasTrigger `protobuf:"bytes,3,opt,name=change_replicas_trigger" json:"change_replicas_trigger,omitempty"` XXX_unrecognized []byte `json:"-"` }
CommitTrigger encapsulates all of the internal-only commit triggers.
func (*InternalCommitTrigger) GetChangeReplicasTrigger ¶
func (m *InternalCommitTrigger) GetChangeReplicasTrigger() *ChangeReplicasTrigger
func (*InternalCommitTrigger) GetMergeTrigger ¶
func (m *InternalCommitTrigger) GetMergeTrigger() *MergeTrigger
func (*InternalCommitTrigger) GetSplitTrigger ¶
func (m *InternalCommitTrigger) GetSplitTrigger() *SplitTrigger
func (*InternalCommitTrigger) ProtoMessage ¶
func (*InternalCommitTrigger) ProtoMessage()
func (*InternalCommitTrigger) Reset ¶
func (m *InternalCommitTrigger) Reset()
func (*InternalCommitTrigger) String ¶
func (m *InternalCommitTrigger) String() string
type InternalGCRequest ¶
type InternalGCRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` GCMeta GCMetadata `protobuf:"bytes,2,opt,name=gc_meta" json:"gc_meta"` Keys []InternalGCRequest_GCKey `protobuf:"bytes,3,rep,name=keys" json:"keys"` XXX_unrecognized []byte `json:"-"` }
An InternalGCRequest is arguments to the InternalGC() method. It's sent by range leaders after scanning range data to find expired MVCC values.
func (*InternalGCRequest) GetGCMeta ¶
func (m *InternalGCRequest) GetGCMeta() GCMetadata
func (*InternalGCRequest) GetKeys ¶
func (m *InternalGCRequest) GetKeys() []InternalGCRequest_GCKey
func (*InternalGCRequest) ProtoMessage ¶
func (*InternalGCRequest) ProtoMessage()
func (*InternalGCRequest) Reset ¶
func (m *InternalGCRequest) Reset()
func (*InternalGCRequest) String ¶
func (m *InternalGCRequest) String() string
type InternalGCRequest_GCKey ¶
type InternalGCRequest_GCKey struct { Key Key `protobuf:"bytes,1,opt,name=key,customtype=Key" json:"key"` Timestamp Timestamp `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp"` XXX_unrecognized []byte `json:"-"` }
func (*InternalGCRequest_GCKey) GetTimestamp ¶
func (m *InternalGCRequest_GCKey) GetTimestamp() Timestamp
func (*InternalGCRequest_GCKey) ProtoMessage ¶
func (*InternalGCRequest_GCKey) ProtoMessage()
func (*InternalGCRequest_GCKey) Reset ¶
func (m *InternalGCRequest_GCKey) Reset()
func (*InternalGCRequest_GCKey) String ¶
func (m *InternalGCRequest_GCKey) String() string
type InternalGCResponse ¶
type InternalGCResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
An InternalGCResponse is the return value from the InternalGC() method.
func (*InternalGCResponse) ProtoMessage ¶
func (*InternalGCResponse) ProtoMessage()
func (*InternalGCResponse) Reset ¶
func (m *InternalGCResponse) Reset()
func (*InternalGCResponse) String ¶
func (m *InternalGCResponse) String() string
type InternalHeartbeatTxnRequest ¶
type InternalHeartbeatTxnRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
An InternalHeartbeatTxnRequest is arguments to the InternalHeartbeatTxn() method. It's sent by transaction coordinators to let the system know that the transaction is still ongoing. Note that this heartbeat message is different from the heartbeat message in the gossip protocol.
func (*InternalHeartbeatTxnRequest) ProtoMessage ¶
func (*InternalHeartbeatTxnRequest) ProtoMessage()
func (*InternalHeartbeatTxnRequest) Reset ¶
func (m *InternalHeartbeatTxnRequest) Reset()
func (*InternalHeartbeatTxnRequest) String ¶
func (m *InternalHeartbeatTxnRequest) String() string
type InternalHeartbeatTxnResponse ¶
type InternalHeartbeatTxnResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
An InternalHeartbeatTxnResponse is the return value from the InternalHeartbeatTxn() method. It returns the transaction info in the response header. The returned transaction lets the coordinator know the disposition of the transaction (i.e. aborted, committed or pending).
func (*InternalHeartbeatTxnResponse) ProtoMessage ¶
func (*InternalHeartbeatTxnResponse) ProtoMessage()
func (*InternalHeartbeatTxnResponse) Reset ¶
func (m *InternalHeartbeatTxnResponse) Reset()
func (*InternalHeartbeatTxnResponse) String ¶
func (m *InternalHeartbeatTxnResponse) String() string
type InternalMergeRequest ¶
type InternalMergeRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` Value Value `protobuf:"bytes,2,opt,name=value" json:"value"` XXX_unrecognized []byte `json:"-"` }
An InternalMergeRequest contains arguments to the InternalMerge() method. It specifies a key and a value which should be merged into the existing value at that key.
func (*InternalMergeRequest) GetValue ¶
func (m *InternalMergeRequest) GetValue() Value
func (*InternalMergeRequest) ProtoMessage ¶
func (*InternalMergeRequest) ProtoMessage()
func (*InternalMergeRequest) Reset ¶
func (m *InternalMergeRequest) Reset()
func (*InternalMergeRequest) String ¶
func (m *InternalMergeRequest) String() string
type InternalMergeResponse ¶
type InternalMergeResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
InternalMergeResponse is the response to an InternalMerge() operation.
func (*InternalMergeResponse) ProtoMessage ¶
func (*InternalMergeResponse) ProtoMessage()
func (*InternalMergeResponse) Reset ¶
func (m *InternalMergeResponse) Reset()
func (*InternalMergeResponse) String ¶
func (m *InternalMergeResponse) String() string
type InternalPushTxnRequest ¶
type InternalPushTxnRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` PusheeTxn Transaction `protobuf:"bytes,2,opt,name=pushee_txn" json:"pushee_txn"` // Set to true to request that the PushTxn be aborted if possible. // This is done in the event of a writer conflicting with PusheeTxn. // Readers set this to false and instead attempt to move PusheeTxn's // commit timestamp forward. Abort bool `protobuf:"varint,3,opt" json:"Abort"` XXX_unrecognized []byte `json:"-"` }
An InternalPushTxnRequest is arguments to the InternalPushTxn() method. It's sent by readers or writers which have encountered an "intent" laid down by another transaction. The goal is to resolve the conflict. Note that args.Key should be set to the txn ID of args.PusheeTxn, not args.Txn, as is usual. This RPC is addressed to the range which owns the pushee's txn record.
Resolution is trivial if the txn which owns the intent has either been committed or aborted already. Otherwise, the existing txn can either be aborted (for write/write conflicts), or its commit timestamp can be moved forward (for read/write conflicts). The course of action is determined by the owning txn's status and also by comparing priorities.
func (*InternalPushTxnRequest) GetAbort ¶
func (m *InternalPushTxnRequest) GetAbort() bool
func (*InternalPushTxnRequest) GetPusheeTxn ¶
func (m *InternalPushTxnRequest) GetPusheeTxn() Transaction
func (*InternalPushTxnRequest) ProtoMessage ¶
func (*InternalPushTxnRequest) ProtoMessage()
func (*InternalPushTxnRequest) Reset ¶
func (m *InternalPushTxnRequest) Reset()
func (*InternalPushTxnRequest) String ¶
func (m *InternalPushTxnRequest) String() string
type InternalPushTxnResponse ¶
type InternalPushTxnResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` // Txn is non-nil if the transaction could be heartbeat and contains // the current value of the transaction. PusheeTxn *Transaction `protobuf:"bytes,2,opt,name=pushee_txn" json:"pushee_txn,omitempty"` XXX_unrecognized []byte `json:"-"` }
An InternalPushTxnResponse is the return value from the InternalPushTxn() method. It returns success and the resulting state of PusheeTxn if the conflict was resolved in favor of the caller; the caller should subsequently invoke InternalResolveIntent() on the conflicted key. It returns an error otherwise.
func (*InternalPushTxnResponse) GetPusheeTxn ¶
func (m *InternalPushTxnResponse) GetPusheeTxn() *Transaction
func (*InternalPushTxnResponse) ProtoMessage ¶
func (*InternalPushTxnResponse) ProtoMessage()
func (*InternalPushTxnResponse) Reset ¶
func (m *InternalPushTxnResponse) Reset()
func (*InternalPushTxnResponse) String ¶
func (m *InternalPushTxnResponse) String() string
type InternalRaftCommand ¶
type InternalRaftCommand struct { RaftID int64 `protobuf:"varint,2,opt,name=raft_id" json:"raft_id"` Cmd InternalRaftCommandUnion `protobuf:"bytes,3,opt,name=cmd" json:"cmd"` XXX_unrecognized []byte `json:"-"` }
An InternalRaftCommand is a command which can be serialized and sent via raft.
func (*InternalRaftCommand) GetCmd ¶
func (m *InternalRaftCommand) GetCmd() InternalRaftCommandUnion
func (*InternalRaftCommand) GetRaftID ¶
func (m *InternalRaftCommand) GetRaftID() int64
func (*InternalRaftCommand) ProtoMessage ¶
func (*InternalRaftCommand) ProtoMessage()
func (*InternalRaftCommand) Reset ¶
func (m *InternalRaftCommand) Reset()
func (*InternalRaftCommand) String ¶
func (m *InternalRaftCommand) String() string
type InternalRaftCommandUnion ¶
type InternalRaftCommandUnion struct { // Non-batched external requests. This section is the same as RequestUnion. Contains *ContainsRequest `protobuf:"bytes,1,opt,name=contains" json:"contains,omitempty"` Get *GetRequest `protobuf:"bytes,2,opt,name=get" json:"get,omitempty"` Put *PutRequest `protobuf:"bytes,3,opt,name=put" json:"put,omitempty"` ConditionalPut *ConditionalPutRequest `protobuf:"bytes,4,opt,name=conditional_put" json:"conditional_put,omitempty"` Increment *IncrementRequest `protobuf:"bytes,5,opt,name=increment" json:"increment,omitempty"` Delete *DeleteRequest `protobuf:"bytes,6,opt,name=delete" json:"delete,omitempty"` DeleteRange *DeleteRangeRequest `protobuf:"bytes,7,opt,name=delete_range" json:"delete_range,omitempty"` Scan *ScanRequest `protobuf:"bytes,8,opt,name=scan" json:"scan,omitempty"` EndTransaction *EndTransactionRequest `protobuf:"bytes,9,opt,name=end_transaction" json:"end_transaction,omitempty"` ReapQueue *ReapQueueRequest `protobuf:"bytes,10,opt,name=reap_queue" json:"reap_queue,omitempty"` EnqueueUpdate *EnqueueUpdateRequest `protobuf:"bytes,11,opt,name=enqueue_update" json:"enqueue_update,omitempty"` EnqueueMessage *EnqueueMessageRequest `protobuf:"bytes,12,opt,name=enqueue_message" json:"enqueue_message,omitempty"` // Other requests. Allow a gap in tag numbers so the previous list can // be copy/pasted from RequestUnion. Batch *BatchRequest `protobuf:"bytes,30,opt,name=batch" json:"batch,omitempty"` InternalRangeLookup *InternalRangeLookupRequest `protobuf:"bytes,31,opt,name=internal_range_lookup" json:"internal_range_lookup,omitempty"` InternalHeartbeatTxn *InternalHeartbeatTxnRequest `protobuf:"bytes,32,opt,name=internal_heartbeat_txn" json:"internal_heartbeat_txn,omitempty"` InternalPushTxn *InternalPushTxnRequest `protobuf:"bytes,33,opt,name=internal_push_txn" json:"internal_push_txn,omitempty"` InternalResolveIntent *InternalResolveIntentRequest `protobuf:"bytes,34,opt,name=internal_resolve_intent" json:"internal_resolve_intent,omitempty"` InternalMergeResponse *InternalMergeRequest `protobuf:"bytes,35,opt,name=internal_merge_response" json:"internal_merge_response,omitempty"` InternalTruncateLog *InternalTruncateLogRequest `protobuf:"bytes,36,opt,name=internal_truncate_log" json:"internal_truncate_log,omitempty"` InternalGc *InternalGCRequest `protobuf:"bytes,37,opt,name=internal_gc" json:"internal_gc,omitempty"` XXX_unrecognized []byte `json:"-"` }
An InternalRaftCommandUnion is the union of all commands which can be sent via raft.
func (*InternalRaftCommandUnion) GetBatch ¶
func (m *InternalRaftCommandUnion) GetBatch() *BatchRequest
func (*InternalRaftCommandUnion) GetConditionalPut ¶
func (m *InternalRaftCommandUnion) GetConditionalPut() *ConditionalPutRequest
func (*InternalRaftCommandUnion) GetContains ¶
func (m *InternalRaftCommandUnion) GetContains() *ContainsRequest
func (*InternalRaftCommandUnion) GetDelete ¶
func (m *InternalRaftCommandUnion) GetDelete() *DeleteRequest
func (*InternalRaftCommandUnion) GetDeleteRange ¶
func (m *InternalRaftCommandUnion) GetDeleteRange() *DeleteRangeRequest
func (*InternalRaftCommandUnion) GetEndTransaction ¶
func (m *InternalRaftCommandUnion) GetEndTransaction() *EndTransactionRequest
func (*InternalRaftCommandUnion) GetEnqueueMessage ¶
func (m *InternalRaftCommandUnion) GetEnqueueMessage() *EnqueueMessageRequest
func (*InternalRaftCommandUnion) GetEnqueueUpdate ¶
func (m *InternalRaftCommandUnion) GetEnqueueUpdate() *EnqueueUpdateRequest
func (*InternalRaftCommandUnion) GetGet ¶
func (m *InternalRaftCommandUnion) GetGet() *GetRequest
func (*InternalRaftCommandUnion) GetIncrement ¶
func (m *InternalRaftCommandUnion) GetIncrement() *IncrementRequest
func (*InternalRaftCommandUnion) GetInternalGc ¶
func (m *InternalRaftCommandUnion) GetInternalGc() *InternalGCRequest
func (*InternalRaftCommandUnion) GetInternalHeartbeatTxn ¶
func (m *InternalRaftCommandUnion) GetInternalHeartbeatTxn() *InternalHeartbeatTxnRequest
func (*InternalRaftCommandUnion) GetInternalMergeResponse ¶
func (m *InternalRaftCommandUnion) GetInternalMergeResponse() *InternalMergeRequest
func (*InternalRaftCommandUnion) GetInternalPushTxn ¶
func (m *InternalRaftCommandUnion) GetInternalPushTxn() *InternalPushTxnRequest
func (*InternalRaftCommandUnion) GetInternalRangeLookup ¶
func (m *InternalRaftCommandUnion) GetInternalRangeLookup() *InternalRangeLookupRequest
func (*InternalRaftCommandUnion) GetInternalResolveIntent ¶
func (m *InternalRaftCommandUnion) GetInternalResolveIntent() *InternalResolveIntentRequest
func (*InternalRaftCommandUnion) GetInternalTruncateLog ¶
func (m *InternalRaftCommandUnion) GetInternalTruncateLog() *InternalTruncateLogRequest
func (*InternalRaftCommandUnion) GetPut ¶
func (m *InternalRaftCommandUnion) GetPut() *PutRequest
func (*InternalRaftCommandUnion) GetReapQueue ¶
func (m *InternalRaftCommandUnion) GetReapQueue() *ReapQueueRequest
func (*InternalRaftCommandUnion) GetScan ¶
func (m *InternalRaftCommandUnion) GetScan() *ScanRequest
func (*InternalRaftCommandUnion) GetValue ¶
func (this *InternalRaftCommandUnion) GetValue() interface{}
func (*InternalRaftCommandUnion) ProtoMessage ¶
func (*InternalRaftCommandUnion) ProtoMessage()
func (*InternalRaftCommandUnion) Reset ¶
func (m *InternalRaftCommandUnion) Reset()
func (*InternalRaftCommandUnion) SetValue ¶
func (this *InternalRaftCommandUnion) SetValue(value interface{}) bool
func (*InternalRaftCommandUnion) String ¶
func (m *InternalRaftCommandUnion) String() string
type InternalRangeLookupRequest ¶
type InternalRangeLookupRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` MaxRanges int32 `protobuf:"varint,2,opt,name=max_ranges" json:"max_ranges"` XXX_unrecognized []byte `json:"-"` }
An InternalRangeLookupRequest is arguments to the InternalRangeLookup() method. It specifies the key for which the containing range is being requested, and the maximum number of total range descriptors that should be returned, if there are additional consecutive addressable ranges. Specify max_ranges > 1 to pre-fill the range descriptor cache.
func (*InternalRangeLookupRequest) GetMaxRanges ¶
func (m *InternalRangeLookupRequest) GetMaxRanges() int32
func (*InternalRangeLookupRequest) ProtoMessage ¶
func (*InternalRangeLookupRequest) ProtoMessage()
func (*InternalRangeLookupRequest) Reset ¶
func (m *InternalRangeLookupRequest) Reset()
func (*InternalRangeLookupRequest) String ¶
func (m *InternalRangeLookupRequest) String() string
type InternalRangeLookupResponse ¶
type InternalRangeLookupResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` Ranges []RangeDescriptor `protobuf:"bytes,2,rep,name=ranges" json:"ranges"` XXX_unrecognized []byte `json:"-"` }
An InternalRangeLookupResponse is the return value from the InternalRangeLookup() method. It returns metadata for the range containing the requested key, optionally returning the metadata for additional consecutive ranges beyond the requested range to pre-fill the range descriptor cache.
func (*InternalRangeLookupResponse) GetRanges ¶
func (m *InternalRangeLookupResponse) GetRanges() []RangeDescriptor
func (*InternalRangeLookupResponse) ProtoMessage ¶
func (*InternalRangeLookupResponse) ProtoMessage()
func (*InternalRangeLookupResponse) Reset ¶
func (m *InternalRangeLookupResponse) Reset()
func (*InternalRangeLookupResponse) String ¶
func (m *InternalRangeLookupResponse) String() string
type InternalResolveIntentRequest ¶
type InternalResolveIntentRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
An InternalResolveIntentRequest is arguments to the InternalResolveIntent() method. It is sent by transaction coordinators and after success calling InternalPushTxn to clean up write intents: either to remove them or commit them.
func (*InternalResolveIntentRequest) ProtoMessage ¶
func (*InternalResolveIntentRequest) ProtoMessage()
func (*InternalResolveIntentRequest) Reset ¶
func (m *InternalResolveIntentRequest) Reset()
func (*InternalResolveIntentRequest) String ¶
func (m *InternalResolveIntentRequest) String() string
type InternalResolveIntentResponse ¶
type InternalResolveIntentResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
An InternalResolveIntentResponse is the return value from the InternalResolveIntent() method.
func (*InternalResolveIntentResponse) Combine ¶
func (rr *InternalResolveIntentResponse) Combine(c Response)
Combine implements the Combinable interface for InternalResolveIntentResponse.
func (*InternalResolveIntentResponse) ProtoMessage ¶
func (*InternalResolveIntentResponse) ProtoMessage()
func (*InternalResolveIntentResponse) Reset ¶
func (m *InternalResolveIntentResponse) Reset()
func (*InternalResolveIntentResponse) String ¶
func (m *InternalResolveIntentResponse) String() string
type InternalTimeSeriesData ¶
type InternalTimeSeriesData struct { // Holds a wall time, expressed as a unix epoch time in nanoseconds. This // represents the earliest possible timestamp for a sample within the // collection. StartTimestampNanos int64 `protobuf:"varint,1,opt,name=start_timestamp_nanos" json:"start_timestamp_nanos"` // The duration of each sample interval, expressed in nanoseconds. SampleDurationNanos int64 `protobuf:"varint,2,opt,name=sample_duration_nanos" json:"sample_duration_nanos"` // The actual data samples for this metric. Samples []*InternalTimeSeriesSample `protobuf:"bytes,3,rep,name=samples" json:"samples,omitempty"` XXX_unrecognized []byte `json:"-"` }
InternalTimeSeriesData is a collection of data samples for some measurable value, where each sample is taken over a uniform time interval.
The collection itself contains a start timestamp (in seconds since the unix epoch) and a sample duration (in milliseconds). Each sample in the collection will contain a positive integer offset that indicates the length of time between the start_timestamp of the collection and the time when the sample began, expressed as an whole number of sample intervals. For example, if the sample duration is 60000 (indicating 1 minute), then a contained sample with an offset value of 5 begins (5*60000ms = 300000ms = 5 minutes) after the start timestamp of this data.
This is meant to be an efficient internal representation of time series data, ensuring that very little redundant data is stored on disk. With this goal in mind, this message does not identify the variable which is actually being measured; that information is expected be encoded in the key where this message is stored.
func InternalTimeSeriesDataFromValue ¶
func InternalTimeSeriesDataFromValue(value *Value) (*InternalTimeSeriesData, error)
InternalTimeSeriesDataFromValue attempts to extract an InternalTimeSeriesData message from the "bytes" field of the given value.
func (*InternalTimeSeriesData) GetSampleDurationNanos ¶
func (m *InternalTimeSeriesData) GetSampleDurationNanos() int64
func (*InternalTimeSeriesData) GetSamples ¶
func (m *InternalTimeSeriesData) GetSamples() []*InternalTimeSeriesSample
func (*InternalTimeSeriesData) GetStartTimestampNanos ¶
func (m *InternalTimeSeriesData) GetStartTimestampNanos() int64
func (*InternalTimeSeriesData) ProtoMessage ¶
func (*InternalTimeSeriesData) ProtoMessage()
func (*InternalTimeSeriesData) Reset ¶
func (m *InternalTimeSeriesData) Reset()
func (*InternalTimeSeriesData) String ¶
func (m *InternalTimeSeriesData) String() string
func (*InternalTimeSeriesData) ToValue ¶
func (ts *InternalTimeSeriesData) ToValue() (*Value, error)
ToValue generates a Value message which contains an encoded copy of this TimeSeriesData in its "bytes" field. The returned Value will also have its "tag" string set to the TIME_SERIES constant.
type InternalTimeSeriesSample ¶
type InternalTimeSeriesSample struct { // Temporal offset from the "start_timestamp" of the InternalTimeSeriesData // collection this data point is part in. The units of this value are // determined by the value of the "sample_duration_milliseconds" field of // the TimeSeriesData collection. Offset int32 `protobuf:"varint,1,opt,name=offset" json:"offset"` // Count of integer measurements taken within this sample. IntCount uint32 `protobuf:"varint,2,opt,name=int_count" json:"int_count"` // Sum of all integer measurements. IntSum *int64 `protobuf:"varint,3,opt,name=int_sum" json:"int_sum,omitempty"` // Maximum encountered integer measurement in this sample. IntMax *int64 `protobuf:"varint,4,opt,name=int_max" json:"int_max,omitempty"` // Minimum encountered integer measurement in this sample. IntMin *int64 `protobuf:"varint,5,opt,name=int_min" json:"int_min,omitempty"` // Count of floating point measurements taken within this sample. FloatCount uint32 `protobuf:"varint,6,opt,name=float_count" json:"float_count"` // Sum of all floating point measurements. FloatSum *float32 `protobuf:"fixed32,7,opt,name=float_sum" json:"float_sum,omitempty"` // Maximum encountered floating point measurement in this sample. FloatMax *float32 `protobuf:"fixed32,8,opt,name=float_max" json:"float_max,omitempty"` // Minimum encountered floating point measurement in this sample. FloatMin *float32 `protobuf:"fixed32,9,opt,name=float_min" json:"float_min,omitempty"` XXX_unrecognized []byte `json:"-"` }
A InternalTimeSeriesSample represents data gathered from multiple measurements of a variable value over a given period of time. The length of that period of time is stored in an InternalTimeSeriesData message; a sample cannot be interpreted correctly without a start timestamp and sample duration.
Each sample may contain data gathered from multiple measurements of the same variable, as long as all of those measurements occured within the sample period. The sample stores several aggregated values from these measurements: - The sum of all measured values - A count of all measurements taken - The maximum individual measurement seen - The minimum individual measurement seen
If zero measurements are present in a sample, then it should be omitted entirely from any collection it would be a part of.
If the count of measurements is 1, then max and min fields may be omitted and assumed equal to the sum field.
The variable being measured may be either an integer or a floating point; therefore, there are two fields each for "sum", "max" and "min" to hold either an integer or floating point number. In practice, only one set of these fields should be present for any individual sample; however, int and float values are recorded in parallel, allowing clients to write both floats and integers to the same value. These are recorded separately to retain precision, but are easily combined by higher-level logic at query time.
func (*InternalTimeSeriesSample) GetFloatCount ¶
func (m *InternalTimeSeriesSample) GetFloatCount() uint32
func (*InternalTimeSeriesSample) GetFloatMax ¶
func (m *InternalTimeSeriesSample) GetFloatMax() float32
func (*InternalTimeSeriesSample) GetFloatMin ¶
func (m *InternalTimeSeriesSample) GetFloatMin() float32
func (*InternalTimeSeriesSample) GetFloatSum ¶
func (m *InternalTimeSeriesSample) GetFloatSum() float32
func (*InternalTimeSeriesSample) GetIntCount ¶
func (m *InternalTimeSeriesSample) GetIntCount() uint32
func (*InternalTimeSeriesSample) GetIntMax ¶
func (m *InternalTimeSeriesSample) GetIntMax() int64
func (*InternalTimeSeriesSample) GetIntMin ¶
func (m *InternalTimeSeriesSample) GetIntMin() int64
func (*InternalTimeSeriesSample) GetIntSum ¶
func (m *InternalTimeSeriesSample) GetIntSum() int64
func (*InternalTimeSeriesSample) GetOffset ¶
func (m *InternalTimeSeriesSample) GetOffset() int32
func (*InternalTimeSeriesSample) ProtoMessage ¶
func (*InternalTimeSeriesSample) ProtoMessage()
func (*InternalTimeSeriesSample) Reset ¶
func (m *InternalTimeSeriesSample) Reset()
func (*InternalTimeSeriesSample) String ¶
func (m *InternalTimeSeriesSample) String() string
type InternalTruncateLogRequest ¶
type InternalTruncateLogRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` // Log entries < this index are to be discarded. Index uint64 `protobuf:"varint,2,opt,name=index" json:"index"` XXX_unrecognized []byte `json:"-"` }
InternalTruncateLogRequest is used to remove a prefix of the raft log. While there is no requirement for correctness that the raft log truncation be synchronized across replicas, it is nice to preserve the property that all replicas of a range are as close to identical as possible. The raft leader can also inform decisions about the cutoff point with its knowledge of the replicas' acknowledgement status.
func (*InternalTruncateLogRequest) GetIndex ¶
func (m *InternalTruncateLogRequest) GetIndex() uint64
func (*InternalTruncateLogRequest) ProtoMessage ¶
func (*InternalTruncateLogRequest) ProtoMessage()
func (*InternalTruncateLogRequest) Reset ¶
func (m *InternalTruncateLogRequest) Reset()
func (*InternalTruncateLogRequest) String ¶
func (m *InternalTruncateLogRequest) String() string
type InternalTruncateLogResponse ¶
type InternalTruncateLogResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
InternalTruncateLogResponse is the response to an InternalTruncateLog() operation.
func (*InternalTruncateLogResponse) ProtoMessage ¶
func (*InternalTruncateLogResponse) ProtoMessage()
func (*InternalTruncateLogResponse) Reset ¶
func (m *InternalTruncateLogResponse) Reset()
func (*InternalTruncateLogResponse) String ¶
func (m *InternalTruncateLogResponse) String() string
type InternalValueType ¶
type InternalValueType int32
InternalValueType defines a set of string constants placed in the "tag" field of Value messages which are created internally. These are defined as a protocol buffer enumeration so that they can be used portably between our Go and C code.
func (InternalValueType) Enum ¶
func (x InternalValueType) Enum() *InternalValueType
func (InternalValueType) String ¶
func (x InternalValueType) String() string
func (*InternalValueType) UnmarshalJSON ¶
func (x *InternalValueType) UnmarshalJSON(data []byte) error
type IsolationType ¶
type IsolationType int32
IsolationType TODO(jiajia) Needs documentation.
const ( // SERIALIZABLE TODO(jiajia) Needs documentation. SERIALIZABLE IsolationType = 0 // SNAPSHOT TODO(jiajia) Needs documentation. SNAPSHOT IsolationType = 1 )
func (IsolationType) Enum ¶
func (x IsolationType) Enum() *IsolationType
func (IsolationType) String ¶
func (x IsolationType) String() string
func (*IsolationType) UnmarshalJSON ¶
func (x *IsolationType) UnmarshalJSON(data []byte) error
type Key ¶
type Key []byte
Key is a custom type for a byte string in proto messages which refer to Cockroach keys.
func (Key) Compare ¶
func (k Key) Compare(b interval.Comparable) int
Compare implements the llrb.Comparable interface for tree nodes.
func (Key) PrefixEnd ¶
PrefixEnd determines the end key given key as a prefix, that is the key that sorts precisely behind all keys starting with prefix: "1" is added to the final byte and the carry propagated. The special cases of nil and KeyMin always returns KeyMax.
func (*Key) UnmarshalJSON ¶
UnmarshalJSON implements the json Unmarshaler interface.
type KeyGetter ¶
type KeyGetter interface {
KeyGet() []byte
}
KeyGetter is a hack to allow Compare() to work for the batch update structs which wrap RawKeyValue. TODO(petermattis): Is there somehow a better way to do this?
It kept dying at runtime in the previous version of Compare which type cast the llrb.Comparable to a RawKeyValue. Because I'm wrapping a RawKeyValue with BatchDelete/BatchPut/BatchMerge.
type KeyValue ¶
type KeyValue struct { Key Key `protobuf:"bytes,1,opt,name=key,customtype=Key" json:"key"` Value Value `protobuf:"bytes,2,opt,name=value" json:"value"` XXX_unrecognized []byte `json:"-"` }
KeyValue is a pair of Key and Value for returned Key/Value pairs from ScanRequest/ScanResponse. It embeds a Key and a Value.
func (*KeyValue) ProtoMessage ¶
func (*KeyValue) ProtoMessage()
type MVCCMetadata ¶
type MVCCMetadata struct { Txn *Transaction `protobuf:"bytes,1,opt,name=txn" json:"txn,omitempty"` // The timestamp of the most recent versioned value. Timestamp Timestamp `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp"` // Is the most recent value a deletion tombstone? Deleted bool `protobuf:"varint,3,opt,name=deleted" json:"deleted"` // The size in bytes of the most recent encoded key. KeyBytes int64 `protobuf:"varint,4,opt,name=key_bytes" json:"key_bytes"` // The size in bytes of the most recent versioned value. ValBytes int64 `protobuf:"varint,5,opt,name=val_bytes" json:"val_bytes"` // Inline value, used for values with zero timestamp. This provides // an efficient short circuit of the normal MVCC metadata sentinel // and subsequent version rows. If timestamp == (0, 0), then there // is only a single MVCC metadata row with value inlined, and with // empty timestamp, key_bytes, and val_bytes. Value *Value `protobuf:"bytes,6,opt,name=value" json:"value,omitempty"` XXX_unrecognized []byte `json:"-"` }
MVCCMetadata holds MVCC metadata for a key. Used by storage/engine/mvcc.go.
func (*MVCCMetadata) GetDeleted ¶
func (m *MVCCMetadata) GetDeleted() bool
func (*MVCCMetadata) GetKeyBytes ¶
func (m *MVCCMetadata) GetKeyBytes() int64
func (*MVCCMetadata) GetTimestamp ¶
func (m *MVCCMetadata) GetTimestamp() Timestamp
func (*MVCCMetadata) GetTxn ¶
func (m *MVCCMetadata) GetTxn() *Transaction
func (*MVCCMetadata) GetValBytes ¶
func (m *MVCCMetadata) GetValBytes() int64
func (*MVCCMetadata) GetValue ¶
func (m *MVCCMetadata) GetValue() *Value
func (*MVCCMetadata) IsInline ¶
func (mvcc *MVCCMetadata) IsInline() bool
IsInline returns true if the value is inlined in the metadata.
func (*MVCCMetadata) ProtoMessage ¶
func (*MVCCMetadata) ProtoMessage()
func (*MVCCMetadata) Reset ¶
func (m *MVCCMetadata) Reset()
func (*MVCCMetadata) String ¶
func (m *MVCCMetadata) String() string
func (*MVCCMetadata) Unmarshal ¶
func (m *MVCCMetadata) Unmarshal(data []byte) error
type MVCCValue ¶
type MVCCValue struct { // True to indicate a deletion tombstone. If false, value should not // be nil. Deleted bool `protobuf:"varint,1,opt,name=deleted" json:"deleted"` // The value. Nil if deleted is true; not nil otherwise. Value *Value `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` XXX_unrecognized []byte `json:"-"` }
MVCCValue differentiates between normal versioned values and deletion tombstones.
func (*MVCCValue) GetDeleted ¶
func (*MVCCValue) ProtoMessage ¶
func (*MVCCValue) ProtoMessage()
type MergeTrigger ¶
type MergeTrigger struct { UpdatedDesc RangeDescriptor `protobuf:"bytes,1,opt,name=updated_desc" json:"updated_desc"` SubsumedRaftID int64 `protobuf:"varint,2,opt,name=subsumed_raft_id" json:"subsumed_raft_id"` XXX_unrecognized []byte `json:"-"` }
A MergeTrigger is run after a successful commit of an AdminMerge command. It provides the updated range descriptor that now encompasses what was originally both ranges. This information allows the final bookkeeping for the merge to be completed and put into operation.
func (*MergeTrigger) GetSubsumedRaftID ¶
func (m *MergeTrigger) GetSubsumedRaftID() int64
func (*MergeTrigger) GetUpdatedDesc ¶
func (m *MergeTrigger) GetUpdatedDesc() RangeDescriptor
func (*MergeTrigger) ProtoMessage ¶
func (*MergeTrigger) ProtoMessage()
func (*MergeTrigger) Reset ¶
func (m *MergeTrigger) Reset()
func (*MergeTrigger) String ¶
func (m *MergeTrigger) String() string
type NodeID ¶
type NodeID int32
NodeID is a custom type for a cockroach node ID. (not a raft node ID)
type NodeList ¶
type NodeList struct { // Note that this does not use the NodeID custom type because that appears // to interact badly with the repeated and/or packed options. Nodes []int32 `protobuf:"varint,1,rep,packed,name=nodes" json:"nodes,omitempty"` XXX_unrecognized []byte `json:"-"` }
NodeList keeps a growing set of NodeIDs as a sorted slice, with Add() adding to the set and Contains() verifying membership.
func (*NodeList) Add ¶
Add adds the given NodeID to the interface (unless already present) and restores ordering.
func (*NodeList) ProtoMessage ¶
func (*NodeList) ProtoMessage()
type NotLeaderError ¶
type NotLeaderError struct { Leader Replica `protobuf:"bytes,1,opt,name=leader" json:"leader"` XXX_unrecognized []byte `json:"-"` }
A NotLeaderError indicates that the current range is not the leader. If the leader is known, its Replica is set in the error.
func (*NotLeaderError) GetLeader ¶
func (m *NotLeaderError) GetLeader() Replica
func (*NotLeaderError) ProtoMessage ¶
func (*NotLeaderError) ProtoMessage()
func (*NotLeaderError) Reset ¶
func (m *NotLeaderError) Reset()
func (*NotLeaderError) String ¶
func (m *NotLeaderError) String() string
type OpRequiresTxnError ¶
type OpRequiresTxnError struct {
XXX_unrecognized []byte `json:"-"`
}
An OpRequiresTxnError indicates that a command required to be carried out in a transactional context but was not. For example, a Scan which spans ranges requires a transaction. The operation should be retried inside of a transaction.
func (*OpRequiresTxnError) ProtoMessage ¶
func (*OpRequiresTxnError) ProtoMessage()
func (*OpRequiresTxnError) Reset ¶
func (m *OpRequiresTxnError) Reset()
func (*OpRequiresTxnError) String ¶
func (m *OpRequiresTxnError) String() string
type PermConfig ¶
type PermConfig struct { // ACL lists users with read permissions. Read []string `protobuf:"bytes,1,rep,name=read" json:"read" yaml:"read,omitempty"` // ACL lists users with write permissions. Write []string `protobuf:"bytes,2,rep,name=write" json:"write" yaml:"write,omitempty"` XXX_unrecognized []byte `json:"-"` }
PermConfig holds permission configuration, specifying read/write ACLs.
func (*PermConfig) CanRead ¶
func (p *PermConfig) CanRead(user string) bool
CanRead does a linear search for user to verify read permission.
func (*PermConfig) CanWrite ¶
func (p *PermConfig) CanWrite(user string) bool
CanWrite does a linear search for user to verify write permission.
func (*PermConfig) GetRead ¶
func (m *PermConfig) GetRead() []string
func (*PermConfig) GetWrite ¶
func (m *PermConfig) GetWrite() []string
func (*PermConfig) ProtoMessage ¶
func (*PermConfig) ProtoMessage()
func (*PermConfig) Reset ¶
func (m *PermConfig) Reset()
func (*PermConfig) String ¶
func (m *PermConfig) String() string
type PingRequest ¶
type PingRequest struct { // Echo this string with PingResponse. Ping string `protobuf:"bytes,1,opt,name=ping" json:"ping"` // The last offset the client measured with the server. Offset RemoteOffset `protobuf:"bytes,2,opt,name=offset" json:"offset"` // The address of the client. Addr string `protobuf:"bytes,3,opt,name=addr" json:"addr"` XXX_unrecognized []byte `json:"-"` }
A PingRequest specifies the string to echo in response. Fields are exported so that they will be serialized in the rpc call.
func (*PingRequest) GetAddr ¶
func (m *PingRequest) GetAddr() string
func (*PingRequest) GetOffset ¶
func (m *PingRequest) GetOffset() RemoteOffset
func (*PingRequest) GetPing ¶
func (m *PingRequest) GetPing() string
func (*PingRequest) ProtoMessage ¶
func (*PingRequest) ProtoMessage()
func (*PingRequest) Reset ¶
func (m *PingRequest) Reset()
func (*PingRequest) String ¶
func (m *PingRequest) String() string
type PingResponse ¶
type PingResponse struct { // An echo of value sent with PingRequest. Pong string `protobuf:"bytes,1,opt,name=pong" json:"pong"` ServerTime int64 `protobuf:"varint,2,opt,name=server_time" json:"server_time"` XXX_unrecognized []byte `json:"-"` }
A PingResponse contains the echoed ping request string.
func (*PingResponse) GetPong ¶
func (m *PingResponse) GetPong() string
func (*PingResponse) GetServerTime ¶
func (m *PingResponse) GetServerTime() int64
func (*PingResponse) ProtoMessage ¶
func (*PingResponse) ProtoMessage()
func (*PingResponse) Reset ¶
func (m *PingResponse) Reset()
func (*PingResponse) String ¶
func (m *PingResponse) String() string
type PutRequest ¶
type PutRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` Value Value `protobuf:"bytes,2,opt,name=value" json:"value"` XXX_unrecognized []byte `json:"-"` }
A PutRequest is arguments to the Put() method. Note that to write an empty value, the value parameter is still specified, but both Bytes and Integer are set to nil.
func PutArgs ¶
func PutArgs(key Key, valueBytes []byte) *PutRequest
PutArgs returns a PutRequest object initialized to put value as a byte slice at key.
func (*PutRequest) GetValue ¶
func (m *PutRequest) GetValue() Value
func (*PutRequest) ProtoMessage ¶
func (*PutRequest) ProtoMessage()
func (*PutRequest) Reset ¶
func (m *PutRequest) Reset()
func (*PutRequest) String ¶
func (m *PutRequest) String() string
type PutResponse ¶
type PutResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` XXX_unrecognized []byte `json:"-"` }
A PutResponse is the return value from the Put() method.
func (*PutResponse) ProtoMessage ¶
func (*PutResponse) ProtoMessage()
func (*PutResponse) Reset ¶
func (m *PutResponse) Reset()
func (*PutResponse) String ¶
func (m *PutResponse) String() string
type RaftTruncatedState ¶
type RaftTruncatedState struct { // The highest index that has been removed from the log. Index uint64 `protobuf:"varint,1,opt,name=index" json:"index"` // The term corresponding to 'index'. Term uint64 `protobuf:"varint,2,opt,name=term" json:"term"` XXX_unrecognized []byte `json:"-"` }
RaftTruncatedState contains metadata about the truncated portion of the raft log. Raft requires access to the term of the last truncated log entry even after the rest of the entry has been discarded.
func (*RaftTruncatedState) GetIndex ¶
func (m *RaftTruncatedState) GetIndex() uint64
func (*RaftTruncatedState) GetTerm ¶
func (m *RaftTruncatedState) GetTerm() uint64
func (*RaftTruncatedState) ProtoMessage ¶
func (*RaftTruncatedState) ProtoMessage()
func (*RaftTruncatedState) Reset ¶
func (m *RaftTruncatedState) Reset()
func (*RaftTruncatedState) String ¶
func (m *RaftTruncatedState) String() string
type RangeDescriptor ¶
type RangeDescriptor struct { RaftID int64 `protobuf:"varint,1,opt,name=raft_id" json:"raft_id"` // StartKey is the first key which may be contained by this range. StartKey Key `protobuf:"bytes,2,opt,name=start_key,customtype=Key" json:"start_key"` // EndKey marks the end of the range's possible keys. EndKey itself is not // contained in this range - it will be contained in the immediately // subsequent range. EndKey Key `protobuf:"bytes,3,opt,name=end_key,customtype=Key" json:"end_key"` // Replicas is the set of replicas on which this range is stored, the // ordering being arbitrary and subject to permutation. Replicas []Replica `protobuf:"bytes,4,rep,name=replicas" json:"replicas"` XXX_unrecognized []byte `json:"-"` }
RangeDescriptor is the value stored in a range metadata key. A range is described using an inclusive start key, a non-inclusive end key, and a list of replicas where the range is stored.
func (*RangeDescriptor) ContainsKey ¶
func (r *RangeDescriptor) ContainsKey(key []byte) bool
ContainsKey returns whether this RangeDescriptor contains the specified key.
func (*RangeDescriptor) ContainsKeyRange ¶
func (r *RangeDescriptor) ContainsKeyRange(start, end []byte) bool
ContainsKeyRange returns whether this RangeDescriptor contains the specified key range from start to end.
func (*RangeDescriptor) FindReplica ¶
func (r *RangeDescriptor) FindReplica(storeID StoreID) *Replica
FindReplica returns the replica which matches the specified store ID. Panic in the event that no replica matches.
func (*RangeDescriptor) GetRaftID ¶
func (m *RangeDescriptor) GetRaftID() int64
func (*RangeDescriptor) GetReplicas ¶
func (m *RangeDescriptor) GetReplicas() []Replica
func (*RangeDescriptor) ProtoMessage ¶
func (*RangeDescriptor) ProtoMessage()
func (*RangeDescriptor) Reset ¶
func (m *RangeDescriptor) Reset()
func (*RangeDescriptor) String ¶
func (m *RangeDescriptor) String() string
type RangeKeyMismatchError ¶
type RangeKeyMismatchError struct { RequestStartKey Key `protobuf:"bytes,1,opt,name=request_start_key,customtype=Key" json:"request_start_key"` RequestEndKey Key `protobuf:"bytes,2,opt,name=request_end_key,customtype=Key" json:"request_end_key"` Range *RangeDescriptor `protobuf:"bytes,3,opt,name=range" json:"range,omitempty"` XXX_unrecognized []byte `json:"-"` }
A RangeKeyMismatchError indicates that a command was sent to a range which did not contain the key(s) specified by the command.
func NewRangeKeyMismatchError ¶
func NewRangeKeyMismatchError(start, end Key, desc *RangeDescriptor) *RangeKeyMismatchError
NewRangeKeyMismatchError initializes a new RangeKeyMismatchError.
func (*RangeKeyMismatchError) CanRetry ¶
func (e *RangeKeyMismatchError) CanRetry() bool
CanRetry indicates whether or not this RangeKeyMismatchError can be retried.
func (*RangeKeyMismatchError) Error ¶
func (e *RangeKeyMismatchError) Error() string
Error formats error.
func (*RangeKeyMismatchError) GetRange ¶
func (m *RangeKeyMismatchError) GetRange() *RangeDescriptor
func (*RangeKeyMismatchError) ProtoMessage ¶
func (*RangeKeyMismatchError) ProtoMessage()
func (*RangeKeyMismatchError) Reset ¶
func (m *RangeKeyMismatchError) Reset()
func (*RangeKeyMismatchError) String ¶
func (m *RangeKeyMismatchError) String() string
type RangeNotFoundError ¶
type RangeNotFoundError struct { RaftID int64 `protobuf:"varint,1,opt,name=raft_id" json:"raft_id"` XXX_unrecognized []byte `json:"-"` }
A RangeNotFoundError indicates that a command was sent to a range which is not hosted on this store.
func NewRangeNotFoundError ¶
func NewRangeNotFoundError(raftID int64) *RangeNotFoundError
NewRangeNotFoundError initializes a new RangeNotFoundError.
func (*RangeNotFoundError) CanRetry ¶
func (e *RangeNotFoundError) CanRetry() bool
CanRetry indicates whether or not this RangeNotFoundError can be retried.
func (*RangeNotFoundError) GetRaftID ¶
func (m *RangeNotFoundError) GetRaftID() int64
func (*RangeNotFoundError) ProtoMessage ¶
func (*RangeNotFoundError) ProtoMessage()
func (*RangeNotFoundError) Reset ¶
func (m *RangeNotFoundError) Reset()
func (*RangeNotFoundError) String ¶
func (m *RangeNotFoundError) String() string
type RangeTree ¶
type RangeTree struct { RootID int64 `protobuf:"varint,1,opt,name=root_id" json:"root_id"` XXX_unrecognized []byte `json:"-"` }
RangeTree holds the root node and size of the range tree.
func (*RangeTree) ProtoMessage ¶
func (*RangeTree) ProtoMessage()
type RangeTreeNode ¶
type RangeTreeNode struct { RaftID int64 `protobuf:"varint,1,opt,name=raft_id" json:"raft_id"` // Color is black if true, red if false. Black bool `protobuf:"varint,2,opt,name=black" json:"black"` // If the parent key is null, this is the root node. ParentID *int64 `protobuf:"varint,3,opt,name=parent_id" json:"parent_id,omitempty"` LeftID *int64 `protobuf:"varint,4,opt,name=left_id" json:"left_id,omitempty"` RightID *int64 `protobuf:"varint,5,opt,name=right_id" json:"right_id,omitempty"` XXX_unrecognized []byte `json:"-"` }
RangeTreeNode holds the configuration for each node of the Red-Black Tree that references all ranges.
func (*RangeTreeNode) GetBlack ¶
func (m *RangeTreeNode) GetBlack() bool
func (*RangeTreeNode) GetLeftID ¶
func (m *RangeTreeNode) GetLeftID() int64
func (*RangeTreeNode) GetParentID ¶
func (m *RangeTreeNode) GetParentID() int64
func (*RangeTreeNode) GetRaftID ¶
func (m *RangeTreeNode) GetRaftID() int64
func (*RangeTreeNode) GetRightID ¶
func (m *RangeTreeNode) GetRightID() int64
func (*RangeTreeNode) ProtoMessage ¶
func (*RangeTreeNode) ProtoMessage()
func (*RangeTreeNode) Reset ¶
func (m *RangeTreeNode) Reset()
func (*RangeTreeNode) String ¶
func (m *RangeTreeNode) String() string
type RawKeyValue ¶
type RawKeyValue struct { Key EncodedKey `protobuf:"bytes,1,opt,name=key,customtype=EncodedKey" json:"key"` Value []byte `protobuf:"bytes,2,opt,name=value" json:"value"` XXX_unrecognized []byte `json:"-"` }
RawKeyValue contains the raw bytes of the value for a key.
func (RawKeyValue) Compare ¶
func (kv RawKeyValue) Compare(b llrb.Comparable) int
Compare implements the llrb.Comparable interface for tree nodes.
func (*RawKeyValue) GetValue ¶
func (m *RawKeyValue) GetValue() []byte
func (RawKeyValue) KeyGet ¶
func (kv RawKeyValue) KeyGet() []byte
KeyGet is an implementation for KeyGetter.
func (*RawKeyValue) ProtoMessage ¶
func (*RawKeyValue) ProtoMessage()
func (*RawKeyValue) Reset ¶
func (m *RawKeyValue) Reset()
func (*RawKeyValue) String ¶
func (m *RawKeyValue) String() string
type ReadWithinUncertaintyIntervalError ¶
type ReadWithinUncertaintyIntervalError struct { Timestamp Timestamp `protobuf:"bytes,1,opt,name=timestamp" json:"timestamp"` ExistingTimestamp Timestamp `protobuf:"bytes,2,opt,name=existing_timestamp" json:"existing_timestamp"` XXX_unrecognized []byte `json:"-"` }
A ReadWithinUncertaintyIntervalError indicates that a read at timestamp encountered a versioned value at existing_timestamp within the uncertainty interval of the reader. The read should be retried at existing_timestamp+1.
func (*ReadWithinUncertaintyIntervalError) Error ¶
func (e *ReadWithinUncertaintyIntervalError) Error() string
Error formats error.
func (*ReadWithinUncertaintyIntervalError) GetExistingTimestamp ¶
func (m *ReadWithinUncertaintyIntervalError) GetExistingTimestamp() Timestamp
func (*ReadWithinUncertaintyIntervalError) GetTimestamp ¶
func (m *ReadWithinUncertaintyIntervalError) GetTimestamp() Timestamp
func (*ReadWithinUncertaintyIntervalError) ProtoMessage ¶
func (*ReadWithinUncertaintyIntervalError) ProtoMessage()
func (*ReadWithinUncertaintyIntervalError) Reset ¶
func (m *ReadWithinUncertaintyIntervalError) Reset()
func (*ReadWithinUncertaintyIntervalError) String ¶
func (m *ReadWithinUncertaintyIntervalError) String() string
type ReadWriteCmdResponse ¶
type ReadWriteCmdResponse struct { Put *PutResponse `protobuf:"bytes,1,opt,name=put" json:"put,omitempty"` ConditionalPut *ConditionalPutResponse `protobuf:"bytes,2,opt,name=conditional_put" json:"conditional_put,omitempty"` Increment *IncrementResponse `protobuf:"bytes,3,opt,name=increment" json:"increment,omitempty"` Delete *DeleteResponse `protobuf:"bytes,4,opt,name=delete" json:"delete,omitempty"` DeleteRange *DeleteRangeResponse `protobuf:"bytes,5,opt,name=delete_range" json:"delete_range,omitempty"` EndTransaction *EndTransactionResponse `protobuf:"bytes,6,opt,name=end_transaction" json:"end_transaction,omitempty"` ReapQueue *ReapQueueResponse `protobuf:"bytes,7,opt,name=reap_queue" json:"reap_queue,omitempty"` EnqueueUpdate *EnqueueUpdateResponse `protobuf:"bytes,8,opt,name=enqueue_update" json:"enqueue_update,omitempty"` EnqueueMessage *EnqueueMessageResponse `protobuf:"bytes,9,opt,name=enqueue_message" json:"enqueue_message,omitempty"` InternalHeartbeatTxn *InternalHeartbeatTxnResponse `protobuf:"bytes,10,opt,name=internal_heartbeat_txn" json:"internal_heartbeat_txn,omitempty"` InternalPushTxn *InternalPushTxnResponse `protobuf:"bytes,11,opt,name=internal_push_txn" json:"internal_push_txn,omitempty"` InternalResolveIntent *InternalResolveIntentResponse `protobuf:"bytes,12,opt,name=internal_resolve_intent" json:"internal_resolve_intent,omitempty"` InternalMerge *InternalMergeResponse `protobuf:"bytes,13,opt,name=internal_merge" json:"internal_merge,omitempty"` InternalTruncateLog *InternalTruncateLogResponse `protobuf:"bytes,14,opt,name=internal_truncate_log" json:"internal_truncate_log,omitempty"` InternalGc *InternalGCResponse `protobuf:"bytes,15,opt,name=internal_gc" json:"internal_gc,omitempty"` XXX_unrecognized []byte `json:"-"` }
A ReadWriteCmdResponse is a union type containing instances of all mutating commands. Note that any entry added here must be handled in storage/engine/db.cc in GetResponseHeader().
func (*ReadWriteCmdResponse) GetConditionalPut ¶
func (m *ReadWriteCmdResponse) GetConditionalPut() *ConditionalPutResponse
func (*ReadWriteCmdResponse) GetDelete ¶
func (m *ReadWriteCmdResponse) GetDelete() *DeleteResponse
func (*ReadWriteCmdResponse) GetDeleteRange ¶
func (m *ReadWriteCmdResponse) GetDeleteRange() *DeleteRangeResponse
func (*ReadWriteCmdResponse) GetEndTransaction ¶
func (m *ReadWriteCmdResponse) GetEndTransaction() *EndTransactionResponse
func (*ReadWriteCmdResponse) GetEnqueueMessage ¶
func (m *ReadWriteCmdResponse) GetEnqueueMessage() *EnqueueMessageResponse
func (*ReadWriteCmdResponse) GetEnqueueUpdate ¶
func (m *ReadWriteCmdResponse) GetEnqueueUpdate() *EnqueueUpdateResponse
func (*ReadWriteCmdResponse) GetIncrement ¶
func (m *ReadWriteCmdResponse) GetIncrement() *IncrementResponse
func (*ReadWriteCmdResponse) GetInternalGc ¶
func (m *ReadWriteCmdResponse) GetInternalGc() *InternalGCResponse
func (*ReadWriteCmdResponse) GetInternalHeartbeatTxn ¶
func (m *ReadWriteCmdResponse) GetInternalHeartbeatTxn() *InternalHeartbeatTxnResponse
func (*ReadWriteCmdResponse) GetInternalMerge ¶
func (m *ReadWriteCmdResponse) GetInternalMerge() *InternalMergeResponse
func (*ReadWriteCmdResponse) GetInternalPushTxn ¶
func (m *ReadWriteCmdResponse) GetInternalPushTxn() *InternalPushTxnResponse
func (*ReadWriteCmdResponse) GetInternalResolveIntent ¶
func (m *ReadWriteCmdResponse) GetInternalResolveIntent() *InternalResolveIntentResponse
func (*ReadWriteCmdResponse) GetInternalTruncateLog ¶
func (m *ReadWriteCmdResponse) GetInternalTruncateLog() *InternalTruncateLogResponse
func (*ReadWriteCmdResponse) GetPut ¶
func (m *ReadWriteCmdResponse) GetPut() *PutResponse
func (*ReadWriteCmdResponse) GetReapQueue ¶
func (m *ReadWriteCmdResponse) GetReapQueue() *ReapQueueResponse
func (*ReadWriteCmdResponse) GetValue ¶
func (this *ReadWriteCmdResponse) GetValue() interface{}
func (*ReadWriteCmdResponse) ProtoMessage ¶
func (*ReadWriteCmdResponse) ProtoMessage()
func (*ReadWriteCmdResponse) Reset ¶
func (m *ReadWriteCmdResponse) Reset()
func (*ReadWriteCmdResponse) SetValue ¶
func (this *ReadWriteCmdResponse) SetValue(value interface{}) bool
func (*ReadWriteCmdResponse) String ¶
func (m *ReadWriteCmdResponse) String() string
type ReapQueueRequest ¶
type ReapQueueRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` // Maximum results to return; must be > 0. MaxResults int64 `protobuf:"varint,2,opt,name=max_results" json:"max_results"` XXX_unrecognized []byte `json:"-"` }
A ReapQueueRequest is arguments to the ReapQueue() method. It specifies the recipient inbox key to which messages are waiting to be reapted and also the maximum number of results to return.
func (*ReapQueueRequest) GetMaxResults ¶
func (m *ReapQueueRequest) GetMaxResults() int64
func (*ReapQueueRequest) ProtoMessage ¶
func (*ReapQueueRequest) ProtoMessage()
func (*ReapQueueRequest) Reset ¶
func (m *ReapQueueRequest) Reset()
func (*ReapQueueRequest) String ¶
func (m *ReapQueueRequest) String() string
type ReapQueueResponse ¶
type ReapQueueResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` Messages []Value `protobuf:"bytes,2,rep,name=messages" json:"messages"` XXX_unrecognized []byte `json:"-"` }
A ReapQueueResponse is the return value from the ReapQueue() method.
func (*ReapQueueResponse) GetMessages ¶
func (m *ReapQueueResponse) GetMessages() []Value
func (*ReapQueueResponse) ProtoMessage ¶
func (*ReapQueueResponse) ProtoMessage()
func (*ReapQueueResponse) Reset ¶
func (m *ReapQueueResponse) Reset()
func (*ReapQueueResponse) String ¶
func (m *ReapQueueResponse) String() string
type RemoteOffset ¶
type RemoteOffset struct { // The estimated offset from the remote server, in nanoseconds. Offset int64 `protobuf:"varint,1,opt,name=offset" json:"offset"` // The maximum error of the measured offset, in nanoseconds. Error int64 `protobuf:"varint,2,opt,name=error" json:"error"` // Measurement time, in nanoseconds from unix epoch. MeasuredAt int64 `protobuf:"varint,3,opt,name=measured_at" json:"measured_at"` XXX_unrecognized []byte `json:"-"` }
RemoteOffset keeps track of this client's estimate of its offset from a remote server. Error is the maximum error in the reading of this offset, so that the real offset should be in the interval [Offset - Error, Offset + Error]. If the last heartbeat timed out, Offset = InfiniteOffset.
Offset and error are measured using the remote clock reading technique described in http://se.inf.tu-dresden.de/pubs/papers/SRDS1994.pdf, page 6.
func (RemoteOffset) Equal ¶
func (r RemoteOffset) Equal(o RemoteOffset) bool
Equal is a equality comparison between remote offsets.
func (*RemoteOffset) GetError ¶
func (m *RemoteOffset) GetError() int64
func (*RemoteOffset) GetMeasuredAt ¶
func (m *RemoteOffset) GetMeasuredAt() int64
func (*RemoteOffset) GetOffset ¶
func (m *RemoteOffset) GetOffset() int64
func (*RemoteOffset) ProtoMessage ¶
func (*RemoteOffset) ProtoMessage()
func (*RemoteOffset) Reset ¶
func (m *RemoteOffset) Reset()
func (*RemoteOffset) String ¶
func (m *RemoteOffset) String() string
type Replica ¶
type Replica struct { NodeID NodeID `protobuf:"varint,1,opt,name=node_id,customtype=NodeID" json:"node_id"` StoreID StoreID `protobuf:"varint,2,opt,name=store_id,customtype=StoreID" json:"store_id"` // Combination of node & store attributes. Attrs Attributes `protobuf:"bytes,3,opt,name=attrs" json:"attrs"` XXX_unrecognized []byte `json:"-"` }
Replica describes a replica location by node ID (corresponds to a host:port via lookup on gossip network), store ID (identifies the device) and associated attributes. Replicas are stored in Range lookup records (meta1, meta2).
func (*Replica) GetAttrs ¶
func (m *Replica) GetAttrs() Attributes
func (*Replica) ProtoMessage ¶
func (*Replica) ProtoMessage()
type ReplicaChangeType ¶
type ReplicaChangeType int32
ReplicaChangeType is a parameter of ChangeReplicasTrigger.
const ( ADD_REPLICA ReplicaChangeType = 0 REMOVE_REPLICA ReplicaChangeType = 1 )
func (ReplicaChangeType) Enum ¶
func (x ReplicaChangeType) Enum() *ReplicaChangeType
func (ReplicaChangeType) String ¶
func (x ReplicaChangeType) String() string
func (*ReplicaChangeType) UnmarshalJSON ¶
func (x *ReplicaChangeType) UnmarshalJSON(data []byte) error
type Request ¶
type Request interface { gogoproto.Message // Header returns the request header. Header() *RequestHeader }
Request is an interface for RPC requests.
func CreateArgs ¶
CreateArgs returns an allocated request according to the specified method.
type RequestHeader ¶
type RequestHeader struct { // Timestamp specifies time at which read or writes should be // performed. If the timestamp is set to zero value, its value // is initialized to the wall time of the receiving node. Timestamp Timestamp `protobuf:"bytes,1,opt,name=timestamp" json:"timestamp"` // CmdID is optionally specified for request idempotence // (i.e. replay protection). CmdID ClientCmdID `protobuf:"bytes,2,opt,name=cmd_id" json:"cmd_id"` // The key for request. If the request operates on a range, this // represents the starting key for the range. Key Key `protobuf:"bytes,3,opt,name=key,customtype=Key" json:"key"` // End key is empty if request spans only a single key. EndKey Key `protobuf:"bytes,4,opt,name=end_key,customtype=Key" json:"end_key"` // User is the originating user. Used to lookup priority when // scheduling queued operations at target node. User string `protobuf:"bytes,5,opt,name=user" json:"user"` // Replica specifies the destination for the request. This is a specific // instance of the available replicas belonging to RangeID. Replica Replica `protobuf:"bytes,6,opt,name=replica" json:"replica"` // RaftID specifies the ID of the Raft consensus group which the key // range belongs to. This is used by the receiving node to route the // request to the correct range. RaftID int64 `protobuf:"varint,7,opt,name=raft_id" json:"raft_id"` // UserPriority specifies priority multiple for non-transactional // commands. This value should be a positive integer [1, 2^31-1). // It's properly viewed as a multiple for how likely this // transaction will be to prevail if a write conflict occurs. // Commands with UserPriority=100 will be 100x less likely to be // aborted as conflicting transactions or non-transactional commands // with UserPriority=1. This value is ignored if Txn is // specified. If neither this value nor Txn is specified, the value // defaults to 1. UserPriority *int32 `protobuf:"varint,8,opt,name=user_priority,def=1" json:"user_priority,omitempty"` // Txn is set non-nil if a transaction is underway. To start a txn, // the first request should set this field to non-nil with name and // isolation level set as desired. The response will contain the // fully-initialized transaction with txn ID, priority, initial // timestamp, and maximum timestamp. Txn *Transaction `protobuf:"bytes,9,opt,name=txn" json:"txn,omitempty"` XXX_unrecognized []byte `json:"-"` }
RequestHeader is supplied with every storage node request.
func (*RequestHeader) GetCmdID ¶
func (m *RequestHeader) GetCmdID() ClientCmdID
func (*RequestHeader) GetRaftID ¶
func (m *RequestHeader) GetRaftID() int64
func (*RequestHeader) GetReplica ¶
func (m *RequestHeader) GetReplica() Replica
func (*RequestHeader) GetTimestamp ¶
func (m *RequestHeader) GetTimestamp() Timestamp
func (*RequestHeader) GetTxn ¶
func (m *RequestHeader) GetTxn() *Transaction
func (*RequestHeader) GetUser ¶
func (m *RequestHeader) GetUser() string
func (*RequestHeader) GetUserPriority ¶
func (m *RequestHeader) GetUserPriority() int32
func (*RequestHeader) Header ¶
func (rh *RequestHeader) Header() *RequestHeader
Header implements the Request interface for RequestHeader.
func (*RequestHeader) ProtoMessage ¶
func (*RequestHeader) ProtoMessage()
func (*RequestHeader) Reset ¶
func (m *RequestHeader) Reset()
func (*RequestHeader) String ¶
func (m *RequestHeader) String() string
type RequestUnion ¶
type RequestUnion struct { Contains *ContainsRequest `protobuf:"bytes,1,opt,name=contains" json:"contains,omitempty"` Get *GetRequest `protobuf:"bytes,2,opt,name=get" json:"get,omitempty"` Put *PutRequest `protobuf:"bytes,3,opt,name=put" json:"put,omitempty"` ConditionalPut *ConditionalPutRequest `protobuf:"bytes,4,opt,name=conditional_put" json:"conditional_put,omitempty"` Increment *IncrementRequest `protobuf:"bytes,5,opt,name=increment" json:"increment,omitempty"` Delete *DeleteRequest `protobuf:"bytes,6,opt,name=delete" json:"delete,omitempty"` DeleteRange *DeleteRangeRequest `protobuf:"bytes,7,opt,name=delete_range" json:"delete_range,omitempty"` Scan *ScanRequest `protobuf:"bytes,8,opt,name=scan" json:"scan,omitempty"` EndTransaction *EndTransactionRequest `protobuf:"bytes,9,opt,name=end_transaction" json:"end_transaction,omitempty"` ReapQueue *ReapQueueRequest `protobuf:"bytes,10,opt,name=reap_queue" json:"reap_queue,omitempty"` EnqueueUpdate *EnqueueUpdateRequest `protobuf:"bytes,11,opt,name=enqueue_update" json:"enqueue_update,omitempty"` EnqueueMessage *EnqueueMessageRequest `protobuf:"bytes,12,opt,name=enqueue_message" json:"enqueue_message,omitempty"` XXX_unrecognized []byte `json:"-"` }
A RequestUnion contains exactly one of the optional requests.
func (*RequestUnion) GetConditionalPut ¶
func (m *RequestUnion) GetConditionalPut() *ConditionalPutRequest
func (*RequestUnion) GetContains ¶
func (m *RequestUnion) GetContains() *ContainsRequest
func (*RequestUnion) GetDelete ¶
func (m *RequestUnion) GetDelete() *DeleteRequest
func (*RequestUnion) GetDeleteRange ¶
func (m *RequestUnion) GetDeleteRange() *DeleteRangeRequest
func (*RequestUnion) GetEndTransaction ¶
func (m *RequestUnion) GetEndTransaction() *EndTransactionRequest
func (*RequestUnion) GetEnqueueMessage ¶
func (m *RequestUnion) GetEnqueueMessage() *EnqueueMessageRequest
func (*RequestUnion) GetEnqueueUpdate ¶
func (m *RequestUnion) GetEnqueueUpdate() *EnqueueUpdateRequest
func (*RequestUnion) GetGet ¶
func (m *RequestUnion) GetGet() *GetRequest
func (*RequestUnion) GetIncrement ¶
func (m *RequestUnion) GetIncrement() *IncrementRequest
func (*RequestUnion) GetPut ¶
func (m *RequestUnion) GetPut() *PutRequest
func (*RequestUnion) GetReapQueue ¶
func (m *RequestUnion) GetReapQueue() *ReapQueueRequest
func (*RequestUnion) GetScan ¶
func (m *RequestUnion) GetScan() *ScanRequest
func (*RequestUnion) GetValue ¶
func (this *RequestUnion) GetValue() interface{}
func (*RequestUnion) ProtoMessage ¶
func (*RequestUnion) ProtoMessage()
func (*RequestUnion) Reset ¶
func (m *RequestUnion) Reset()
func (*RequestUnion) SetValue ¶
func (this *RequestUnion) SetValue(value interface{}) bool
func (*RequestUnion) String ¶
func (m *RequestUnion) String() string
type Response ¶
type Response interface { gogoproto.Message // Header returns the response header. Header() *ResponseHeader // Verify verifies response integrity, as applicable. Verify(req Request) error }
Response is an interface for RPC responses.
func CreateReply ¶
CreateReply returns an allocated response according to the specified method.
type ResponseHeader ¶
type ResponseHeader struct { // Error is non-nil if an error occurred. Error *Error `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` // Timestamp specifies time at which read or write actually was // performed. In the case of both reads and writes, if the timestamp // supplied to the request was 0, the wall time of the node // servicing the request will be set here. Additionally, in the case // of writes, this value may be increased from the timestamp passed // with the RequestHeader if the key being written was either read // or written more recently. Timestamp Timestamp `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp"` // Transaction is non-nil if the request specified a non-nil // transaction. The transaction timestamp and/or priority may have // been updated, depending on the outcome of the request. Txn *Transaction `protobuf:"bytes,3,opt,name=txn" json:"txn,omitempty"` XXX_unrecognized []byte `json:"-"` }
ResponseHeader is returned with every storage node response.
func (*ResponseHeader) Combine ¶
func (rh *ResponseHeader) Combine(otherRH *ResponseHeader)
Combine is used by range-spanning Response types (e.g. Scan or DeleteRange) to merge their headers.
func (*ResponseHeader) GetError ¶
func (m *ResponseHeader) GetError() *Error
func (*ResponseHeader) GetTimestamp ¶
func (m *ResponseHeader) GetTimestamp() Timestamp
func (*ResponseHeader) GetTxn ¶
func (m *ResponseHeader) GetTxn() *Transaction
func (*ResponseHeader) GoError ¶
func (rh *ResponseHeader) GoError() error
GoError returns the non-nil error from the proto.Error union.
func (*ResponseHeader) Header ¶
func (rh *ResponseHeader) Header() *ResponseHeader
Header implements the Response interface for ResponseHeader.
func (*ResponseHeader) ProtoMessage ¶
func (*ResponseHeader) ProtoMessage()
func (*ResponseHeader) Reset ¶
func (m *ResponseHeader) Reset()
func (*ResponseHeader) SetGoError ¶
func (rh *ResponseHeader) SetGoError(err error)
SetGoError converts the specified type into either one of the proto- defined error types or into a GenericError for all other Go errors.
func (*ResponseHeader) String ¶
func (m *ResponseHeader) String() string
func (*ResponseHeader) Verify ¶
func (rh *ResponseHeader) Verify(req Request) error
Verify implements the Response interface for ResopnseHeader with a default noop. Individual response types should override this method if they contain checksummed data which can be verified.
type ResponseUnion ¶
type ResponseUnion struct { Contains *ContainsResponse `protobuf:"bytes,1,opt,name=contains" json:"contains,omitempty"` Get *GetResponse `protobuf:"bytes,2,opt,name=get" json:"get,omitempty"` Put *PutResponse `protobuf:"bytes,3,opt,name=put" json:"put,omitempty"` ConditionalPut *ConditionalPutResponse `protobuf:"bytes,4,opt,name=conditional_put" json:"conditional_put,omitempty"` Increment *IncrementResponse `protobuf:"bytes,5,opt,name=increment" json:"increment,omitempty"` Delete *DeleteResponse `protobuf:"bytes,6,opt,name=delete" json:"delete,omitempty"` DeleteRange *DeleteRangeResponse `protobuf:"bytes,7,opt,name=delete_range" json:"delete_range,omitempty"` Scan *ScanResponse `protobuf:"bytes,8,opt,name=scan" json:"scan,omitempty"` EndTransaction *EndTransactionResponse `protobuf:"bytes,9,opt,name=end_transaction" json:"end_transaction,omitempty"` ReapQueue *ReapQueueResponse `protobuf:"bytes,10,opt,name=reap_queue" json:"reap_queue,omitempty"` EnqueueUpdate *EnqueueUpdateResponse `protobuf:"bytes,11,opt,name=enqueue_update" json:"enqueue_update,omitempty"` EnqueueMessage *EnqueueMessageResponse `protobuf:"bytes,12,opt,name=enqueue_message" json:"enqueue_message,omitempty"` XXX_unrecognized []byte `json:"-"` }
A ResponseUnion contains exactly one of the optional responses.
func (*ResponseUnion) GetConditionalPut ¶
func (m *ResponseUnion) GetConditionalPut() *ConditionalPutResponse
func (*ResponseUnion) GetContains ¶
func (m *ResponseUnion) GetContains() *ContainsResponse
func (*ResponseUnion) GetDelete ¶
func (m *ResponseUnion) GetDelete() *DeleteResponse
func (*ResponseUnion) GetDeleteRange ¶
func (m *ResponseUnion) GetDeleteRange() *DeleteRangeResponse
func (*ResponseUnion) GetEndTransaction ¶
func (m *ResponseUnion) GetEndTransaction() *EndTransactionResponse
func (*ResponseUnion) GetEnqueueMessage ¶
func (m *ResponseUnion) GetEnqueueMessage() *EnqueueMessageResponse
func (*ResponseUnion) GetEnqueueUpdate ¶
func (m *ResponseUnion) GetEnqueueUpdate() *EnqueueUpdateResponse
func (*ResponseUnion) GetGet ¶
func (m *ResponseUnion) GetGet() *GetResponse
func (*ResponseUnion) GetIncrement ¶
func (m *ResponseUnion) GetIncrement() *IncrementResponse
func (*ResponseUnion) GetPut ¶
func (m *ResponseUnion) GetPut() *PutResponse
func (*ResponseUnion) GetReapQueue ¶
func (m *ResponseUnion) GetReapQueue() *ReapQueueResponse
func (*ResponseUnion) GetScan ¶
func (m *ResponseUnion) GetScan() *ScanResponse
func (*ResponseUnion) GetValue ¶
func (this *ResponseUnion) GetValue() interface{}
func (*ResponseUnion) ProtoMessage ¶
func (*ResponseUnion) ProtoMessage()
func (*ResponseUnion) Reset ¶
func (m *ResponseUnion) Reset()
func (*ResponseUnion) SetValue ¶
func (this *ResponseUnion) SetValue(value interface{}) bool
func (*ResponseUnion) String ¶
func (m *ResponseUnion) String() string
type ScanRequest ¶
type ScanRequest struct { RequestHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` // Must be > 0. MaxResults int64 `protobuf:"varint,2,opt,name=max_results" json:"max_results"` XXX_unrecognized []byte `json:"-"` }
A ScanRequest is arguments to the Scan() method. It specifies the start and end keys for the scan and the maximum number of results.
func ScanArgs ¶
func ScanArgs(key, endKey Key, maxResults int64) *ScanRequest
ScanArgs returns a ScanRequest object initialized to scan from start to end keys with max results.
func (*ScanRequest) GetMaxResults ¶
func (m *ScanRequest) GetMaxResults() int64
func (*ScanRequest) ProtoMessage ¶
func (*ScanRequest) ProtoMessage()
func (*ScanRequest) Reset ¶
func (m *ScanRequest) Reset()
func (*ScanRequest) String ¶
func (m *ScanRequest) String() string
type ScanResponse ¶
type ScanResponse struct { ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"` // Empty if no rows were scanned. Rows []KeyValue `protobuf:"bytes,2,rep,name=rows" json:"rows"` XXX_unrecognized []byte `json:"-"` }
A ScanResponse is the return value from the Scan() method.
func (*ScanResponse) Combine ¶
func (sr *ScanResponse) Combine(c Response)
Combine implements the Combinable interface for ScanResponse.
func (*ScanResponse) GetRows ¶
func (m *ScanResponse) GetRows() []KeyValue
func (*ScanResponse) ProtoMessage ¶
func (*ScanResponse) ProtoMessage()
func (*ScanResponse) Reset ¶
func (m *ScanResponse) Reset()
func (*ScanResponse) String ¶
func (m *ScanResponse) String() string
func (*ScanResponse) Verify ¶
func (sr *ScanResponse) Verify(req Request) error
Verify verifies the integrity of every value returned in the scan.
type SplitTrigger ¶
type SplitTrigger struct { UpdatedDesc RangeDescriptor `protobuf:"bytes,1,opt,name=updated_desc" json:"updated_desc"` NewDesc RangeDescriptor `protobuf:"bytes,2,opt,name=new_desc" json:"new_desc"` XXX_unrecognized []byte `json:"-"` }
A SplitTrigger is run after a successful commit of an AdminSplit command. It provides the updated range descriptor covering the first half of the split and the new range descriptor covering the second half. This information allows the final bookkeeping for the split to be completed and the new range put into operation.
func (*SplitTrigger) GetNewDesc ¶
func (m *SplitTrigger) GetNewDesc() RangeDescriptor
func (*SplitTrigger) GetUpdatedDesc ¶
func (m *SplitTrigger) GetUpdatedDesc() RangeDescriptor
func (*SplitTrigger) ProtoMessage ¶
func (*SplitTrigger) ProtoMessage()
func (*SplitTrigger) Reset ¶
func (m *SplitTrigger) Reset()
func (*SplitTrigger) String ¶
func (m *SplitTrigger) String() string
type StoreID ¶
type StoreID int32
StoreID is a custom type for a cockroach store ID.
type StoreIdent ¶
type StoreIdent struct { ClusterID string `protobuf:"bytes,1,opt,name=cluster_id" json:"cluster_id"` NodeID NodeID `protobuf:"varint,2,opt,name=node_id,customtype=NodeID" json:"node_id"` StoreID StoreID `protobuf:"varint,3,opt,name=store_id,customtype=StoreID" json:"store_id"` XXX_unrecognized []byte `json:"-"` }
A StoreIdent uniquely identifies a store in the cluster. The StoreIdent is written to the underlying storage engine at a store-reserved system key (KeyLocalIdent).
func (*StoreIdent) GetClusterID ¶
func (m *StoreIdent) GetClusterID() string
func (*StoreIdent) ProtoMessage ¶
func (*StoreIdent) ProtoMessage()
func (*StoreIdent) Reset ¶
func (m *StoreIdent) Reset()
func (*StoreIdent) String ¶
func (m *StoreIdent) String() string
type TimeSeriesData ¶
type TimeSeriesData struct { // A string which uniquely identifies the variable from which this data was // measured. Name string `protobuf:"bytes,1,opt,name=name" json:"name"` // Datapoints representing one or more measurements taken from the variable. Datapoints []*TimeSeriesDatapoint `protobuf:"bytes,2,rep,name=datapoints" json:"datapoints,omitempty"` XXX_unrecognized []byte `json:"-"` }
TimeSeriesData is a set of observations of a single variable value at multiple points in time. This message contains a string which uniquely identifies the source variable, and a repeated set of TimeSeriesDatapoint messages representing distinct measurements of that variable.
func (*TimeSeriesData) GetDatapoints ¶
func (m *TimeSeriesData) GetDatapoints() []*TimeSeriesDatapoint
func (*TimeSeriesData) GetName ¶
func (m *TimeSeriesData) GetName() string
func (*TimeSeriesData) ProtoMessage ¶
func (*TimeSeriesData) ProtoMessage()
func (*TimeSeriesData) Reset ¶
func (m *TimeSeriesData) Reset()
func (*TimeSeriesData) String ¶
func (m *TimeSeriesData) String() string
func (TimeSeriesData) ToInternal ¶
func (ts TimeSeriesData) ToInternal(keyDuration int64, sampleDuration int64) ( []*InternalTimeSeriesData, error)
ToInternal places the datapoints in a TimeSeriesData message into one or more InternalTimeSeriesData messages. The structure and number of messages returned depends on two variables: a key duration, and a sample duration.
The key duration is an interval length in nanoseconds used to determine how many intervals are grouped into a single InternalTimeSeriesData message.
The sample duration is also an interval length in nanoseconds; it must be less than or equal to the key duration, and must also evenly divide the key duration. Datapoints which fall into the same sample interval will be aggregated together into a single Sample.
Example: Assume the desired result is to aggregate individual datapoints into the same sample if they occurred within the same second; additionally, all samples which occur within the same hour should be stored at the same key location within the same InternalTimeSeriesValue. The sample duration should be 10^9 nanoseconds (value of time.Second), and the key duration should be (3600*10^9) nanoseconds (value of time.Hour).
Note that this method does not accumulate data into individual samples in the case where multiple datapoints fall into the same sample period. Internal data should be merged into the cockroach data store before being read; the engine is responsible for accumulating samples.
The returned slice of InternalTimeSeriesData objects will not be sorted.
For more information on how time series data is stored, see InternalTimeSeriesData and its related structures.
func (*TimeSeriesData) Unmarshal ¶
func (m *TimeSeriesData) Unmarshal(data []byte) error
type TimeSeriesDatapoint ¶
type TimeSeriesDatapoint struct { // The timestamp when this datapoint is located, expressed in nanoseconds // since the unix epoch. TimestampNanos int64 `protobuf:"varint,1,opt,name=timestamp_nanos" json:"timestamp_nanos"` // An integer representation of the value of this datapoint. If this field // is set, then 'float_value' must not be set. IntValue *int64 `protobuf:"varint,2,opt,name=int_value" json:"int_value,omitempty"` // A floating point representation of the value of this datapoint. If this // field is set, then 'int_value' must not be set. FloatValue *float32 `protobuf:"fixed32,3,opt,name=float_value" json:"float_value,omitempty"` XXX_unrecognized []byte `json:"-"` }
TimeSeriesDatapoint is a single point of time series data; a value associated with a timestamp.
func (*TimeSeriesDatapoint) GetFloatValue ¶
func (m *TimeSeriesDatapoint) GetFloatValue() float32
func (*TimeSeriesDatapoint) GetIntValue ¶
func (m *TimeSeriesDatapoint) GetIntValue() int64
func (*TimeSeriesDatapoint) GetTimestampNanos ¶
func (m *TimeSeriesDatapoint) GetTimestampNanos() int64
func (*TimeSeriesDatapoint) ProtoMessage ¶
func (*TimeSeriesDatapoint) ProtoMessage()
func (*TimeSeriesDatapoint) Reset ¶
func (m *TimeSeriesDatapoint) Reset()
func (*TimeSeriesDatapoint) String ¶
func (m *TimeSeriesDatapoint) String() string
func (*TimeSeriesDatapoint) Unmarshal ¶
func (m *TimeSeriesDatapoint) Unmarshal(data []byte) error
type Timestamp ¶
type Timestamp struct { // Holds a wall time, typically a unix epoch time // expressed in nanoseconds. WallTime int64 `protobuf:"varint,1,opt,name=wall_time" json:"wall_time"` // The logical component captures causality for events whose wall // times are equal. It is effectively bounded by (maximum clock // skew)/(minimal ns between events) and nearly impossible to // overflow. Logical int32 `protobuf:"varint,2,opt,name=logical" json:"logical"` XXX_unrecognized []byte `json:"-"` }
Timestamp represents a state of the hybrid logical clock.
func (*Timestamp) Backward ¶
Backward updates the timestamp from the one given, if that moves it backwards in time.
func (*Timestamp) Forward ¶
Forward updates the timestamp from the one given, if that moves it forwards in time.
func (*Timestamp) GetLogical ¶
func (*Timestamp) GetWallTime ¶
func (Timestamp) Less ¶
Less implements the util.Ordered interface, allowing the comparison of timestamps.
func (*Timestamp) ProtoMessage ¶
func (*Timestamp) ProtoMessage()
type Transaction ¶
type Transaction struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name"` // Key is the key which anchors the transaction. This is typically // the first key read or written during the transaction and // determines which range in the cluster will hold the transaction // record. Key Key `protobuf:"bytes,2,opt,name=key,customtype=Key" json:"key"` // ID is a unique UUID value which identifies the transaction. ID []byte `protobuf:"bytes,3,opt,name=id" json:"id"` Priority int32 `protobuf:"varint,4,opt,name=priority" json:"priority"` Isolation IsolationType `protobuf:"varint,5,opt,name=isolation,enum=cockroach.proto.IsolationType" json:"isolation"` Status TransactionStatus `protobuf:"varint,6,opt,name=status,enum=cockroach.proto.TransactionStatus" json:"status"` // Incremented on txn retry. Epoch int32 `protobuf:"varint,7,opt,name=epoch" json:"epoch"` // The last heartbeat timestamp. LastHeartbeat *Timestamp `protobuf:"bytes,8,opt,name=last_heartbeat" json:"last_heartbeat,omitempty"` // The proposed timestamp for the transaction. This starts as // the current wall time on the txn coordinator. Timestamp Timestamp `protobuf:"bytes,9,opt,name=timestamp" json:"timestamp"` // The original timestamp at which the transaction started. For serializable // transactions, if the timestamp drifts from the original timestamp, the // transaction will retry. OrigTimestamp Timestamp `protobuf:"bytes,10,opt,name=orig_timestamp" json:"orig_timestamp"` // Initial Timestamp + clock skew. Reads which encounter values with // timestamps between Timestamp and MaxTimestamp trigger a txn // retry error, unless the node being read is listed in nodes_read // (in which case no more read uncertainty can occur). // The case MaxTimestamp < Timestamp is possible for transactions which have // been pushed; in this case, MaxTimestamp should be ignored. MaxTimestamp Timestamp `protobuf:"bytes,11,opt,name=max_timestamp" json:"max_timestamp"` // A sorted list of ids of nodes for which a ReadWithinUncertaintyIntervalError // occurred during a prior read. The purpose of keeping this information is // that as a reaction to this error, the transaction's timestamp is forwarded // appropriately to reflect that node's clock uncertainty. Future reads to // the same node are therefore freed from uncertainty restarts. // // The exact mechanism is that upon encountering the above error, the trans- // action will have to retry with a higher timestamp. This higher timestamp // is either the one of the encountered future write returned in the error // or (if higher, which is in the majority of cases), the time of the node // serving the key at the time of the failed read. // Additionally storing the node, we make sure to set MaxTimestamp=Timestamp // at the time of the read for nodes whose clock we've taken into acount, // which amounts to reading without any uncertainty. // // Bits of this mechanism are found in the local sender, the range and the // txn_coord_sender, with brief comments referring here. // See https://github.com/cockroachdb/cockroach/pull/221. CertainNodes NodeList `protobuf:"bytes,12,opt,name=certain_nodes" json:"certain_nodes"` XXX_unrecognized []byte `json:"-"` }
A Transaction is a unit of work performed on the database. Cockroach transactions support two isolation levels: snapshot isolation and serializable snapshot isolation. Each Cockroach transaction is assigned a random priority. This priority will be used to decide whether a transaction will be aborted during contention.
func NewTransaction ¶
func NewTransaction(name string, baseKey Key, userPriority int32, isolation IsolationType, now Timestamp, maxOffset int64) *Transaction
NewTransaction creates a new transaction. The transaction key is composed using the specified baseKey (for locality with data affected by the transaction) and a random UUID to guarantee uniqueness. The specified user-level priority is combined with a randomly chosen value to yield a final priority, used to settle write conflicts in a way that avoids starvation of long-running transactions (see Range.InternalPushTxn).
func (*Transaction) GetCertainNodes ¶
func (m *Transaction) GetCertainNodes() NodeList
func (*Transaction) GetEpoch ¶
func (m *Transaction) GetEpoch() int32
func (*Transaction) GetID ¶
func (m *Transaction) GetID() []byte
func (*Transaction) GetIsolation ¶
func (m *Transaction) GetIsolation() IsolationType
func (*Transaction) GetLastHeartbeat ¶
func (m *Transaction) GetLastHeartbeat() *Timestamp
func (*Transaction) GetMaxTimestamp ¶
func (m *Transaction) GetMaxTimestamp() Timestamp
func (*Transaction) GetName ¶
func (m *Transaction) GetName() string
func (*Transaction) GetOrigTimestamp ¶
func (m *Transaction) GetOrigTimestamp() Timestamp
func (*Transaction) GetPriority ¶
func (m *Transaction) GetPriority() int32
func (*Transaction) GetStatus ¶
func (m *Transaction) GetStatus() TransactionStatus
func (*Transaction) GetTimestamp ¶
func (m *Transaction) GetTimestamp() Timestamp
func (*Transaction) MD5 ¶
func (t *Transaction) MD5() [md5.Size]byte
MD5 returns the MD5 digest of the transaction ID. This method returns an empty string if the transaction is nil.
func (*Transaction) ProtoMessage ¶
func (*Transaction) ProtoMessage()
func (*Transaction) Reset ¶
func (m *Transaction) Reset()
func (*Transaction) Restart ¶
func (t *Transaction) Restart(userPriority, upgradePriority int32, timestamp Timestamp)
Restart reconfigures a transaction for restart. The epoch is incremented for an in-place restart. The timestamp of the transaction on restart is set to the maximum of the transaction's timestamp and the specified timestamp.
func (Transaction) String ¶
func (t Transaction) String() string
String formats transaction into human readable string.
func (*Transaction) Unmarshal ¶
func (m *Transaction) Unmarshal(data []byte) error
func (*Transaction) Update ¶
func (t *Transaction) Update(o *Transaction)
Update ratchets priority, timestamp and original timestamp values (among others) for the transaction. If t.ID is empty, then the transaction is copied from o.
func (*Transaction) UpgradePriority ¶
func (t *Transaction) UpgradePriority(minPriority int32)
UpgradePriority sets transaction priority to the maximum of current priority and the specified minPriority.
type TransactionAbortedError ¶
type TransactionAbortedError struct { Txn Transaction `protobuf:"bytes,1,opt,name=txn" json:"txn"` XXX_unrecognized []byte `json:"-"` }
A TransactionAbortedError indicates that the transaction was aborted by another concurrent transaction.
func NewTransactionAbortedError ¶
func NewTransactionAbortedError(txn *Transaction) *TransactionAbortedError
NewTransactionAbortedError initializes a new TransactionAbortedError.
func (*TransactionAbortedError) Error ¶
func (e *TransactionAbortedError) Error() string
Error formats error.
func (*TransactionAbortedError) GetTxn ¶
func (m *TransactionAbortedError) GetTxn() Transaction
func (*TransactionAbortedError) ProtoMessage ¶
func (*TransactionAbortedError) ProtoMessage()
func (*TransactionAbortedError) Reset ¶
func (m *TransactionAbortedError) Reset()
func (*TransactionAbortedError) String ¶
func (m *TransactionAbortedError) String() string
type TransactionPushError ¶
type TransactionPushError struct { // txn can be null in the event the push error happened to a // non-transactional method. Txn *Transaction `protobuf:"bytes,1,opt,name=txn" json:"txn,omitempty"` PusheeTxn Transaction `protobuf:"bytes,2,opt,name=pushee_txn" json:"pushee_txn"` XXX_unrecognized []byte `json:"-"` }
A TransactionPushError indicates that the transaction could not continue because it encountered a write intent from another transaction which it was unable to push.
func NewTransactionPushError ¶
func NewTransactionPushError(txn, pusheeTxn *Transaction) *TransactionPushError
NewTransactionPushError initializes a new TransactionPushError. Txn is the transaction which will be retried.
func (*TransactionPushError) Error ¶
func (e *TransactionPushError) Error() string
Error formats error.
func (*TransactionPushError) GetPusheeTxn ¶
func (m *TransactionPushError) GetPusheeTxn() Transaction
func (*TransactionPushError) GetTxn ¶
func (m *TransactionPushError) GetTxn() *Transaction
func (*TransactionPushError) ProtoMessage ¶
func (*TransactionPushError) ProtoMessage()
func (*TransactionPushError) Reset ¶
func (m *TransactionPushError) Reset()
func (*TransactionPushError) String ¶
func (m *TransactionPushError) String() string
type TransactionRetryError ¶
type TransactionRetryError struct { Txn Transaction `protobuf:"bytes,1,opt,name=txn" json:"txn"` XXX_unrecognized []byte `json:"-"` }
A TransactionRetryError indicates that the transaction must be retried, usually with an increased transaction timestamp. The transaction struct to use is returned with the error.
func NewTransactionRetryError ¶
func NewTransactionRetryError(txn *Transaction) *TransactionRetryError
NewTransactionRetryError initializes a new TransactionRetryError. Txn is the transaction which will be retried.
func (*TransactionRetryError) Error ¶
func (e *TransactionRetryError) Error() string
Error formats error.
func (*TransactionRetryError) GetTxn ¶
func (m *TransactionRetryError) GetTxn() Transaction
func (*TransactionRetryError) ProtoMessage ¶
func (*TransactionRetryError) ProtoMessage()
func (*TransactionRetryError) Reset ¶
func (m *TransactionRetryError) Reset()
func (*TransactionRetryError) String ¶
func (m *TransactionRetryError) String() string
type TransactionStatus ¶
type TransactionStatus int32
TransactionStatus specifies possible states for a transaction.
const ( // PENDING is the default state for a new transaction. Transactions // move from PENDING to one of COMMITTED or ABORTED. Mutations made // as part of a PENDING transactions are recorded as "intents" in // the underlying MVCC model. PENDING TransactionStatus = 0 // COMMITTED is the state for a transaction which has been // committed. Mutations made as part of a transaction which is moved // into COMMITTED state become durable and visible to other // transactions, moving from "intents" to permanent versioned // values. COMMITTED TransactionStatus = 1 // ABORTED is the state for a transaction which has been aborted. // Mutations made as part of a transaction which is moved into // ABORTED state are deleted and are never made visible to other // transactions. ABORTED TransactionStatus = 2 )
func (TransactionStatus) Enum ¶
func (x TransactionStatus) Enum() *TransactionStatus
func (TransactionStatus) String ¶
func (x TransactionStatus) String() string
func (*TransactionStatus) UnmarshalJSON ¶
func (x *TransactionStatus) UnmarshalJSON(data []byte) error
type TransactionStatusError ¶
type TransactionStatusError struct { Txn Transaction `protobuf:"bytes,1,opt,name=txn" json:"txn"` Msg string `protobuf:"bytes,2,opt,name=msg" json:"msg"` XXX_unrecognized []byte `json:"-"` }
A TransactionStatusError indicates that the transaction status is incompatible with the requested operation. This might mean the transaction has already been committed. It might also be the case that the request to modify the transaction failed due to a regression in transaction epoch or timestamp, both of which may only monotonically increase.
func NewTransactionStatusError ¶
func NewTransactionStatusError(txn *Transaction, msg string) *TransactionStatusError
NewTransactionStatusError initializes a new TransactionStatusError.
func (*TransactionStatusError) Error ¶
func (e *TransactionStatusError) Error() string
Error formats error.
func (*TransactionStatusError) GetMsg ¶
func (m *TransactionStatusError) GetMsg() string
func (*TransactionStatusError) GetTxn ¶
func (m *TransactionStatusError) GetTxn() Transaction
func (*TransactionStatusError) ProtoMessage ¶
func (*TransactionStatusError) ProtoMessage()
func (*TransactionStatusError) Reset ¶
func (m *TransactionStatusError) Reset()
func (*TransactionStatusError) String ¶
func (m *TransactionStatusError) String() string
type Value ¶
type Value struct { // Bytes is the byte slice value. If this field is set, the integer field // should not be. Bytes []byte `protobuf:"bytes,1,opt,name=bytes" json:"bytes,omitempty"` // Integer is an integer value type. If this field is set, the bytes field // should not be. Only Integer values may exist at a key when making the // Increment API call. Integer *int64 `protobuf:"varint,2,opt,name=integer" json:"integer,omitempty"` // Checksum is a CRC-32-IEEE checksum of the key + value, in that order. // If this is an integer value, then the value is interpreted as an 8 // byte, big-endian encoded value. This value is set by the client on // writes to do end-to-end integrity verification. If the checksum is // incorrect, the write operation will fail. If the client does not // wish to use end-to-end checksumming, this value should be nil. Checksum *uint32 `protobuf:"fixed32,3,opt,name=checksum" json:"checksum,omitempty"` // Timestamp of value. Timestamp *Timestamp `protobuf:"bytes,4,opt,name=timestamp" json:"timestamp,omitempty"` // Tag is an optional string value which can be used to add additional // metadata to this value. For example, Tag might provide information on how // the bytes in the "bytes" field should be interpreted. Tag *string `protobuf:"bytes,5,opt,name=tag" json:"tag,omitempty"` XXX_unrecognized []byte `json:"-"` }
Value specifies the value at a key. Multiple values at the same key are supported based on timestamp. Values support the union of two basic types: a "bag o' bytes" generic byte slice and an incrementable int64, for use with the Increment API call.
func (*Value) GetChecksum ¶
func (*Value) GetInteger ¶
func (*Value) GetTimestamp ¶
func (*Value) InitChecksum ¶
InitChecksum initializes a checksum based on the provided key and the contents of the value. If the value contains a byte slice, the checksum includes it directly; if the value contains an integer, the checksum includes the integer as 8 bytes in big-endian order.
func (*Value) ProtoMessage ¶
func (*Value) ProtoMessage()
type WriteIntentError ¶
type WriteIntentError struct { Key Key `protobuf:"bytes,1,opt,name=key,customtype=Key" json:"key"` Txn Transaction `protobuf:"bytes,2,opt,name=txn" json:"txn"` Resolved bool `protobuf:"varint,3,opt,name=resolved" json:"resolved"` XXX_unrecognized []byte `json:"-"` }
A WriteIntentError indicates that a write intent belonging to another transaction was encountered leading to a read/write or write/write conflict. The Key at which the intent was encountered is set, as is the Txn record for the intent's transaction. Resolved is set if the intent was successfully resolved, meaning the client may retry the operation immediately. If Resolved is false, the client should back off and retry.
func (*WriteIntentError) GetResolved ¶
func (m *WriteIntentError) GetResolved() bool
func (*WriteIntentError) GetTxn ¶
func (m *WriteIntentError) GetTxn() Transaction
func (*WriteIntentError) ProtoMessage ¶
func (*WriteIntentError) ProtoMessage()
func (*WriteIntentError) Reset ¶
func (m *WriteIntentError) Reset()
func (*WriteIntentError) String ¶
func (m *WriteIntentError) String() string
type WriteTooOldError ¶
type WriteTooOldError struct { Timestamp Timestamp `protobuf:"bytes,1,opt,name=timestamp" json:"timestamp"` ExistingTimestamp Timestamp `protobuf:"bytes,2,opt,name=existing_timestamp" json:"existing_timestamp"` XXX_unrecognized []byte `json:"-"` }
A WriteTooOldError indicates that a write encountered a versioned value newer than its timestamp, making it impossible to rewrite history. The write should be retried at existing_timestamp+1.
func (*WriteTooOldError) GetExistingTimestamp ¶
func (m *WriteTooOldError) GetExistingTimestamp() Timestamp
func (*WriteTooOldError) GetTimestamp ¶
func (m *WriteTooOldError) GetTimestamp() Timestamp
func (*WriteTooOldError) ProtoMessage ¶
func (*WriteTooOldError) ProtoMessage()
func (*WriteTooOldError) Reset ¶
func (m *WriteTooOldError) Reset()
func (*WriteTooOldError) String ¶
func (m *WriteTooOldError) String() string
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 []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"` XXX_unrecognized []byte `json:"-"` }
ZoneConfig holds configuration that is needed for a range of KV pairs.
func (*ZoneConfig) GetGC ¶
func (m *ZoneConfig) GetGC() *GCPolicy
func (*ZoneConfig) GetRangeMaxBytes ¶
func (m *ZoneConfig) GetRangeMaxBytes() int64
func (*ZoneConfig) GetRangeMinBytes ¶
func (m *ZoneConfig) GetRangeMinBytes() int64
func (*ZoneConfig) GetReplicaAttrs ¶
func (m *ZoneConfig) GetReplicaAttrs() []Attributes
func (*ZoneConfig) ProtoMessage ¶
func (*ZoneConfig) ProtoMessage()
func (*ZoneConfig) Reset ¶
func (m *ZoneConfig) Reset()
func (*ZoneConfig) String ¶
func (m *ZoneConfig) String() string