roachpb

package
Version: v0.0.0-...-d55f3a2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2015 License: Apache-2.0 Imports: 19 Imported by: 0

README

Cockroach Protocol buffers

Hacking

Use the associated .go files to add functionality to the generated code.

Other references to Go code generation:

Documentation

Overview

Package roachpb is a generated protocol buffer package.

It is generated from these files:

cockroach/roachpb/api.proto
cockroach/roachpb/data.proto
cockroach/roachpb/errors.proto
cockroach/roachpb/internal.proto
cockroach/roachpb/metadata.proto

It has these top-level messages:

ClientCmdID
Span
ResponseHeader
GetRequest
GetResponse
PutRequest
PutResponse
ConditionalPutRequest
ConditionalPutResponse
IncrementRequest
IncrementResponse
DeleteRequest
DeleteResponse
DeleteRangeRequest
DeleteRangeResponse
ScanRequest
ScanResponse
ReverseScanRequest
ReverseScanResponse
EndTransactionRequest
EndTransactionResponse
AdminSplitRequest
AdminSplitResponse
AdminMergeRequest
AdminMergeResponse
RangeLookupRequest
RangeLookupResponse
HeartbeatTxnRequest
HeartbeatTxnResponse
GCRequest
GCResponse
PushTxnRequest
PushTxnResponse
ResolveIntentRequest
ResolveIntentResponse
ResolveIntentRangeRequest
NoopResponse
NoopRequest
ResolveIntentRangeResponse
MergeRequest
MergeResponse
TruncateLogRequest
TruncateLogResponse
LeaderLeaseRequest
LeaderLeaseResponse
RequestUnion
ResponseUnion
Header
BatchRequest
BatchResponse
Timestamp
Value
KeyValue
RawKeyValue
StoreIdent
SplitTrigger
MergeTrigger
ChangeReplicasTrigger
ModifiedSpanTrigger
InternalCommitTrigger
NodeList
Transaction
Lease
Intent
GCMetadata
NotLeaderError
NodeUnavailableError
RangeNotFoundError
RangeKeyMismatchError
ReadWithinUncertaintyIntervalError
TransactionAbortedError
TransactionPushError
TransactionRetryError
TransactionStatusError
WriteIntentError
WriteTooOldError
OpRequiresTxnError
ConditionFailedError
LeaseRejectedError
SendError
ErrorDetail
ErrPosition
Error
RaftCommand
InternalTimeSeriesData
InternalTimeSeriesSample
RaftTruncatedState
RaftTombstone
RaftSnapshotData
Attributes
ReplicaDescriptor
RangeDescriptor
RangeTree
RangeTreeNode
StoreCapacity
NodeDescriptor
StoreDescriptor

Index

Constants

View Source
const (
	// KeyMaxLength is the maximum length of a Key in bytes.
	KeyMaxLength = 4096
	// MaxPriority is the maximum allowed priority.
	MaxPriority = math.MaxInt32
)
View Source
const Default_Header_UserPriority int32 = 1

Variables

View Source
var (
	ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowApi   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	// RKeyMin is a minimum key value which sorts before all other keys.
	RKeyMin = RKey("")
	// KeyMin is a minimum key value which sorts before all other keys.
	KeyMin = Key(RKeyMin)
	// RKeyMax is a maximum key value which sorts after all other keys.
	RKeyMax = RKey{0xff, 0xff}
	// KeyMax is a maximum key value which sorts after all other keys.
	KeyMax = Key(RKeyMax)
)
View Source
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}
)

Timestamp constant values.

View Source
var (
	ErrInvalidLengthData = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowData   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	ErrInvalidLengthErrors = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowErrors   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	ErrInvalidLengthInternal = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowInternal   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	ErrInvalidLengthMetadata = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMetadata   = fmt.Errorf("proto: integer overflow")
)
View Source
var IsolationType_name = map[int32]string{
	0: "SERIALIZABLE",
	1: "SNAPSHOT",
}
View Source
var IsolationType_value = map[string]int32{
	"SERIALIZABLE": 0,
	"SNAPSHOT":     1,
}
View Source
var PushTxnType_name = map[int32]string{
	0: "PUSH_TIMESTAMP",
	1: "ABORT_TXN",
	2: "CLEANUP_TXN",
}
View Source
var PushTxnType_value = map[string]int32{
	"PUSH_TIMESTAMP": 0,
	"ABORT_TXN":      1,
	"CLEANUP_TXN":    2,
}
View Source
var ReadConsistencyType_name = map[int32]string{
	0: "CONSISTENT",
	1: "CONSENSUS",
	2: "INCONSISTENT",
}
View Source
var ReadConsistencyType_value = map[string]int32{
	"CONSISTENT":   0,
	"CONSENSUS":    1,
	"INCONSISTENT": 2,
}
View Source
var ReplicaChangeType_name = map[int32]string{
	0: "ADD_REPLICA",
	1: "REMOVE_REPLICA",
}
View Source
var ReplicaChangeType_value = map[string]int32{
	"ADD_REPLICA":    0,
	"REMOVE_REPLICA": 1,
}
View Source
var TransactionRestart_name = map[int32]string{
	0: "ABORT",
	1: "BACKOFF",
	2: "IMMEDIATE",
}
View Source
var TransactionRestart_value = map[string]int32{
	"ABORT":     0,
	"BACKOFF":   1,
	"IMMEDIATE": 2,
}
View Source
var TransactionStatus_name = map[int32]string{
	0: "PENDING",
	1: "COMMITTED",
	2: "ABORTED",
}
View Source
var TransactionStatus_value = map[string]int32{
	"PENDING":   0,
	"COMMITTED": 1,
	"ABORTED":   2,
}
View Source
var ValueType_name = map[int32]string{
	0:   "UNKNOWN",
	1:   "INT",
	2:   "FLOAT",
	3:   "BYTES",
	4:   "TIME",
	100: "TIMESERIES",
}
View Source
var ValueType_value = map[string]int32{
	"UNKNOWN":    0,
	"INT":        1,
	"FLOAT":      2,
	"BYTES":      3,
	"TIME":       4,
	"TIMESERIES": 100,
}

Functions

func ErrorUnexpectedlySet

func ErrorUnexpectedlySet(culprit, response interface{}) string

ErrorUnexpectedlySet creates a string to panic with when a response (typically a roachpb.BatchResponse) unexpectedly has Error set in its response header.

func IsRange

func IsRange(args Request) bool

IsRange returns true if the operation is range-based and must include a start and an end key.

func IsReadOnly

func IsReadOnly(args Request) bool

IsReadOnly returns true iff the request is read-only.

func IsTransactionWrite

func IsTransactionWrite(args Request) bool

IsTransactionWrite returns true if the request produces write intents when used within a transaction.

func MakeKey

func MakeKey(keys ...[]byte) []byte

MakeKey makes a new key which is the concatenation of the given inputs, in order.

func MakePriority

func MakePriority(userPriority int32) int32

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 TxnIDEqual

func TxnIDEqual(a, b []byte) bool

TxnIDEqual returns whether the transaction IDs are equal.

Types

type AdminMergeRequest

type AdminMergeRequest struct {
	Span `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
}

An AdminMergeRequest is the argument to the AdminMerge() method. A merge is performed by calling AdminMerge on the left-hand range of two consecutive ranges (i.e. the range which contains keys which sort first). This range will be the subsuming range and the right hand range will be 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. If AdminMerge is called on the final range in the key space, it is a noop.

func (*AdminMergeRequest) CreateReply

func (*AdminMergeRequest) CreateReply() Response

CreateReply implements the Request interface.

func (*AdminMergeRequest) Marshal

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

func (*AdminMergeRequest) MarshalTo

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

func (*AdminMergeRequest) Method

func (*AdminMergeRequest) Method() Method

Method implements the Request interface.

func (*AdminMergeRequest) ProtoMessage

func (*AdminMergeRequest) ProtoMessage()

func (*AdminMergeRequest) Reset

func (m *AdminMergeRequest) Reset()

func (*AdminMergeRequest) Size

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

func (*AdminMergeRequest) String

func (m *AdminMergeRequest) String() string

func (*AdminMergeRequest) Unmarshal

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

type AdminMergeResponse

type AdminMergeResponse struct {
	ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
}

An AdminMergeResponse is the return value from the AdminMerge() method.

func (*AdminMergeResponse) Marshal

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

func (*AdminMergeResponse) MarshalTo

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

func (*AdminMergeResponse) ProtoMessage

func (*AdminMergeResponse) ProtoMessage()

func (*AdminMergeResponse) Reset

func (m *AdminMergeResponse) Reset()

func (*AdminMergeResponse) Size

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

func (*AdminMergeResponse) String

func (m *AdminMergeResponse) String() string

func (*AdminMergeResponse) Unmarshal

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

type AdminSplitRequest

type AdminSplitRequest struct {
	Span     `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
	SplitKey Key `protobuf:"bytes,2,opt,name=split_key,casttype=Key" json:"split_key,omitempty"`
}

An AdminSplitRequest is the argument to the AdminSplit() method. The existing range which contains Span.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) CreateReply

func (*AdminSplitRequest) CreateReply() Response

CreateReply implements the Request interface.

func (*AdminSplitRequest) GetSplitKey

func (m *AdminSplitRequest) GetSplitKey() Key

func (*AdminSplitRequest) Marshal

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

func (*AdminSplitRequest) MarshalTo

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

func (*AdminSplitRequest) Method

func (*AdminSplitRequest) Method() Method

Method implements the Request interface.

func (*AdminSplitRequest) ProtoMessage

func (*AdminSplitRequest) ProtoMessage()

func (*AdminSplitRequest) Reset

func (m *AdminSplitRequest) Reset()

func (*AdminSplitRequest) Size

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

func (*AdminSplitRequest) String

func (m *AdminSplitRequest) String() string

func (*AdminSplitRequest) Unmarshal

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

type AdminSplitResponse

type AdminSplitResponse struct {
	ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
}

An AdminSplitResponse is the return value from the AdminSplit() method.

func (*AdminSplitResponse) Marshal

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

func (*AdminSplitResponse) MarshalTo

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

func (*AdminSplitResponse) ProtoMessage

func (*AdminSplitResponse) ProtoMessage()

func (*AdminSplitResponse) Reset

func (m *AdminSplitResponse) Reset()

func (*AdminSplitResponse) Size

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

func (*AdminSplitResponse) String

func (m *AdminSplitResponse) String() string

func (*AdminSplitResponse) Unmarshal

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

type Attributes

type Attributes struct {
	Attrs []string `protobuf:"bytes,1,rep,name=attrs" json:"attrs,omitempty" yaml:"attrs,flow"`
}

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

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

func (*Attributes) MarshalTo

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

func (*Attributes) ProtoMessage

func (*Attributes) ProtoMessage()

func (*Attributes) Reset

func (m *Attributes) Reset()

func (*Attributes) Size

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

func (Attributes) SortedString

func (a Attributes) SortedString() string

SortedString returns a sorted, de-duplicated, comma-separated list of the attributes.

func (Attributes) String

func (a Attributes) String() string

func (*Attributes) Unmarshal

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

type BatchRequest

type BatchRequest struct {
	Header   `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
	Requests []RequestUnion `protobuf:"bytes,2,rep,name=requests" json:"requests"`
}

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.

The Span should contain the Key of the first request in the batch. It also contains the transaction itself; individual calls must not have transactions specified. The same applies to the User and UserPriority fields.

func (*BatchRequest) Add

func (ba *BatchRequest) Add(requests ...Request)

Add adds a request to the batch request.

func (*BatchRequest) CreateReply

func (ba *BatchRequest) CreateReply() *BatchResponse

CreateReply implements the Request interface. It's slightly different from the other implementations: It creates replies for each of the contained requests, wrapped in a BatchResponse.

func (*BatchRequest) GetArg

func (ba *BatchRequest) GetArg(method Method) (Request, bool)

GetArg returns the first request of the given type, if possible.

func (*BatchRequest) GetIntents

func (ba *BatchRequest) GetIntents() []Intent

GetIntents returns a slice of key pairs corresponding to transactional writes contained in the batch. TODO(tschottdorf): use roachpb.Span here instead of []Intent. Actually Intent should be Intents = {Txn, []Span} so that a []Span can be turned into Intents easily by just adding a Txn.

func (BatchRequest) GetOrCreateCmdID

func (ba BatchRequest) GetOrCreateCmdID(walltime int64) (cmdID ClientCmdID)

GetOrCreateCmdID returns the request header's command ID if available. Otherwise, creates a new ClientCmdID, initialized with current time and random salt.

func (*BatchRequest) GetRequests

func (m *BatchRequest) GetRequests() []RequestUnion

func (*BatchRequest) GetUser

func (*BatchRequest) GetUser() string

GetUser implements security.RequestWithUser. KV messages are always sent by the node user.

func (*BatchRequest) IsAdmin

func (ba *BatchRequest) IsAdmin() bool

IsAdmin returns true iff the BatchRequest contains an admin request.

func (*BatchRequest) IsRange

func (ba *BatchRequest) IsRange() bool

IsRange returns true iff the BatchRequest contains a range request.

func (*BatchRequest) IsReadOnly

func (ba *BatchRequest) IsReadOnly() bool

IsReadOnly returns true if all requests within are read-only.

func (*BatchRequest) IsReverse

func (ba *BatchRequest) IsReverse() bool

IsReverse returns true iff the BatchRequest contains a reverse request.

func (*BatchRequest) IsTransactionWrite

func (ba *BatchRequest) IsTransactionWrite() bool

IsTransactionWrite returns true iff the BatchRequest contains a txn write.

func (*BatchRequest) IsWrite

func (ba *BatchRequest) IsWrite() bool

IsWrite returns true iff the BatchRequest contains a write.

func (*BatchRequest) Marshal

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

func (*BatchRequest) MarshalTo

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

func (*BatchRequest) Methods

func (ba *BatchRequest) Methods() []Method

Methods returns a slice of the contained methods.

func (*BatchRequest) ProtoMessage

func (*BatchRequest) ProtoMessage()

func (*BatchRequest) Reset

func (m *BatchRequest) Reset()

func (*BatchRequest) Size

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

func (BatchRequest) Split

func (ba BatchRequest) Split() [][]RequestUnion

Split separate the requests contained in a batch so that each subset of requests can be executed by a Store (without changing order). In particular, Admin and EndTransaction requests are always singled out and mutating requests separated from reads.

func (BatchRequest) String

func (ba BatchRequest) String() string

String gives a brief summary of the contained requests and keys in the batch. TODO(tschottdorf): the key range is useful information, but requires `keys`. See #2198.

func (BatchRequest) TraceID

func (ba BatchRequest) TraceID() string

TraceID implements tracer.Traceable by returning the first nontrivial TraceID of the Transaction and CmdID.

func (BatchRequest) TraceName

func (ba BatchRequest) TraceName() string

TraceName implements tracer.Traceable and behaves like TraceID, but using the TraceName of the object delegated to.

func (*BatchRequest) Unmarshal

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

type BatchResponse

type BatchResponse struct {
	BatchResponse_Header `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
	Responses            []ResponseUnion `protobuf:"bytes,2,rep,name=responses" json:"responses"`
}

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

func (br *BatchResponse) Combine(otherBatch *BatchResponse) error

Combine implements the Combinable interface. It combines each slot of the given request into the corresponding slot of the base response. The number of slots must be equal and the respective slots must be combinable. TODO(tschottdorf): write tests.

func (*BatchResponse) First

func (br *BatchResponse) First() Response

First returns the first response of the given type, if possible.

func (*BatchResponse) GetResponses

func (m *BatchResponse) GetResponses() []ResponseUnion

func (*BatchResponse) GoError

func (br *BatchResponse) GoError() error

GoError returns the non-nil error from the proto.Error union.

func (*BatchResponse) Header

func (br *BatchResponse) Header() *BatchResponse_Header

Header returns a pointer to the header.

func (*BatchResponse) Marshal

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

func (*BatchResponse) MarshalTo

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

func (*BatchResponse) ProtoMessage

func (*BatchResponse) ProtoMessage()

func (*BatchResponse) Reset

func (m *BatchResponse) Reset()

func (*BatchResponse) ResetAll

func (br *BatchResponse) ResetAll()

ResetAll resets all the contained requests to their original state.

func (*BatchResponse) SetGoError

func (br *BatchResponse) SetGoError(err error)

SetGoError converts the specified type into either one of the proto- defined error types or into an Error for all other Go errors.

func (*BatchResponse) Size

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

func (*BatchResponse) String

func (m *BatchResponse) String() string

func (*BatchResponse) Unmarshal

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

type BatchResponse_Header

type BatchResponse_Header 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 Span 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"`
}

func (*BatchResponse_Header) GetError

func (m *BatchResponse_Header) GetError() *Error

func (*BatchResponse_Header) GetTimestamp

func (m *BatchResponse_Header) GetTimestamp() Timestamp

func (*BatchResponse_Header) GetTxn

func (m *BatchResponse_Header) GetTxn() *Transaction

func (*BatchResponse_Header) Marshal

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

func (*BatchResponse_Header) MarshalTo

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

func (*BatchResponse_Header) ProtoMessage

func (*BatchResponse_Header) ProtoMessage()

func (*BatchResponse_Header) Reset

func (m *BatchResponse_Header) Reset()

func (*BatchResponse_Header) Size

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

func (*BatchResponse_Header) String

func (m *BatchResponse_Header) String() string

func (*BatchResponse_Header) Unmarshal

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

type Bounded

type Bounded interface {
	GetBound() int64
	SetBound(bound int64)
}

Bounded is implemented by request types which have a bounded number of result rows, such as Scan.

type ChangeReplicasTrigger

type ChangeReplicasTrigger struct {
	NodeID     NodeID            `protobuf:"varint,1,opt,name=node_id,casttype=NodeID" json:"node_id"`
	StoreID    StoreID           `protobuf:"varint,2,opt,name=store_id,casttype=StoreID" json:"store_id"`
	ChangeType ReplicaChangeType `protobuf:"varint,3,opt,name=change_type,enum=cockroach.roachpb.ReplicaChangeType" json:"change_type"`
	// The replica being modified.
	Replica ReplicaDescriptor `protobuf:"bytes,4,opt,name=replica" json:"replica"`
	// The new replica list with this change applied.
	UpdatedReplicas []ReplicaDescriptor `protobuf:"bytes,5,rep,name=updated_replicas" json:"updated_replicas"`
	NextReplicaID   ReplicaID           `protobuf:"varint,6,opt,name=next_replica_id,casttype=ReplicaID" json:"next_replica_id"`
}

func (*ChangeReplicasTrigger) GetChangeType

func (m *ChangeReplicasTrigger) GetChangeType() ReplicaChangeType

func (*ChangeReplicasTrigger) GetNextReplicaID

func (m *ChangeReplicasTrigger) GetNextReplicaID() ReplicaID

func (*ChangeReplicasTrigger) GetNodeID

func (m *ChangeReplicasTrigger) GetNodeID() NodeID

func (*ChangeReplicasTrigger) GetReplica

func (m *ChangeReplicasTrigger) GetReplica() ReplicaDescriptor

func (*ChangeReplicasTrigger) GetStoreID

func (m *ChangeReplicasTrigger) GetStoreID() StoreID

func (*ChangeReplicasTrigger) GetUpdatedReplicas

func (m *ChangeReplicasTrigger) GetUpdatedReplicas() []ReplicaDescriptor

func (*ChangeReplicasTrigger) Marshal

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

func (*ChangeReplicasTrigger) MarshalTo

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

func (*ChangeReplicasTrigger) ProtoMessage

func (*ChangeReplicasTrigger) ProtoMessage()

func (*ChangeReplicasTrigger) Reset

func (m *ChangeReplicasTrigger) Reset()

func (*ChangeReplicasTrigger) Size

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

func (*ChangeReplicasTrigger) String

func (m *ChangeReplicasTrigger) String() string

func (*ChangeReplicasTrigger) Unmarshal

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

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"`
}

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

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

func (*ClientCmdID) MarshalTo

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

func (*ClientCmdID) ProtoMessage

func (*ClientCmdID) ProtoMessage()

func (*ClientCmdID) Reset

func (m *ClientCmdID) Reset()

func (*ClientCmdID) Size

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

func (*ClientCmdID) String

func (m *ClientCmdID) String() string

func (ClientCmdID) TraceID

func (ccid ClientCmdID) TraceID() string

TraceID implements tracer.Traceable and returns the ClientCmdID in the format "c<WallTime>.<Random>".

func (ClientCmdID) TraceName

func (ccid ClientCmdID) TraceName() string

TraceName implements tracer.Traceable.

func (*ClientCmdID) Unmarshal

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

type Combinable

type Combinable interface {
	Combine(Response) error
}

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.

type ConditionFailedError

type ConditionFailedError struct {
	ActualValue *Value       `protobuf:"bytes,1,opt,name=actual_value" json:"actual_value,omitempty"`
	Index       *ErrPosition `protobuf:"bytes,2,opt,name=index" json:"index,omitempty"`
}

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

func (e *ConditionFailedError) ErrorIndex() (int32, bool)

ErrorIndex implements IndexedError.

func (*ConditionFailedError) GetActualValue

func (m *ConditionFailedError) GetActualValue() *Value

func (*ConditionFailedError) GetIndex

func (m *ConditionFailedError) GetIndex() *ErrPosition

func (*ConditionFailedError) Marshal

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

func (*ConditionFailedError) MarshalTo

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

func (*ConditionFailedError) ProtoMessage

func (*ConditionFailedError) ProtoMessage()

func (*ConditionFailedError) Reset

func (m *ConditionFailedError) Reset()

func (*ConditionFailedError) SetErrorIndex

func (e *ConditionFailedError) SetErrorIndex(index int32)

SetErrorIndex implements IndexedError.

func (*ConditionFailedError) Size

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

func (*ConditionFailedError) Unmarshal

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

type ConditionalPutRequest

type ConditionalPutRequest struct {
	Span `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"`
}

A ConditionalPutRequest is the argument 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) CreateReply

func (*ConditionalPutRequest) CreateReply() Response

CreateReply implements the Request interface.

func (*ConditionalPutRequest) GetExpValue

func (m *ConditionalPutRequest) GetExpValue() *Value

func (*ConditionalPutRequest) GetValue

func (m *ConditionalPutRequest) GetValue() Value

func (*ConditionalPutRequest) Marshal

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

func (*ConditionalPutRequest) MarshalTo

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

func (*ConditionalPutRequest) Method

func (*ConditionalPutRequest) Method() Method

Method implements the Request interface.

func (*ConditionalPutRequest) ProtoMessage

func (*ConditionalPutRequest) ProtoMessage()

func (*ConditionalPutRequest) Reset

func (m *ConditionalPutRequest) Reset()

func (*ConditionalPutRequest) Size

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

func (*ConditionalPutRequest) String

func (m *ConditionalPutRequest) String() string

func (*ConditionalPutRequest) Unmarshal

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

type ConditionalPutResponse

type ConditionalPutResponse struct {
	ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
}

A ConditionalPutResponse is the return value from the ConditionalPut() method.

func (*ConditionalPutResponse) Marshal

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

func (*ConditionalPutResponse) MarshalTo

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

func (*ConditionalPutResponse) ProtoMessage

func (*ConditionalPutResponse) ProtoMessage()

func (*ConditionalPutResponse) Reset

func (m *ConditionalPutResponse) Reset()

func (*ConditionalPutResponse) Size

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

func (*ConditionalPutResponse) String

func (m *ConditionalPutResponse) String() string

func (*ConditionalPutResponse) Unmarshal

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

type Countable

type Countable interface {
	Count() int64
}

Countable is implemented by response types which have a number of result rows, such as Scan.

type DeleteRangeRequest

type DeleteRangeRequest struct {
	Span `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"`
}

A DeleteRangeRequest is the argument to the DeleteRange() method. It specifies the range of keys to delete.

func (*DeleteRangeRequest) CreateReply

func (*DeleteRangeRequest) CreateReply() Response

CreateReply implements the Request interface.

func (*DeleteRangeRequest) GetMaxEntriesToDelete

func (m *DeleteRangeRequest) GetMaxEntriesToDelete() int64

func (*DeleteRangeRequest) Marshal

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

func (*DeleteRangeRequest) MarshalTo

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

func (*DeleteRangeRequest) Method

func (*DeleteRangeRequest) Method() Method

Method implements the Request interface.

func (*DeleteRangeRequest) ProtoMessage

func (*DeleteRangeRequest) ProtoMessage()

func (*DeleteRangeRequest) Reset

func (m *DeleteRangeRequest) Reset()

func (*DeleteRangeRequest) Size

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

func (*DeleteRangeRequest) String

func (m *DeleteRangeRequest) String() string

func (*DeleteRangeRequest) Unmarshal

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

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"`
}

A DeleteRangeResponse is the return value from the DeleteRange() method.

func (*DeleteRangeResponse) Combine

func (dr *DeleteRangeResponse) Combine(c Response) error

Combine implements the Combinable interface.

func (*DeleteRangeResponse) GetNumDeleted

func (m *DeleteRangeResponse) GetNumDeleted() int64

func (*DeleteRangeResponse) Marshal

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

func (*DeleteRangeResponse) MarshalTo

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

func (*DeleteRangeResponse) ProtoMessage

func (*DeleteRangeResponse) ProtoMessage()

func (*DeleteRangeResponse) Reset

func (m *DeleteRangeResponse) Reset()

func (*DeleteRangeResponse) Size

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

func (*DeleteRangeResponse) String

func (m *DeleteRangeResponse) String() string

func (*DeleteRangeResponse) Unmarshal

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

type DeleteRequest

type DeleteRequest struct {
	Span `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
}

A DeleteRequest is the argument to the Delete() method.

func (*DeleteRequest) CreateReply

func (*DeleteRequest) CreateReply() Response

CreateReply implements the Request interface.

func (*DeleteRequest) Marshal

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

func (*DeleteRequest) MarshalTo

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

func (*DeleteRequest) Method

func (*DeleteRequest) Method() Method

Method implements the Request interface.

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) Reset

func (m *DeleteRequest) Reset()

func (*DeleteRequest) Size

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

func (*DeleteRequest) String

func (m *DeleteRequest) String() string

func (*DeleteRequest) Unmarshal

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

type DeleteResponse

type DeleteResponse struct {
	ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
}

A DeleteResponse is the return value from the Delete() method.

func (*DeleteResponse) Marshal

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

func (*DeleteResponse) MarshalTo

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

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) Reset

func (m *DeleteResponse) Reset()

func (*DeleteResponse) Size

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

func (*DeleteResponse) String

func (m *DeleteResponse) String() string

func (*DeleteResponse) Unmarshal

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

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

func (k EncodedKey) Format(f fmt.State, verb rune)

Format implements the fmt.Formatter interface.

func (EncodedKey) Less

func (k EncodedKey) Less(l EncodedKey) bool

Less compares two keys.

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

func (k EncodedKey) String() string

String returns a string-formatted version of the key.

type EndTransactionRequest

type EndTransactionRequest struct {
	Span `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 cause an error if requested through the
	// external-facing KV API.
	InternalCommitTrigger *InternalCommitTrigger `protobuf:"bytes,3,opt,name=internal_commit_trigger" json:"internal_commit_trigger,omitempty"`
	// List of intents written by the transaction.
	Intents []Intent `protobuf:"bytes,4,rep,name=intents" json:"intents"`
}

An EndTransactionRequest is the argument to the EndTransaction() method. It specifies whether to commit or roll back an extant transaction.

func (*EndTransactionRequest) CreateReply

func (*EndTransactionRequest) CreateReply() Response

CreateReply implements the Request interface.

func (*EndTransactionRequest) GetCommit

func (m *EndTransactionRequest) GetCommit() bool

func (*EndTransactionRequest) GetIntents

func (m *EndTransactionRequest) GetIntents() []Intent

func (*EndTransactionRequest) GetInternalCommitTrigger

func (m *EndTransactionRequest) GetInternalCommitTrigger() *InternalCommitTrigger

func (*EndTransactionRequest) Marshal

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

func (*EndTransactionRequest) MarshalTo

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

func (*EndTransactionRequest) Method

func (*EndTransactionRequest) Method() Method

Method implements the Request interface.

func (*EndTransactionRequest) ProtoMessage

func (*EndTransactionRequest) ProtoMessage()

func (*EndTransactionRequest) Reset

func (m *EndTransactionRequest) Reset()

func (*EndTransactionRequest) Size

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

func (*EndTransactionRequest) String

func (m *EndTransactionRequest) String() string

func (*EndTransactionRequest) Unmarshal

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

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"`
	// List of intents resolved by EndTransaction call.
	Resolved []Key `protobuf:"bytes,3,rep,name=resolved,casttype=Key" json:"resolved,omitempty"`
}

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

func (m *EndTransactionResponse) GetResolved() []Key

func (*EndTransactionResponse) Marshal

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

func (*EndTransactionResponse) MarshalTo

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

func (*EndTransactionResponse) ProtoMessage

func (*EndTransactionResponse) ProtoMessage()

func (*EndTransactionResponse) Reset

func (m *EndTransactionResponse) Reset()

func (*EndTransactionResponse) Size

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

func (*EndTransactionResponse) String

func (m *EndTransactionResponse) String() string

func (*EndTransactionResponse) Unmarshal

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

type ErrPosition

type ErrPosition struct {
	Index int32 `protobuf:"varint,1,opt,name=index" json:"index"`
}

ErrPosition describes the position of an error in a Batch. A simple nullable primitive field would break compatibility with proto3, where primitive fields are no longer allowed to be nullable.

func (*ErrPosition) GetIndex

func (m *ErrPosition) GetIndex() int32

func (*ErrPosition) Marshal

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

func (*ErrPosition) MarshalTo

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

func (*ErrPosition) ProtoMessage

func (*ErrPosition) ProtoMessage()

func (*ErrPosition) Reset

func (m *ErrPosition) Reset()

func (*ErrPosition) Size

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

func (*ErrPosition) Unmarshal

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

type Error

type Error struct {
	// Message is a human-readable error message.
	Message string `protobuf:"bytes,1,opt,name=message" json:"message"`
	// If retryable is true, the error condition may be transient and the failed
	// operation may be retried (within the same transaction).
	Retryable bool `protobuf:"varint,2,opt,name=retryable" json:"retryable"`
	// If transaction_restart is not ABORT, the error condition may be handled by
	// restarting the transaction (with or without a backoff).
	TransactionRestart TransactionRestart `protobuf:"varint,3,opt,name=transaction_restart,enum=cockroach.roachpb.TransactionRestart" json:"transaction_restart"`
	// If an ErrorDetail is present, it may contain additional structured data
	// about the error.
	Detail *ErrorDetail `protobuf:"bytes,4,opt,name=detail" json:"detail,omitempty"`
	// The Index, if given, contains the index of the request (in the batch)
	// whose execution caused the error.
	Index *ErrPosition `protobuf:"bytes,5,opt,name=index" json:"index,omitempty"`
}

Error is a generic representation including a string message and information about retryability.

func NewError

func NewError(err error) *Error

NewError creates an Error from the given error.

func (*Error) GetDetail

func (m *Error) GetDetail() *ErrorDetail

func (*Error) GetIndex

func (m *Error) GetIndex() *ErrPosition

func (*Error) GetMessage

func (m *Error) GetMessage() string

func (*Error) GetRetryable

func (m *Error) GetRetryable() bool

func (*Error) GetTransactionRestart

func (m *Error) GetTransactionRestart() TransactionRestart

func (*Error) GoError

func (e *Error) GoError() error

GoError returns the non-nil error from the roachpb.Error union.

func (*Error) Marshal

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

func (*Error) MarshalTo

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

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) Reset

func (m *Error) Reset()

func (*Error) SetGoError

func (e *Error) SetGoError(err error)

SetGoError sets Error using err.

func (*Error) Size

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

func (*Error) String

func (e *Error) String() string

String implements fmt.Stringer.

func (*Error) Unmarshal

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

type ErrorDetail

type ErrorDetail struct {
	NotLeader                     *NotLeaderError                     `protobuf:"bytes,1,opt,name=not_leader" json:"not_leader,omitempty"`
	RangeNotFound                 *RangeNotFoundError                 `protobuf:"bytes,2,opt,name=range_not_found" json:"range_not_found,omitempty"`
	RangeKeyMismatch              *RangeKeyMismatchError              `protobuf:"bytes,3,opt,name=range_key_mismatch" json:"range_key_mismatch,omitempty"`
	ReadWithinUncertaintyInterval *ReadWithinUncertaintyIntervalError `protobuf:"bytes,4,opt,name=read_within_uncertainty_interval" json:"read_within_uncertainty_interval,omitempty"`
	TransactionAborted            *TransactionAbortedError            `protobuf:"bytes,5,opt,name=transaction_aborted" json:"transaction_aborted,omitempty"`
	TransactionPush               *TransactionPushError               `protobuf:"bytes,6,opt,name=transaction_push" json:"transaction_push,omitempty"`
	TransactionRetry              *TransactionRetryError              `protobuf:"bytes,7,opt,name=transaction_retry" json:"transaction_retry,omitempty"`
	TransactionStatus             *TransactionStatusError             `protobuf:"bytes,8,opt,name=transaction_status" json:"transaction_status,omitempty"`
	WriteIntent                   *WriteIntentError                   `protobuf:"bytes,9,opt,name=write_intent" json:"write_intent,omitempty"`
	WriteTooOld                   *WriteTooOldError                   `protobuf:"bytes,10,opt,name=write_too_old" json:"write_too_old,omitempty"`
	OpRequiresTxn                 *OpRequiresTxnError                 `protobuf:"bytes,11,opt,name=op_requires_txn" json:"op_requires_txn,omitempty"`
	ConditionFailed               *ConditionFailedError               `protobuf:"bytes,12,opt,name=condition_failed" json:"condition_failed,omitempty"`
	LeaseRejected                 *LeaseRejectedError                 `protobuf:"bytes,13,opt,name=lease_rejected" json:"lease_rejected,omitempty"`
	NodeUnavailable               *NodeUnavailableError               `protobuf:"bytes,14,opt,name=node_unavailable" json:"node_unavailable,omitempty"`
	Send                          *SendError                          `protobuf:"bytes,15,opt,name=send" json:"send,omitempty"`
}

ErrorDetail is a union type containing all available errors.

func (*ErrorDetail) GetConditionFailed

func (m *ErrorDetail) GetConditionFailed() *ConditionFailedError

func (*ErrorDetail) GetLeaseRejected

func (m *ErrorDetail) GetLeaseRejected() *LeaseRejectedError

func (*ErrorDetail) GetNodeUnavailable

func (m *ErrorDetail) GetNodeUnavailable() *NodeUnavailableError

func (*ErrorDetail) GetNotLeader

func (m *ErrorDetail) GetNotLeader() *NotLeaderError

func (*ErrorDetail) GetOpRequiresTxn

func (m *ErrorDetail) GetOpRequiresTxn() *OpRequiresTxnError

func (*ErrorDetail) GetRangeKeyMismatch

func (m *ErrorDetail) GetRangeKeyMismatch() *RangeKeyMismatchError

func (*ErrorDetail) GetRangeNotFound

func (m *ErrorDetail) GetRangeNotFound() *RangeNotFoundError

func (*ErrorDetail) GetReadWithinUncertaintyInterval

func (m *ErrorDetail) GetReadWithinUncertaintyInterval() *ReadWithinUncertaintyIntervalError

func (*ErrorDetail) GetSend

func (m *ErrorDetail) GetSend() *SendError

func (*ErrorDetail) GetTransactionAborted

func (m *ErrorDetail) GetTransactionAborted() *TransactionAbortedError

func (*ErrorDetail) GetTransactionPush

func (m *ErrorDetail) GetTransactionPush() *TransactionPushError

func (*ErrorDetail) GetTransactionRetry

func (m *ErrorDetail) GetTransactionRetry() *TransactionRetryError

func (*ErrorDetail) GetTransactionStatus

func (m *ErrorDetail) GetTransactionStatus() *TransactionStatusError

func (*ErrorDetail) GetValue

func (this *ErrorDetail) GetValue() interface{}

func (*ErrorDetail) GetWriteIntent

func (m *ErrorDetail) GetWriteIntent() *WriteIntentError

func (*ErrorDetail) GetWriteTooOld

func (m *ErrorDetail) GetWriteTooOld() *WriteTooOldError

func (*ErrorDetail) Marshal

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

func (*ErrorDetail) MarshalTo

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

func (*ErrorDetail) ProtoMessage

func (*ErrorDetail) ProtoMessage()

func (*ErrorDetail) Reset

func (m *ErrorDetail) Reset()

func (*ErrorDetail) SetValue

func (this *ErrorDetail) SetValue(value interface{}) bool

func (*ErrorDetail) Size

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

func (*ErrorDetail) Unmarshal

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

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"`
}

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

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

func (*GCMetadata) MarshalTo

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

func (*GCMetadata) ProtoMessage

func (*GCMetadata) ProtoMessage()

func (*GCMetadata) Reset

func (m *GCMetadata) Reset()

func (*GCMetadata) Size

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

func (*GCMetadata) String

func (m *GCMetadata) String() string

func (*GCMetadata) Unmarshal

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

type GCRequest

type GCRequest struct {
	Span   `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
	GCMeta GCMetadata        `protobuf:"bytes,2,opt,name=gc_meta" json:"gc_meta"`
	Keys   []GCRequest_GCKey `protobuf:"bytes,3,rep,name=keys" json:"keys"`
}

A GCRequest is arguments to the GC() method. It's sent by range leaders after scanning range data to find expired MVCC values.

func (*GCRequest) CreateReply

func (*GCRequest) CreateReply() Response

CreateReply implements the Request interface.

func (*GCRequest) GetGCMeta

func (m *GCRequest) GetGCMeta() GCMetadata

func (*GCRequest) GetKeys

func (m *GCRequest) GetKeys() []GCRequest_GCKey

func (*GCRequest) Marshal

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

func (*GCRequest) MarshalTo

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

func (*GCRequest) Method

func (*GCRequest) Method() Method

Method implements the Request interface.

func (*GCRequest) ProtoMessage

func (*GCRequest) ProtoMessage()

func (*GCRequest) Reset

func (m *GCRequest) Reset()

func (*GCRequest) Size

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

func (*GCRequest) String

func (m *GCRequest) String() string

func (*GCRequest) Unmarshal

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

type GCRequest_GCKey

type GCRequest_GCKey struct {
	Key       Key       `protobuf:"bytes,1,opt,name=key,casttype=Key" json:"key,omitempty"`
	Timestamp Timestamp `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp"`
}

func (*GCRequest_GCKey) GetKey

func (m *GCRequest_GCKey) GetKey() Key

func (*GCRequest_GCKey) GetTimestamp

func (m *GCRequest_GCKey) GetTimestamp() Timestamp

func (*GCRequest_GCKey) Marshal

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

func (*GCRequest_GCKey) MarshalTo

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

func (*GCRequest_GCKey) ProtoMessage

func (*GCRequest_GCKey) ProtoMessage()

func (*GCRequest_GCKey) Reset

func (m *GCRequest_GCKey) Reset()

func (*GCRequest_GCKey) Size

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

func (*GCRequest_GCKey) String

func (m *GCRequest_GCKey) String() string

func (*GCRequest_GCKey) Unmarshal

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

type GCResponse

type GCResponse struct {
	ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
}

A GCResponse is the return value from the GC() method.

func (*GCResponse) Marshal

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

func (*GCResponse) MarshalTo

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

func (*GCResponse) ProtoMessage

func (*GCResponse) ProtoMessage()

func (*GCResponse) Reset

func (m *GCResponse) Reset()

func (*GCResponse) Size

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

func (*GCResponse) String

func (m *GCResponse) String() string

func (*GCResponse) Unmarshal

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

type GetRequest

type GetRequest struct {
	Span `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
}

A GetRequest is the argument for the Get() method.

func (*GetRequest) CreateReply

func (*GetRequest) CreateReply() Response

CreateReply implements the Request interface.

func (*GetRequest) Marshal

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

func (*GetRequest) MarshalTo

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

func (*GetRequest) Method

func (*GetRequest) Method() Method

Method implements the Request interface.

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) Reset

func (m *GetRequest) Reset()

func (*GetRequest) Size

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

func (*GetRequest) String

func (m *GetRequest) String() string

func (*GetRequest) Unmarshal

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

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"`
}

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

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

func (*GetResponse) MarshalTo

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

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) Reset

func (m *GetResponse) Reset()

func (*GetResponse) Size

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

func (*GetResponse) String

func (m *GetResponse) String() string

func (*GetResponse) Unmarshal

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

func (*GetResponse) Verify

func (gr *GetResponse) Verify(req Request) error

Verify verifies the integrity of the get response value.

type Header 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"`
	Replica ReplicaDescriptor `protobuf:"bytes,5,opt,name=replica" json:"replica"`
	// RangeID 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.
	RangeID RangeID `protobuf:"varint,6,opt,name=range_id,casttype=RangeID" json:"range_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,7,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,8,opt,name=txn" json:"txn,omitempty"`
	// ReadConsistency specifies the consistency for read
	// operations. The default is CONSISTENT. This value is ignored for
	// write operations.
	ReadConsistency ReadConsistencyType `protobuf:"varint,9,opt,name=read_consistency,enum=cockroach.roachpb.ReadConsistencyType" json:"read_consistency"`
}

A Header is attached to a BatchRequest, encapsulating routing and auxiliary information required for executing it.

func (*Header) GetCmdID

func (m *Header) GetCmdID() ClientCmdID

func (*Header) GetRangeID

func (m *Header) GetRangeID() RangeID

func (*Header) GetReadConsistency

func (m *Header) GetReadConsistency() ReadConsistencyType

func (*Header) GetReplica

func (m *Header) GetReplica() ReplicaDescriptor

func (*Header) GetTimestamp

func (m *Header) GetTimestamp() Timestamp

func (*Header) GetTxn

func (m *Header) GetTxn() *Transaction

func (*Header) GetUserPriority

func (m *Header) GetUserPriority() int32

func (*Header) Marshal

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

func (*Header) MarshalTo

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

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) Reset

func (m *Header) Reset()

func (*Header) Size

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

func (*Header) String

func (m *Header) String() string

func (*Header) Unmarshal

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

type HeartbeatTxnRequest

type HeartbeatTxnRequest struct {
	Span `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
}

A HeartbeatTxnRequest is arguments to the HeartbeatTxn() 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 (*HeartbeatTxnRequest) CreateReply

func (*HeartbeatTxnRequest) CreateReply() Response

CreateReply implements the Request interface.

func (*HeartbeatTxnRequest) Marshal

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

func (*HeartbeatTxnRequest) MarshalTo

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

func (*HeartbeatTxnRequest) Method

func (*HeartbeatTxnRequest) Method() Method

Method implements the Request interface.

func (*HeartbeatTxnRequest) ProtoMessage

func (*HeartbeatTxnRequest) ProtoMessage()

func (*HeartbeatTxnRequest) Reset

func (m *HeartbeatTxnRequest) Reset()

func (*HeartbeatTxnRequest) Size

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

func (*HeartbeatTxnRequest) String

func (m *HeartbeatTxnRequest) String() string

func (*HeartbeatTxnRequest) Unmarshal

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

type HeartbeatTxnResponse

type HeartbeatTxnResponse struct {
	ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
}

A HeartbeatTxnResponse is the return value from the HeartbeatTxn() 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 (*HeartbeatTxnResponse) Marshal

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

func (*HeartbeatTxnResponse) MarshalTo

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

func (*HeartbeatTxnResponse) ProtoMessage

func (*HeartbeatTxnResponse) ProtoMessage()

func (*HeartbeatTxnResponse) Reset

func (m *HeartbeatTxnResponse) Reset()

func (*HeartbeatTxnResponse) Size

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

func (*HeartbeatTxnResponse) String

func (m *HeartbeatTxnResponse) String() string

func (*HeartbeatTxnResponse) Unmarshal

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

type IncrementRequest

type IncrementRequest struct {
	Span      `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
	Increment int64 `protobuf:"varint,2,opt,name=increment" json:"increment"`
}

An IncrementRequest is the argument 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, Put() and ConditionalPut() cannot be invoked on an incremented key.

func (*IncrementRequest) CreateReply

func (*IncrementRequest) CreateReply() Response

CreateReply implements the Request interface.

func (*IncrementRequest) GetIncrement

func (m *IncrementRequest) GetIncrement() int64

func (*IncrementRequest) Marshal

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

func (*IncrementRequest) MarshalTo

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

func (*IncrementRequest) Method

func (*IncrementRequest) Method() Method

Method implements the Request interface.

func (*IncrementRequest) ProtoMessage

func (*IncrementRequest) ProtoMessage()

func (*IncrementRequest) Reset

func (m *IncrementRequest) Reset()

func (*IncrementRequest) Size

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

func (*IncrementRequest) String

func (m *IncrementRequest) String() string

func (*IncrementRequest) Unmarshal

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

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"`
}

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

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

func (*IncrementResponse) MarshalTo

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

func (*IncrementResponse) ProtoMessage

func (*IncrementResponse) ProtoMessage()

func (*IncrementResponse) Reset

func (m *IncrementResponse) Reset()

func (*IncrementResponse) Size

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

func (*IncrementResponse) String

func (m *IncrementResponse) String() string

func (*IncrementResponse) Unmarshal

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

type IndexedError

type IndexedError interface {
	ErrorIndex() (int32, bool) // bool is false iff no index associated
	SetErrorIndex(int32)
}

IndexedError is an interface implemented by errors which can be associated with a failed request in a Batch.

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 Intent

type Intent struct {
	Key    Key         `protobuf:"bytes,1,opt,name=key,casttype=Key" json:"key,omitempty"`
	EndKey Key         `protobuf:"bytes,2,opt,name=end_key,casttype=Key" json:"end_key,omitempty"`
	Txn    Transaction `protobuf:"bytes,3,opt,name=txn" json:"txn"`
}

Intent is used to communicate the location of an intent.

func (*Intent) GetEndKey

func (m *Intent) GetEndKey() Key

func (*Intent) GetKey

func (m *Intent) GetKey() Key

func (*Intent) GetTxn

func (m *Intent) GetTxn() Transaction

func (*Intent) Marshal

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

func (*Intent) MarshalTo

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

func (*Intent) ProtoMessage

func (*Intent) ProtoMessage()

func (*Intent) Reset

func (m *Intent) Reset()

func (*Intent) Size

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

func (*Intent) String

func (m *Intent) String() string

func (*Intent) Unmarshal

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

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"`
	ModifiedSpanTrigger   *ModifiedSpanTrigger   `protobuf:"bytes,4,opt,name=modified_span_trigger" json:"modified_span_trigger,omitempty"`
}

CommitTrigger encapsulates all of the internal-only commit triggers. Only one may be set.

func (*InternalCommitTrigger) GetChangeReplicasTrigger

func (m *InternalCommitTrigger) GetChangeReplicasTrigger() *ChangeReplicasTrigger

func (*InternalCommitTrigger) GetMergeTrigger

func (m *InternalCommitTrigger) GetMergeTrigger() *MergeTrigger

func (*InternalCommitTrigger) GetModifiedSpanTrigger

func (m *InternalCommitTrigger) GetModifiedSpanTrigger() *ModifiedSpanTrigger

func (*InternalCommitTrigger) GetSplitTrigger

func (m *InternalCommitTrigger) GetSplitTrigger() *SplitTrigger

func (*InternalCommitTrigger) Marshal

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

func (*InternalCommitTrigger) MarshalTo

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

func (*InternalCommitTrigger) ProtoMessage

func (*InternalCommitTrigger) ProtoMessage()

func (*InternalCommitTrigger) Reset

func (m *InternalCommitTrigger) Reset()

func (*InternalCommitTrigger) Size

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

func (*InternalCommitTrigger) String

func (m *InternalCommitTrigger) String() string

func (*InternalCommitTrigger) Unmarshal

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

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"`
}

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 (*InternalTimeSeriesData) GetStartTimestampNanos

func (m *InternalTimeSeriesData) GetStartTimestampNanos() int64

func (*InternalTimeSeriesData) Marshal

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

func (*InternalTimeSeriesData) MarshalTo

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

func (*InternalTimeSeriesData) ProtoMessage

func (*InternalTimeSeriesData) ProtoMessage()

func (*InternalTimeSeriesData) Reset

func (m *InternalTimeSeriesData) Reset()

func (*InternalTimeSeriesData) Size

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

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.

func (*InternalTimeSeriesData) Unmarshal

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

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 measurements taken within this sample.
	Count uint32 `protobuf:"varint,6,opt,name=count" json:"count"`
	// Sum of all measurements.
	Sum float64 `protobuf:"fixed64,7,opt,name=sum" json:"sum"`
	// Maximum encountered measurement in this sample.
	Max *float64 `protobuf:"fixed64,8,opt,name=max" json:"max,omitempty"`
	// Minimum encountered measurement in this sample.
	Min *float64 `protobuf:"fixed64,9,opt,name=min" json:"min,omitempty"`
}

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.

func (*InternalTimeSeriesSample) Average

func (samp *InternalTimeSeriesSample) Average() float64

Average returns the average value for this sample.

func (*InternalTimeSeriesSample) GetCount

func (m *InternalTimeSeriesSample) GetCount() uint32

func (*InternalTimeSeriesSample) GetMax

func (m *InternalTimeSeriesSample) GetMax() float64

func (*InternalTimeSeriesSample) GetMin

func (m *InternalTimeSeriesSample) GetMin() float64

func (*InternalTimeSeriesSample) GetOffset

func (m *InternalTimeSeriesSample) GetOffset() int32

func (*InternalTimeSeriesSample) GetSum

func (m *InternalTimeSeriesSample) GetSum() float64

func (*InternalTimeSeriesSample) Marshal

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

func (*InternalTimeSeriesSample) MarshalTo

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

func (*InternalTimeSeriesSample) Maximum

func (samp *InternalTimeSeriesSample) Maximum() float64

Maximum returns the maximum value encountered by this sample.

func (*InternalTimeSeriesSample) Minimum

func (samp *InternalTimeSeriesSample) Minimum() float64

Minimum returns the minimum value encountered by this sample.

func (*InternalTimeSeriesSample) ProtoMessage

func (*InternalTimeSeriesSample) ProtoMessage()

func (*InternalTimeSeriesSample) Reset

func (m *InternalTimeSeriesSample) Reset()

func (*InternalTimeSeriesSample) Size

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

func (*InternalTimeSeriesSample) String

func (m *InternalTimeSeriesSample) String() string

func (*InternalTimeSeriesSample) Unmarshal

func (m *InternalTimeSeriesSample) Unmarshal(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 interval.Comparable interface for tree nodes.

func (Key) Equal

func (k Key) Equal(l Key) bool

Equal returns whether two keys are identical.

func (Key) Format

func (k Key) Format(f fmt.State, verb rune)

Format implements the fmt.Formatter interface.

func (Key) IsPrev

func (k Key) IsPrev(m Key) bool

IsPrev is a more efficient version of k.Next().Equal(m).

func (Key) Next

func (k Key) Next() Key

Next returns the next key in lexicographic sort order.

func (Key) PrefixEnd

func (k Key) PrefixEnd() Key

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

func (k Key) String() string

String returns a string-formatted version of the key.

type KeyValue

type KeyValue struct {
	Key   Key   `protobuf:"bytes,1,opt,name=key,casttype=Key" json:"key,omitempty"`
	Value Value `protobuf:"bytes,2,opt,name=value" json:"value"`
}

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

func (m *KeyValue) GetKey() Key

func (*KeyValue) GetValue

func (m *KeyValue) GetValue() Value

func (*KeyValue) Marshal

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

func (*KeyValue) MarshalTo

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

func (*KeyValue) ProtoMessage

func (*KeyValue) ProtoMessage()

func (*KeyValue) Reset

func (m *KeyValue) Reset()

func (*KeyValue) Size

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

func (*KeyValue) String

func (m *KeyValue) String() string

func (*KeyValue) Unmarshal

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

type LeaderLeaseRequest

type LeaderLeaseRequest struct {
	Span  `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
	Lease Lease `protobuf:"bytes,2,opt,name=lease" json:"lease"`
}

A LeaderLeaseRequest is arguments to the LeaderLease() method. It is sent by the store on behalf of one of its ranges upon receipt of a leader election event for that range.

func (*LeaderLeaseRequest) CreateReply

func (*LeaderLeaseRequest) CreateReply() Response

CreateReply implements the Request interface.

func (*LeaderLeaseRequest) GetLease

func (m *LeaderLeaseRequest) GetLease() Lease

func (*LeaderLeaseRequest) Marshal

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

func (*LeaderLeaseRequest) MarshalTo

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

func (*LeaderLeaseRequest) Method

func (*LeaderLeaseRequest) Method() Method

Method implements the Request interface.

func (*LeaderLeaseRequest) ProtoMessage

func (*LeaderLeaseRequest) ProtoMessage()

func (*LeaderLeaseRequest) Reset

func (m *LeaderLeaseRequest) Reset()

func (*LeaderLeaseRequest) Size

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

func (*LeaderLeaseRequest) String

func (m *LeaderLeaseRequest) String() string

func (*LeaderLeaseRequest) Unmarshal

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

type LeaderLeaseResponse

type LeaderLeaseResponse struct {
	ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
}

A LeaderLeaseResponse is the response to a LeaderLease() operation.

func (*LeaderLeaseResponse) Marshal

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

func (*LeaderLeaseResponse) MarshalTo

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

func (*LeaderLeaseResponse) ProtoMessage

func (*LeaderLeaseResponse) ProtoMessage()

func (*LeaderLeaseResponse) Reset

func (m *LeaderLeaseResponse) Reset()

func (*LeaderLeaseResponse) Size

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

func (*LeaderLeaseResponse) String

func (m *LeaderLeaseResponse) String() string

func (*LeaderLeaseResponse) Unmarshal

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

type Lease

type Lease struct {
	// The start is a timestamp at which the lease begins. This value
	// must be greater than the last lease expiration or this call will
	// fail.
	Start Timestamp `protobuf:"bytes,1,opt,name=start" json:"start"`
	// The expiration is a timestamp at which the lease will expire.
	Expiration Timestamp `protobuf:"bytes,2,opt,name=expiration" json:"expiration"`
	// The address of the would-be lease holder.
	Replica ReplicaDescriptor `protobuf:"bytes,3,opt,name=replica" json:"replica"`
}

Lease contains information about leader leases including the expiration and lease holder.

func (Lease) Covers

func (l Lease) Covers(timestamp Timestamp) bool

Covers returns true if the given timestamp is strictly less than the Lease expiration, which indicates that the lease holder is authorized to carry out operations with that timestamp.

func (*Lease) GetExpiration

func (m *Lease) GetExpiration() Timestamp

func (*Lease) GetReplica

func (m *Lease) GetReplica() ReplicaDescriptor

func (*Lease) GetStart

func (m *Lease) GetStart() Timestamp

func (*Lease) Marshal

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

func (*Lease) MarshalTo

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

func (Lease) OwnedBy

func (l Lease) OwnedBy(storeID StoreID) bool

OwnedBy returns whether the given store is the lease owner.

func (*Lease) ProtoMessage

func (*Lease) ProtoMessage()

func (*Lease) Reset

func (m *Lease) Reset()

func (*Lease) Size

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

func (Lease) String

func (l Lease) String() string

func (*Lease) Unmarshal

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

type LeaseRejectedError

type LeaseRejectedError struct {
	Requested Lease `protobuf:"bytes,1,opt,name=Requested" json:"Requested"`
	Existing  Lease `protobuf:"bytes,2,opt,name=Existing" json:"Existing"`
}

A LeaseRejectedError indicates that the requested replica could not acquire the desired lease because of an existing leader lease.

func (*LeaseRejectedError) CanRetry

func (e *LeaseRejectedError) CanRetry() bool

CanRetry indicates that this error can not be retried; it should never make it back to the client anyways.

func (*LeaseRejectedError) Error

func (e *LeaseRejectedError) Error() string

Error formats error.

func (*LeaseRejectedError) GetExisting

func (m *LeaseRejectedError) GetExisting() Lease

func (*LeaseRejectedError) GetRequested

func (m *LeaseRejectedError) GetRequested() Lease

func (*LeaseRejectedError) Marshal

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

func (*LeaseRejectedError) MarshalTo

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

func (*LeaseRejectedError) ProtoMessage

func (*LeaseRejectedError) ProtoMessage()

func (*LeaseRejectedError) Reset

func (m *LeaseRejectedError) Reset()

func (*LeaseRejectedError) Size

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

func (*LeaseRejectedError) Unmarshal

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

type MergeRequest

type MergeRequest struct {
	Span  `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
	Value Value `protobuf:"bytes,2,opt,name=value" json:"value"`
}

A MergeRequest contains arguments to the Merge() method. It specifies a key and a value which should be merged into the existing value at that key.

func (*MergeRequest) CreateReply

func (*MergeRequest) CreateReply() Response

CreateReply implements the Request interface.

func (*MergeRequest) GetValue

func (m *MergeRequest) GetValue() Value

func (*MergeRequest) Marshal

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

func (*MergeRequest) MarshalTo

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

func (*MergeRequest) Method

func (*MergeRequest) Method() Method

Method implements the Request interface.

func (*MergeRequest) ProtoMessage

func (*MergeRequest) ProtoMessage()

func (*MergeRequest) Reset

func (m *MergeRequest) Reset()

func (*MergeRequest) Size

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

func (*MergeRequest) String

func (m *MergeRequest) String() string

func (*MergeRequest) Unmarshal

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

type MergeResponse

type MergeResponse struct {
	ResponseHeader `protobuf:"bytes,1,opt,name=header,embedded=header" json:"header"`
}

MergeResponse is the response to a Merge() operation.

func (*MergeResponse) Marshal

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

func (*MergeResponse) MarshalTo

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

func (*MergeResponse) ProtoMessage

func (*MergeResponse) ProtoMessage()

func (*MergeResponse) Reset

func (m *MergeResponse) Reset()

func (*MergeResponse) Size

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

func (*MergeResponse) String

func (m *MergeResponse) String() string

func (*MergeResponse) Unmarshal

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

type MergeTrigger

type MergeTrigger struct {
	UpdatedDesc     RangeDescriptor `protobuf:"bytes,1,opt,name=updated_desc" json:"updated_desc"`
	SubsumedRangeID RangeID         `protobuf:"varint,2,opt,name=subsumed_range_id,casttype=RangeID" json:"subsumed_range_id"`
}

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

func (m *MergeTrigger) GetSubsumedRangeID() RangeID

func (*MergeTrigger) GetUpdatedDesc

func (m *MergeTrigger) GetUpdatedDesc() RangeDescriptor

func (*MergeTrigger) Marshal

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

func (*MergeTrigger) MarshalTo

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

func (*MergeTrigger) ProtoMessage

func (*MergeTrigger) ProtoMessage()

func (*MergeTrigger) Reset

func (m *MergeTrigger) Reset()

func (*MergeTrigger) Size

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

func (*MergeTrigger) String

func (m *MergeTrigger) String() string

func (*MergeTrigger) Unmarshal

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

type Method

type Method int

Method is the enumerated type for methods.

const (
	// 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 Method = iota
	// 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
	// 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
	// Increment increments the value at the specified key. Once called
	// for a key, Put & ConditionalPut 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
	// Delete removes the value for the specified key.
	Delete
	// DeleteRange removes all values for keys which fall between
	// args.RequestHeader.Key and args.RequestHeader.EndKey, with
	// the latter endpoint excluded.
	DeleteRange
	// Scan fetches the values for all keys which fall between
	// args.RequestHeader.Key and args.RequestHeader.EndKey, with
	// the latter endpoint excluded.
	Scan
	// ReverseScan fetches the values for all keys which fall between
	// args.RequestHeader.Key and args.RequestHeader.EndKey, with
	// the latter endpoint excluded.
	ReverseScan
	// EndTransaction either commits or aborts an ongoing transaction.
	EndTransaction
	// AdminSplit is called to coordinate a split of a range.
	AdminSplit
	// AdminMerge is called to coordinate a merge of two adjacent ranges.
	AdminMerge
	// HeartbeatTxn sends a periodic heartbeat to extant
	// transaction rows to indicate the client is still alive and
	// the transaction should not be considered abandoned.
	HeartbeatTxn
	// GC 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.
	GC
	// PushTxn 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 a