cockroach: github.com/cockroachdb/cockroach/pkg/storage/engine/enginepb Index | Files

package enginepb

import "github.com/cockroachdb/cockroach/pkg/storage/engine/enginepb"

Index

Package Files

decode.go file_registry.pb.go mvcc.go mvcc.pb.go mvcc3.go mvcc3.pb.go rocksdb.pb.go

Variables

var (
    ErrInvalidLengthFileRegistry = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowFileRegistry   = fmt.Errorf("proto: integer overflow")
)
var (
    ErrInvalidLengthMvcc = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowMvcc   = fmt.Errorf("proto: integer overflow")
)
var (
    ErrInvalidLengthMvcc3 = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowMvcc3   = fmt.Errorf("proto: integer overflow")
)
var (
    ErrInvalidLengthRocksdb = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowRocksdb   = fmt.Errorf("proto: integer overflow")
)
var EnvType_name = map[int32]string{
    0:  "Plaintext",
    1:  "Store",
    2:  "Data",
}
var EnvType_value = map[string]int32{
    "Plaintext": 0,
    "Store":     1,
    "Data":      2,
}
var RegistryVersion_name = map[int32]string{
    0: "Base",
}
var RegistryVersion_value = map[string]int32{
    "Base": 0,
}

func DecodeKey Uses

func DecodeKey(encodedKey []byte) (key []byte, timestamp hlc.Timestamp, _ error)

DecodeKey decodes an key/timestamp from its serialized representation. This decoding must match engine/db.cc:DecodeKey().

func ScanDecodeKeyValue Uses

func ScanDecodeKeyValue(
    repr []byte,
) (key []byte, ts hlc.Timestamp, value []byte, orepr []byte, err error)

ScanDecodeKeyValue decodes a key/value pair from a binary stream, such as in an MVCCScan "batch" (this is not the RocksDB batch repr format), returning the key/value, the timestamp, and the suffix of data remaining in the batch.

func ScanDecodeKeyValueNoTS Uses

func ScanDecodeKeyValueNoTS(repr []byte) (key []byte, value []byte, orepr []byte, err error)

ScanDecodeKeyValueNoTS decodes a key/value pair from a binary stream, such as in an MVCCScan "batch" (this is not the RocksDB batch repr format), returning the key/value and the suffix of data remaining in the batch.

func SplitMVCCKey Uses

func SplitMVCCKey(mvccKey []byte) (key []byte, ts []byte, ok bool)

SplitMVCCKey returns the key and timestamp components of an encoded MVCC key. This decoding must match engine/db.cc:SplitKey().

type EnvType Uses

type EnvType int32

EnvType determines which rocksdb::Env is used and for what purpose.

const (
    // The default Env when no encryption is used.
    // File using Plaintext are not recorded in the file registry.
    EnvType_Plaintext EnvType = 0
    // The Env using store-level keys.
    // Used only to read/write the data key registry.
    EnvType_Store EnvType = 1
    // The Env using data-level keys.
    // Used as the default rocksdb Env when encryption is enabled.
    EnvType_Data EnvType = 2
)

func (EnvType) EnumDescriptor Uses

func (EnvType) EnumDescriptor() ([]byte, []int)

func (EnvType) String Uses

func (x EnvType) String() string

type FileEntry Uses

type FileEntry struct {
    // Env type identifies which rocksdb::Env is responsible for this file.
    EnvType EnvType `protobuf:"varint,1,opt,name=env_type,json=envType,proto3,enum=cockroach.storage.engine.enginepb.EnvType" json:"env_type,omitempty"`
    // Env-specific fields for non-0 env. These are known by CCL code only.
    // This is a serialized protobuf. We cannot use protobuf.Any since we use
    // MessageLite in C++.
    EncryptionSettings []byte `protobuf:"bytes,2,opt,name=encryption_settings,json=encryptionSettings,proto3" json:"encryption_settings,omitempty"`
}

func (*FileEntry) Descriptor Uses

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

func (*FileEntry) Marshal Uses

func (m *FileEntry) Marshal() (dAtA []byte, err error)

func (*FileEntry) MarshalTo Uses

func (m *FileEntry) MarshalTo(dAtA []byte) (int, error)

func (*FileEntry) ProtoMessage Uses

func (*FileEntry) ProtoMessage()

func (*FileEntry) Reset Uses

func (m *FileEntry) Reset()

func (*FileEntry) Size Uses

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

func (*FileEntry) String Uses

func (m *FileEntry) String() string

func (*FileEntry) Unmarshal Uses

func (m *FileEntry) Unmarshal(dAtA []byte) error

func (*FileEntry) XXX_DiscardUnknown Uses

func (m *FileEntry) XXX_DiscardUnknown()

func (*FileEntry) XXX_Marshal Uses

func (m *FileEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FileEntry) XXX_Merge Uses

func (dst *FileEntry) XXX_Merge(src proto.Message)

func (*FileEntry) XXX_Size Uses

func (m *FileEntry) XXX_Size() int

func (*FileEntry) XXX_Unmarshal Uses

func (m *FileEntry) XXX_Unmarshal(b []byte) error

type FileRegistry Uses

type FileRegistry struct {
    // version is currently always Base.
    Version RegistryVersion `protobuf:"varint,1,opt,name=version,proto3,enum=cockroach.storage.engine.enginepb.RegistryVersion" json:"version,omitempty"`
    // Map of filename -> FileEntry.
    // Filename is relative to the rocksdb dir if the file is inside it.
    // Otherwise it is an absolute path.
    // TODO(mberhault): figure out if we need anything special for Windows.
    Files map[string]*FileEntry `protobuf:"bytes,2,rep,name=files,proto3" json:"files,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}

Registry describes how a files are handled. This includes the rockdb::Env responsible for each file as well as opaque env details.

func (*FileRegistry) Descriptor Uses

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

func (*FileRegistry) Marshal Uses

func (m *FileRegistry) Marshal() (dAtA []byte, err error)

func (*FileRegistry) MarshalTo Uses

func (m *FileRegistry) MarshalTo(dAtA []byte) (int, error)

func (*FileRegistry) ProtoMessage Uses

func (*FileRegistry) ProtoMessage()

func (*FileRegistry) Reset Uses

func (m *FileRegistry) Reset()

func (*FileRegistry) Size Uses

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

func (*FileRegistry) String Uses

func (m *FileRegistry) String() string

func (*FileRegistry) Unmarshal Uses

func (m *FileRegistry) Unmarshal(dAtA []byte) error

func (*FileRegistry) XXX_DiscardUnknown Uses

func (m *FileRegistry) XXX_DiscardUnknown()

func (*FileRegistry) XXX_Marshal Uses

func (m *FileRegistry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FileRegistry) XXX_Merge Uses

func (dst *FileRegistry) XXX_Merge(src proto.Message)

func (*FileRegistry) XXX_Size Uses

func (m *FileRegistry) XXX_Size() int

func (*FileRegistry) XXX_Unmarshal Uses

func (m *FileRegistry) XXX_Unmarshal(b []byte) error

type HistogramData Uses

type HistogramData struct {
    Mean  float64 `protobuf:"fixed64,1,opt,name=mean,proto3" json:"mean,omitempty"`
    P50   float64 `protobuf:"fixed64,2,opt,name=p50,proto3" json:"p50,omitempty"`
    P95   float64 `protobuf:"fixed64,3,opt,name=p95,proto3" json:"p95,omitempty"`
    P99   float64 `protobuf:"fixed64,4,opt,name=p99,proto3" json:"p99,omitempty"`
    Max   float64 `protobuf:"fixed64,5,opt,name=max,proto3" json:"max,omitempty"`
    Count uint64  `protobuf:"varint,6,opt,name=count,proto3" json:"count,omitempty"`
    Sum   uint64  `protobuf:"varint,7,opt,name=sum,proto3" json:"sum,omitempty"`
}

HistogramData holds the relevant metrics returned by a call to `rocksdb::Statistics::histogramData()`.

func (*HistogramData) Descriptor Uses

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

func (*HistogramData) Marshal Uses

func (m *HistogramData) Marshal() (dAtA []byte, err error)

func (*HistogramData) MarshalTo Uses

func (m *HistogramData) MarshalTo(dAtA []byte) (int, error)

func (*HistogramData) ProtoMessage Uses

func (*HistogramData) ProtoMessage()

func (*HistogramData) Reset Uses

func (m *HistogramData) Reset()

func (*HistogramData) Size Uses

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

func (*HistogramData) String Uses

func (m *HistogramData) String() string

func (*HistogramData) Unmarshal Uses

func (m *HistogramData) Unmarshal(dAtA []byte) error

func (*HistogramData) XXX_DiscardUnknown Uses

func (m *HistogramData) XXX_DiscardUnknown()

func (*HistogramData) XXX_Marshal Uses

func (m *HistogramData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HistogramData) XXX_Merge Uses

func (dst *HistogramData) XXX_Merge(src proto.Message)

func (*HistogramData) XXX_Size Uses

func (m *HistogramData) XXX_Size() int

func (*HistogramData) XXX_Unmarshal Uses

func (m *HistogramData) XXX_Unmarshal(b []byte) error

type MVCCAbortIntentOp Uses

type MVCCAbortIntentOp struct {
    TxnID github_com_cockroachdb_cockroach_pkg_util_uuid.UUID `protobuf:"bytes,1,opt,name=txn_id,json=txnId,proto3,customtype=github.com/cockroachdb/cockroach/pkg/util/uuid.UUID" json:"txn_id"`
}

MVCCAbortIntentOp corresponds to an intent being aborted for a given transaction.

This operation does not necessarily indicate that the intent's transaction was aborted, just that an intent was removed without being committed. For instance, a committed transaction will abort any intents it decided not to write in its final epoch.

func (*MVCCAbortIntentOp) Descriptor Uses

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

func (*MVCCAbortIntentOp) Marshal Uses

func (m *MVCCAbortIntentOp) Marshal() (dAtA []byte, err error)

func (*MVCCAbortIntentOp) MarshalTo Uses

func (m *MVCCAbortIntentOp) MarshalTo(dAtA []byte) (int, error)

func (*MVCCAbortIntentOp) ProtoMessage Uses

func (*MVCCAbortIntentOp) ProtoMessage()

func (*MVCCAbortIntentOp) Reset Uses

func (m *MVCCAbortIntentOp) Reset()

func (*MVCCAbortIntentOp) Size Uses

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

func (*MVCCAbortIntentOp) String Uses

func (m *MVCCAbortIntentOp) String() string

func (*MVCCAbortIntentOp) Unmarshal Uses

func (m *MVCCAbortIntentOp) Unmarshal(dAtA []byte) error

func (*MVCCAbortIntentOp) XXX_DiscardUnknown Uses

func (m *MVCCAbortIntentOp) XXX_DiscardUnknown()

func (*MVCCAbortIntentOp) XXX_Marshal Uses

func (m *MVCCAbortIntentOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MVCCAbortIntentOp) XXX_Merge Uses

func (dst *MVCCAbortIntentOp) XXX_Merge(src proto.Message)

func (*MVCCAbortIntentOp) XXX_Size Uses

func (m *MVCCAbortIntentOp) XXX_Size() int

func (*MVCCAbortIntentOp) XXX_Unmarshal Uses

func (m *MVCCAbortIntentOp) XXX_Unmarshal(b []byte) error

type MVCCAbortTxnOp Uses

type MVCCAbortTxnOp struct {
    TxnID github_com_cockroachdb_cockroach_pkg_util_uuid.UUID `protobuf:"bytes,1,opt,name=txn_id,json=txnId,proto3,customtype=github.com/cockroachdb/cockroach/pkg/util/uuid.UUID" json:"txn_id"`
}

MVCCAbortTxnOp corresponds to an entire transaction being aborted. The operation indicates that none of the transaction's intents will ever be committed.

func (*MVCCAbortTxnOp) Descriptor Uses

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

func (*MVCCAbortTxnOp) Marshal Uses

func (m *MVCCAbortTxnOp) Marshal() (dAtA []byte, err error)

func (*MVCCAbortTxnOp) MarshalTo Uses

func (m *MVCCAbortTxnOp) MarshalTo(dAtA []byte) (int, error)

func (*MVCCAbortTxnOp) ProtoMessage Uses

func (*MVCCAbortTxnOp) ProtoMessage()

func (*MVCCAbortTxnOp) Reset Uses

func (m *MVCCAbortTxnOp) Reset()

func (*MVCCAbortTxnOp) Size Uses

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

func (*MVCCAbortTxnOp) String Uses

func (m *MVCCAbortTxnOp) String() string

func (*MVCCAbortTxnOp) Unmarshal Uses

func (m *MVCCAbortTxnOp) Unmarshal(dAtA []byte) error

func (*MVCCAbortTxnOp) XXX_DiscardUnknown Uses

func (m *MVCCAbortTxnOp) XXX_DiscardUnknown()

func (*MVCCAbortTxnOp) XXX_Marshal Uses

func (m *MVCCAbortTxnOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MVCCAbortTxnOp) XXX_Merge Uses

func (dst *MVCCAbortTxnOp) XXX_Merge(src proto.Message)

func (*MVCCAbortTxnOp) XXX_Size Uses

func (m *MVCCAbortTxnOp) XXX_Size() int

func (*MVCCAbortTxnOp) XXX_Unmarshal Uses

func (m *MVCCAbortTxnOp) XXX_Unmarshal(b []byte) error

type MVCCCommitIntentOp Uses

type MVCCCommitIntentOp struct {
    TxnID     github_com_cockroachdb_cockroach_pkg_util_uuid.UUID `protobuf:"bytes,1,opt,name=txn_id,json=txnId,proto3,customtype=github.com/cockroachdb/cockroach/pkg/util/uuid.UUID" json:"txn_id"`
    Key       []byte                                              `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
    Timestamp hlc.Timestamp                                       `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp"`
    Value     []byte                                              `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
}

MVCCCommitIntentOp corresponds to an intent being committed for a given transaction.

func (*MVCCCommitIntentOp) Descriptor Uses

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

func (*MVCCCommitIntentOp) Marshal Uses

func (m *MVCCCommitIntentOp) Marshal() (dAtA []byte, err error)

func (*MVCCCommitIntentOp) MarshalTo Uses

func (m *MVCCCommitIntentOp) MarshalTo(dAtA []byte) (int, error)

func (*MVCCCommitIntentOp) ProtoMessage Uses

func (*MVCCCommitIntentOp) ProtoMessage()

func (*MVCCCommitIntentOp) Reset Uses

func (m *MVCCCommitIntentOp) Reset()

func (*MVCCCommitIntentOp) Size Uses

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

func (*MVCCCommitIntentOp) String Uses

func (m *MVCCCommitIntentOp) String() string

func (*MVCCCommitIntentOp) Unmarshal Uses

func (m *MVCCCommitIntentOp) Unmarshal(dAtA []byte) error

func (*MVCCCommitIntentOp) XXX_DiscardUnknown Uses

func (m *MVCCCommitIntentOp) XXX_DiscardUnknown()

func (*MVCCCommitIntentOp) XXX_Marshal Uses

func (m *MVCCCommitIntentOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MVCCCommitIntentOp) XXX_Merge Uses

func (dst *MVCCCommitIntentOp) XXX_Merge(src proto.Message)

func (*MVCCCommitIntentOp) XXX_Size Uses

func (m *MVCCCommitIntentOp) XXX_Size() int

func (*MVCCCommitIntentOp) XXX_Unmarshal Uses

func (m *MVCCCommitIntentOp) XXX_Unmarshal(b []byte) error

type MVCCLogicalOp Uses

type MVCCLogicalOp struct {
    WriteValue   *MVCCWriteValueOp   `protobuf:"bytes,1,opt,name=write_value,json=writeValue,proto3" json:"write_value,omitempty"`
    WriteIntent  *MVCCWriteIntentOp  `protobuf:"bytes,2,opt,name=write_intent,json=writeIntent,proto3" json:"write_intent,omitempty"`
    UpdateIntent *MVCCUpdateIntentOp `protobuf:"bytes,3,opt,name=update_intent,json=updateIntent,proto3" json:"update_intent,omitempty"`
    CommitIntent *MVCCCommitIntentOp `protobuf:"bytes,4,opt,name=commit_intent,json=commitIntent,proto3" json:"commit_intent,omitempty"`
    AbortIntent  *MVCCAbortIntentOp  `protobuf:"bytes,5,opt,name=abort_intent,json=abortIntent,proto3" json:"abort_intent,omitempty"`
    AbortTxn     *MVCCAbortTxnOp     `protobuf:"bytes,6,opt,name=abort_txn,json=abortTxn,proto3" json:"abort_txn,omitempty"`
}

MVCCLogicalOp is a union of all logical MVCC operation types.

func (*MVCCLogicalOp) Descriptor Uses

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

func (*MVCCLogicalOp) GetValue Uses

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

func (*MVCCLogicalOp) Marshal Uses

func (m *MVCCLogicalOp) Marshal() (dAtA []byte, err error)

func (*MVCCLogicalOp) MarshalTo Uses

func (m *MVCCLogicalOp) MarshalTo(dAtA []byte) (int, error)

func (*MVCCLogicalOp) MustSetValue Uses

func (op *MVCCLogicalOp) MustSetValue(value interface{})

MustSetValue is like SetValue, except it resets the enum and panics if the provided value is not a valid variant type.

func (*MVCCLogicalOp) ProtoMessage Uses

func (*MVCCLogicalOp) ProtoMessage()

func (*MVCCLogicalOp) Reset Uses

func (m *MVCCLogicalOp) Reset()

func (*MVCCLogicalOp) SetValue Uses

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

func (*MVCCLogicalOp) Size Uses

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

func (*MVCCLogicalOp) String Uses

func (m *MVCCLogicalOp) String() string

func (*MVCCLogicalOp) Unmarshal Uses

func (m *MVCCLogicalOp) Unmarshal(dAtA []byte) error

func (*MVCCLogicalOp) XXX_DiscardUnknown Uses

func (m *MVCCLogicalOp) XXX_DiscardUnknown()

func (*MVCCLogicalOp) XXX_Marshal Uses

func (m *MVCCLogicalOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MVCCLogicalOp) XXX_Merge Uses

func (dst *MVCCLogicalOp) XXX_Merge(src proto.Message)

func (*MVCCLogicalOp) XXX_Size Uses

func (m *MVCCLogicalOp) XXX_Size() int

func (*MVCCLogicalOp) XXX_Unmarshal Uses

func (m *MVCCLogicalOp) XXX_Unmarshal(b []byte) error

type MVCCMetadata Uses

type MVCCMetadata struct {
    Txn *TxnMeta `protobuf:"bytes,1,opt,name=txn" json:"txn,omitempty"`
    // The timestamp of the most recent versioned value if this is a
    // value that may have multiple versions. For values which may have
    // only one version, the data is stored inline (via raw_bytes), and
    // timestamp is set to zero.
    Timestamp hlc.LegacyTimestamp `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=keyBytes" json:"key_bytes"`
    // The size in bytes of the most recent versioned value.
    ValBytes int64 `protobuf:"varint,5,opt,name=val_bytes,json=valBytes" json:"val_bytes"`
    // Inline value, used for non-versioned 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.
    RawBytes []byte `protobuf:"bytes,6,opt,name=raw_bytes,json=rawBytes" json:"raw_bytes,omitempty"`
    // IntentHistory of the transaction stores the older values the txn wrote
    // for the key along with each values corresponding Sequence. It doesn't
    // contain the latest intent value but rather stores all the values that have
    // been overwritten by the transaction.
    // IntentHistory will be empty for non-transactional requests.
    IntentHistory []MVCCMetadata_SequencedIntent `protobuf:"bytes,8,rep,name=intent_history,json=intentHistory" json:"intent_history"`
    // This provides a measure of protection against replays caused by
    // Raft duplicating merge commands.
    MergeTimestamp *hlc.LegacyTimestamp `protobuf:"bytes,7,opt,name=merge_timestamp,json=mergeTimestamp" json:"merge_timestamp,omitempty"`
}

MVCCMetadata holds MVCC metadata for a key. Used by storage/engine/mvcc.go. An MVCCMetadata is stored for a versioned key while there is an intent on that key.

func NewPopulatedMVCCMetadata Uses

func NewPopulatedMVCCMetadata(r randyMvcc, easy bool) *MVCCMetadata

func (*MVCCMetadata) AddToIntentHistory Uses

func (meta *MVCCMetadata) AddToIntentHistory(seq TxnSeq, val []byte)

AddToIntentHistory adds the sequence and value to the intent history.

func (*MVCCMetadata) Descriptor Uses

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

func (*MVCCMetadata) Equal Uses

func (this *MVCCMetadata) Equal(that interface{}) bool

func (*MVCCMetadata) GetIntentValue Uses

func (meta *MVCCMetadata) GetIntentValue(seq TxnSeq) ([]byte, bool)

GetIntentValue goes through the intent history and finds the value written at the sequence number.

func (*MVCCMetadata) GetPrevIntentSeq Uses

func (meta *MVCCMetadata) GetPrevIntentSeq(seq TxnSeq) (TxnSeq, bool)

GetPrevIntentSeq goes through the intent history and finds the previous intent's sequence number given the current sequence.

func (MVCCMetadata) IsInline Uses

func (meta MVCCMetadata) IsInline() bool

IsInline returns true if the value is inlined in the metadata.

func (*MVCCMetadata) Marshal Uses

func (m *MVCCMetadata) Marshal() (dAtA []byte, err error)

func (*MVCCMetadata) MarshalTo Uses

func (m *MVCCMetadata) MarshalTo(dAtA []byte) (int, error)

func (*MVCCMetadata) ProtoMessage Uses

func (*MVCCMetadata) ProtoMessage()

func (*MVCCMetadata) Reset Uses

func (m *MVCCMetadata) Reset()

func (*MVCCMetadata) Size Uses

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

func (*MVCCMetadata) String Uses

func (m *MVCCMetadata) String() string

func (*MVCCMetadata) Unmarshal Uses

func (m *MVCCMetadata) Unmarshal(dAtA []byte) error

func (*MVCCMetadata) XXX_DiscardUnknown Uses

func (m *MVCCMetadata) XXX_DiscardUnknown()

func (*MVCCMetadata) XXX_Marshal Uses

func (m *MVCCMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MVCCMetadata) XXX_Merge Uses

func (dst *MVCCMetadata) XXX_Merge(src proto.Message)

func (*MVCCMetadata) XXX_Size Uses

func (m *MVCCMetadata) XXX_Size() int

func (*MVCCMetadata) XXX_Unmarshal Uses

func (m *MVCCMetadata) XXX_Unmarshal(b []byte) error

type MVCCMetadata_SequencedIntent Uses

type MVCCMetadata_SequencedIntent struct {
    // Sequence is a one-indexed number which is increased on each request
    // set as part of a transaction. It uniquely identifies a value from
    // the IntentHistory.
    Sequence TxnSeq `protobuf:"varint,1,opt,name=sequence,casttype=TxnSeq" json:"sequence"`
    // Value is the value written to the key as part of the transaction at
    // the above Sequence.
    Value []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
}

SequencedIntent stores a value at a given key and the sequence number it was written at - to be stored in an IntentHistory of a key during a transaction.

func NewPopulatedMVCCMetadata_SequencedIntent Uses

func NewPopulatedMVCCMetadata_SequencedIntent(r randyMvcc, easy bool) *MVCCMetadata_SequencedIntent

func (*MVCCMetadata_SequencedIntent) Descriptor Uses

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

func (*MVCCMetadata_SequencedIntent) Equal Uses

func (this *MVCCMetadata_SequencedIntent) Equal(that interface{}) bool

func (*MVCCMetadata_SequencedIntent) Marshal Uses

func (m *MVCCMetadata_SequencedIntent) Marshal() (dAtA []byte, err error)

func (*MVCCMetadata_SequencedIntent) MarshalTo Uses

func (m *MVCCMetadata_SequencedIntent) MarshalTo(dAtA []byte) (int, error)

func (*MVCCMetadata_SequencedIntent) ProtoMessage Uses

func (*MVCCMetadata_SequencedIntent) ProtoMessage()

func (*MVCCMetadata_SequencedIntent) Reset Uses

func (m *MVCCMetadata_SequencedIntent) Reset()

func (*MVCCMetadata_SequencedIntent) Size Uses

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

func (*MVCCMetadata_SequencedIntent) String Uses

func (m *MVCCMetadata_SequencedIntent) String() string

func (*MVCCMetadata_SequencedIntent) Unmarshal Uses

func (m *MVCCMetadata_SequencedIntent) Unmarshal(dAtA []byte) error

func (*MVCCMetadata_SequencedIntent) XXX_DiscardUnknown Uses

func (m *MVCCMetadata_SequencedIntent) XXX_DiscardUnknown()

func (*MVCCMetadata_SequencedIntent) XXX_Marshal Uses

func (m *MVCCMetadata_SequencedIntent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MVCCMetadata_SequencedIntent) XXX_Merge Uses

func (dst *MVCCMetadata_SequencedIntent) XXX_Merge(src proto.Message)

func (*MVCCMetadata_SequencedIntent) XXX_Size Uses

func (m *MVCCMetadata_SequencedIntent) XXX_Size() int

func (*MVCCMetadata_SequencedIntent) XXX_Unmarshal Uses

func (m *MVCCMetadata_SequencedIntent) XXX_Unmarshal(b []byte) error

type MVCCPersistentStats Uses

type MVCCPersistentStats struct {
    ContainsEstimates bool  `protobuf:"varint,14,opt,name=contains_estimates,json=containsEstimates,proto3" json:"contains_estimates,omitempty"`
    LastUpdateNanos   int64 `protobuf:"fixed64,1,opt,name=last_update_nanos,json=lastUpdateNanos,proto3" json:"last_update_nanos,omitempty"`
    IntentAge         int64 `protobuf:"fixed64,2,opt,name=intent_age,json=intentAge,proto3" json:"intent_age,omitempty"`
    GCBytesAge        int64 `protobuf:"fixed64,3,opt,name=gc_bytes_age,json=gcBytesAge,proto3" json:"gc_bytes_age,omitempty"`
    LiveBytes         int64 `protobuf:"varint,4,opt,name=live_bytes,json=liveBytes,proto3" json:"live_bytes,omitempty"`
    LiveCount         int64 `protobuf:"varint,5,opt,name=live_count,json=liveCount,proto3" json:"live_count,omitempty"`
    KeyBytes          int64 `protobuf:"varint,6,opt,name=key_bytes,json=keyBytes,proto3" json:"key_bytes,omitempty"`
    KeyCount          int64 `protobuf:"varint,7,opt,name=key_count,json=keyCount,proto3" json:"key_count,omitempty"`
    ValBytes          int64 `protobuf:"varint,8,opt,name=val_bytes,json=valBytes,proto3" json:"val_bytes,omitempty"`
    ValCount          int64 `protobuf:"varint,9,opt,name=val_count,json=valCount,proto3" json:"val_count,omitempty"`
    IntentBytes       int64 `protobuf:"varint,10,opt,name=intent_bytes,json=intentBytes,proto3" json:"intent_bytes,omitempty"`
    IntentCount       int64 `protobuf:"varint,11,opt,name=intent_count,json=intentCount,proto3" json:"intent_count,omitempty"`
    SysBytes          int64 `protobuf:"varint,12,opt,name=sys_bytes,json=sysBytes,proto3" json:"sys_bytes,omitempty"`
    SysCount          int64 `protobuf:"varint,13,opt,name=sys_count,json=sysCount,proto3" json:"sys_count,omitempty"`
}

MVCCPersistentStats is convertible to MVCCStats, but uses signed variable width encodings for most fields that make it efficient to store positive values but inefficient to store negative values. This makes the encodings incompatible.

func NewPopulatedMVCCPersistentStats Uses

func NewPopulatedMVCCPersistentStats(r randyMvcc3, easy bool) *MVCCPersistentStats

func (*MVCCPersistentStats) Descriptor Uses

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

func (*MVCCPersistentStats) Equal Uses

func (this *MVCCPersistentStats) Equal(that interface{}) bool

func (*MVCCPersistentStats) Marshal Uses

func (m *MVCCPersistentStats) Marshal() (dAtA []byte, err error)

func (*MVCCPersistentStats) MarshalTo Uses

func (m *MVCCPersistentStats) MarshalTo(dAtA []byte) (int, error)

func (*MVCCPersistentStats) ProtoMessage Uses

func (*MVCCPersistentStats) ProtoMessage()

func (*MVCCPersistentStats) Reset Uses

func (m *MVCCPersistentStats) Reset()

func (*MVCCPersistentStats) Size Uses

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

func (*MVCCPersistentStats) String Uses

func (m *MVCCPersistentStats) String() string

func (*MVCCPersistentStats) ToStats Uses

func (ms *MVCCPersistentStats) ToStats() MVCCStats

ToStats converts the receiver to an MVCCStats.

func (*MVCCPersistentStats) Unmarshal Uses

func (m *MVCCPersistentStats) Unmarshal(dAtA []byte) error

func (*MVCCPersistentStats) XXX_DiscardUnknown Uses

func (m *MVCCPersistentStats) XXX_DiscardUnknown()

func (*MVCCPersistentStats) XXX_Marshal Uses

func (m *MVCCPersistentStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MVCCPersistentStats) XXX_Merge Uses

func (dst *MVCCPersistentStats) XXX_Merge(src proto.Message)

func (*MVCCPersistentStats) XXX_Size Uses

func (m *MVCCPersistentStats) XXX_Size() int

func (*MVCCPersistentStats) XXX_Unmarshal Uses

func (m *MVCCPersistentStats) XXX_Unmarshal(b []byte) error

type MVCCStats Uses

type MVCCStats struct {
    // contains_estimates indicates that the MVCCStats object contains values
    // which have been estimated. This means that the stats should not be used
    // where complete accuracy is required, and instead should be recomputed
    // when necessary.
    ContainsEstimates bool `protobuf:"varint,14,opt,name=contains_estimates,json=containsEstimates" json:"contains_estimates"`
    // last_update_nanos is a timestamp at which the ages were last
    // updated. See the comment on MVCCStats.
    LastUpdateNanos int64 `protobuf:"fixed64,1,opt,name=last_update_nanos,json=lastUpdateNanos" json:"last_update_nanos"`
    // intent_age is the cumulative age of the tracked intents.
    // See the comment on MVCCStats.
    IntentAge int64 `protobuf:"fixed64,2,opt,name=intent_age,json=intentAge" json:"intent_age"`
    // gc_bytes_age is the cumulative age of the non-live data (i.e.
    // data included in key_bytes and val_bytes, but not live_bytes).
    // See the comment on MVCCStats.
    GCBytesAge int64 `protobuf:"fixed64,3,opt,name=gc_bytes_age,json=gcBytesAge" json:"gc_bytes_age"`
    // live_bytes is the number of bytes stored in keys and values which can in
    // principle be read by means of a Scan or Get in the far future, including
    // intents but not deletion tombstones (or their intents). Note that the
    // size of the meta kv pair (which could be explicit or implicit) is
    // included in this. Only the meta kv pair counts for the actual length of
    // the encoded key (regular pairs only count the timestamp suffix).
    LiveBytes int64 `protobuf:"fixed64,4,opt,name=live_bytes,json=liveBytes" json:"live_bytes"`
    // live_count is the number of meta keys tracked under live_bytes.
    LiveCount int64 `protobuf:"fixed64,5,opt,name=live_count,json=liveCount" json:"live_count"`
    // key_bytes is the number of bytes stored in all non-system
    // keys, including live, meta, old, and deleted keys.
    // Only meta keys really account for the "full" key; value
    // keys only for the timestamp suffix.
    KeyBytes int64 `protobuf:"fixed64,6,opt,name=key_bytes,json=keyBytes" json:"key_bytes"`
    // key_count is the number of meta keys tracked under key_bytes.
    KeyCount int64 `protobuf:"fixed64,7,opt,name=key_count,json=keyCount" json:"key_count"`
    // value_bytes is the number of bytes in all non-system version
    // values, including meta values.
    ValBytes int64 `protobuf:"fixed64,8,opt,name=val_bytes,json=valBytes" json:"val_bytes"`
    // val_count is the number of meta values tracked under val_bytes.
    ValCount int64 `protobuf:"fixed64,9,opt,name=val_count,json=valCount" json:"val_count"`
    // intent_bytes is the number of bytes in intent key-value
    // pairs (without their meta keys).
    IntentBytes int64 `protobuf:"fixed64,10,opt,name=intent_bytes,json=intentBytes" json:"intent_bytes"`
    // intent_count is the number of keys tracked under intent_bytes.
    // It is equal to the number of meta keys in the system with
    // a non-empty Transaction proto.
    IntentCount int64 `protobuf:"fixed64,11,opt,name=intent_count,json=intentCount" json:"intent_count"`
    // sys_bytes is the number of bytes stored in system-local kv-pairs.
    // This tracks the same quantity as (key_bytes + val_bytes), but
    // for system-local metadata keys (which aren't counted in either
    // key_bytes or val_bytes). Each of the keys falling into this group
    // is documented in keys/constants.go under the localPrefix constant
    // and is prefixed by either LocalRangeIDPrefix or LocalRangePrefix.
    SysBytes int64 `protobuf:"fixed64,12,opt,name=sys_bytes,json=sysBytes" json:"sys_bytes"`
    // sys_count is the number of meta keys tracked under sys_bytes.
    SysCount int64 `protobuf:"fixed64,13,opt,name=sys_count,json=sysCount" json:"sys_count"`
}

MVCCStats tracks byte and instance counts for various groups of keys, values, or key-value pairs; see the field comments for details.

It also tracks two cumulative ages, namely that of intents and non-live (i.e. GC-able) bytes. This computation is intrinsically linked to last_update_nanos and is easy to get wrong. Updates happen only once every full second, as measured by last_update_nanos/1e9. That is, forward updates don't change last_update_nanos until an update at a timestamp which, truncated to the second, is ahead of last_update_nanos/1e9. Then, that difference in seconds times the base quantity (excluding the currently running update) is added to the age.

To give an example, if an intent is around from `t=2.5s` to `t=4.1s` (the current time), then it contributes an intent age of two seconds (one second picked up when crossing `t=3s`, another one at `t=4s`). Similarly, if a GC'able kv pair is around for this amount of time, it contributes two seconds times its size in bytes.

It gets more complicated when data is accounted for with a timestamp behind last_update_nanos. In this case, if more than a second has passed (computed via truncation above), the ages have to be adjusted to account for this late addition. This isn't hard: add the new data's base quantity times the (truncated) number of seconds behind. Important to keep in mind with those computations is that (x/1e9 - y/1e9) does not equal (x-y)/1e9 in most cases.

Note that this struct must be kept at a fixed size by using fixed-size encodings for all fields and by making all fields non-nullable. This is so that it can predict its own impact on the size of the system-local kv-pairs.

func NewPopulatedMVCCStats Uses

func NewPopulatedMVCCStats(r randyMvcc, easy bool) *MVCCStats

func (*MVCCStats) Add Uses

func (ms *MVCCStats) Add(oms MVCCStats)

Add adds values from oms to ms. The ages will be moved forward to the larger of the LastUpdateNano timestamps involved.

func (*MVCCStats) AgeTo Uses

func (ms *MVCCStats) AgeTo(nowNanos int64)

AgeTo encapsulates the complexity of computing the increment in age quantities contained in MVCCStats. Two MVCCStats structs only add and subtract meaningfully if their LastUpdateNanos matches, so aging them to the max of their LastUpdateNanos is a prerequisite, though Add() takes care of this internally.

func (MVCCStats) AvgIntentAge Uses

func (ms MVCCStats) AvgIntentAge(nowNanos int64) float64

AvgIntentAge returns the average age of outstanding intents, based on current wall time specified via nowNanos.

func (*MVCCStats) Descriptor Uses

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

func (*MVCCStats) Equal Uses

func (this *MVCCStats) Equal(that interface{}) bool

func (*MVCCStats) Forward Uses

func (ms *MVCCStats) Forward(nowNanos int64)

Forward is like AgeTo, but if nowNanos is not ahead of ms.LastUpdateNanos, this method is a noop.

func (MVCCStats) GCByteAge Uses

func (ms MVCCStats) GCByteAge(nowNanos int64) int64

GCByteAge returns the total age of outstanding gc'able bytes, based on current wall time specified via nowNanos. nowNanos is ignored if it's a past timestamp as seen by rs.LastUpdateNanos.

func (MVCCStats) GCBytes Uses

func (ms MVCCStats) GCBytes() int64

GCBytes is a convenience function which returns the number of gc bytes, that is the key and value bytes excluding the live bytes.

func (*MVCCStats) Marshal Uses

func (m *MVCCStats) Marshal() (dAtA []byte, err error)

func (*MVCCStats) MarshalTo Uses

func (m *MVCCStats) MarshalTo(dAtA []byte) (int, error)

func (*MVCCStats) ProtoMessage Uses

func (*MVCCStats) ProtoMessage()

func (*MVCCStats) Reset Uses

func (m *MVCCStats) Reset()

func (*MVCCStats) Size Uses

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

func (*MVCCStats) String Uses

func (m *MVCCStats) String() string

func (*MVCCStats) Subtract Uses

func (ms *MVCCStats) Subtract(oms MVCCStats)

Subtract removes oms from ms. The ages will be moved forward to the larger of the LastUpdateNano timestamps involved.

func (*MVCCStats) ToPersistentStats Uses

func (ms *MVCCStats) ToPersistentStats() MVCCPersistentStats

ToPersistentStats converts the receiver to an MVCCPersistentStats.

func (*MVCCStats) ToStatsDelta Uses

func (ms *MVCCStats) ToStatsDelta() MVCCStatsDelta

ToStatsDelta converts the receiver to an MVCCStatsDelta.

func (MVCCStats) Total Uses

func (ms MVCCStats) Total() int64

Total returns the range size as the sum of the key and value bytes. This includes all non-live keys and all versioned values.

func (*MVCCStats) Unmarshal Uses

func (m *MVCCStats) Unmarshal(dAtA []byte) error

func (*MVCCStats) XXX_DiscardUnknown Uses

func (m *MVCCStats) XXX_DiscardUnknown()

func (*MVCCStats) XXX_Marshal Uses

func (m *MVCCStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MVCCStats) XXX_Merge Uses

func (dst *MVCCStats) XXX_Merge(src proto.Message)

func (*MVCCStats) XXX_Size Uses

func (m *MVCCStats) XXX_Size() int

func (*MVCCStats) XXX_Unmarshal Uses

func (m *MVCCStats) XXX_Unmarshal(b []byte) error

type MVCCStatsDelta Uses

type MVCCStatsDelta struct {
    // TODO(nvanbenschoten): now that we've split MVCCPersistentStats
    // from this MVCCStatsDelta type, we can turn contains_estimates
    // into a three-valued type ('UNCHANGED', 'NO', and 'YES').
    ContainsEstimates bool  `protobuf:"varint,14,opt,name=contains_estimates,json=containsEstimates,proto3" json:"contains_estimates,omitempty"`
    LastUpdateNanos   int64 `protobuf:"fixed64,1,opt,name=last_update_nanos,json=lastUpdateNanos,proto3" json:"last_update_nanos,omitempty"`
    IntentAge         int64 `protobuf:"fixed64,2,opt,name=intent_age,json=intentAge,proto3" json:"intent_age,omitempty"`
    GCBytesAge        int64 `protobuf:"fixed64,3,opt,name=gc_bytes_age,json=gcBytesAge,proto3" json:"gc_bytes_age,omitempty"`
    LiveBytes         int64 `protobuf:"zigzag64,4,opt,name=live_bytes,json=liveBytes,proto3" json:"live_bytes,omitempty"`
    LiveCount         int64 `protobuf:"zigzag64,5,opt,name=live_count,json=liveCount,proto3" json:"live_count,omitempty"`
    KeyBytes          int64 `protobuf:"zigzag64,6,opt,name=key_bytes,json=keyBytes,proto3" json:"key_bytes,omitempty"`
    KeyCount          int64 `protobuf:"zigzag64,7,opt,name=key_count,json=keyCount,proto3" json:"key_count,omitempty"`
    ValBytes          int64 `protobuf:"zigzag64,8,opt,name=val_bytes,json=valBytes,proto3" json:"val_bytes,omitempty"`
    ValCount          int64 `protobuf:"zigzag64,9,opt,name=val_count,json=valCount,proto3" json:"val_count,omitempty"`
    IntentBytes       int64 `protobuf:"zigzag64,10,opt,name=intent_bytes,json=intentBytes,proto3" json:"intent_bytes,omitempty"`
    IntentCount       int64 `protobuf:"zigzag64,11,opt,name=intent_count,json=intentCount,proto3" json:"intent_count,omitempty"`
    SysBytes          int64 `protobuf:"zigzag64,12,opt,name=sys_bytes,json=sysBytes,proto3" json:"sys_bytes,omitempty"`
    SysCount          int64 `protobuf:"zigzag64,13,opt,name=sys_count,json=sysCount,proto3" json:"sys_count,omitempty"`
}

MVCCStatsDelta is convertible to MVCCStats, but uses signed variable width encodings for most fields that make it more efficient to store negative values. This makes the encodings incompatible.

func (*MVCCStatsDelta) Descriptor Uses

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

func (*MVCCStatsDelta) Equal Uses

func (this *MVCCStatsDelta) Equal(that interface{}) bool

func (*MVCCStatsDelta) Marshal Uses

func (m *MVCCStatsDelta) Marshal() (dAtA []byte, err error)

func (*MVCCStatsDelta) MarshalTo Uses

func (m *MVCCStatsDelta) MarshalTo(dAtA []byte) (int, error)

func (*MVCCStatsDelta) ProtoMessage Uses

func (*MVCCStatsDelta) ProtoMessage()

func (*MVCCStatsDelta) Reset Uses

func (m *MVCCStatsDelta) Reset()

func (*MVCCStatsDelta) Size Uses

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

func (*MVCCStatsDelta) String Uses

func (m *MVCCStatsDelta) String() string

func (*MVCCStatsDelta) ToStats Uses

func (ms *MVCCStatsDelta) ToStats() MVCCStats

ToStats converts the receiver to an MVCCStats.

func (*MVCCStatsDelta) Unmarshal Uses

func (m *MVCCStatsDelta) Unmarshal(dAtA []byte) error

func (*MVCCStatsDelta) XXX_DiscardUnknown Uses

func (m *MVCCStatsDelta) XXX_DiscardUnknown()

func (*MVCCStatsDelta) XXX_Marshal Uses

func (m *MVCCStatsDelta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MVCCStatsDelta) XXX_Merge Uses

func (dst *MVCCStatsDelta) XXX_Merge(src proto.Message)

func (*MVCCStatsDelta) XXX_Size Uses

func (m *MVCCStatsDelta) XXX_Size() int

func (*MVCCStatsDelta) XXX_Unmarshal Uses

func (m *MVCCStatsDelta) XXX_Unmarshal(b []byte) error

type MVCCUpdateIntentOp Uses

type MVCCUpdateIntentOp struct {
    TxnID     github_com_cockroachdb_cockroach_pkg_util_uuid.UUID `protobuf:"bytes,1,opt,name=txn_id,json=txnId,proto3,customtype=github.com/cockroachdb/cockroach/pkg/util/uuid.UUID" json:"txn_id"`
    Timestamp hlc.Timestamp                                       `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp"`
}

MVCCUpdateIntentOp corresponds to an intent being updates at a larger timestamp for a given transaction.

func (*MVCCUpdateIntentOp) Descriptor Uses

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

func (*MVCCUpdateIntentOp) Marshal Uses

func (m *MVCCUpdateIntentOp) Marshal() (dAtA []byte, err error)

func (*MVCCUpdateIntentOp) MarshalTo Uses

func (m *MVCCUpdateIntentOp) MarshalTo(dAtA []byte) (int, error)

func (*MVCCUpdateIntentOp) ProtoMessage Uses

func (*MVCCUpdateIntentOp) ProtoMessage()

func (*MVCCUpdateIntentOp) Reset Uses

func (m *MVCCUpdateIntentOp) Reset()

func (*MVCCUpdateIntentOp) Size Uses

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

func (*MVCCUpdateIntentOp) String Uses

func (m *MVCCUpdateIntentOp) String() string

func (*MVCCUpdateIntentOp) Unmarshal Uses

func (m *MVCCUpdateIntentOp) Unmarshal(dAtA []byte) error

func (*MVCCUpdateIntentOp) XXX_DiscardUnknown Uses

func (m *MVCCUpdateIntentOp) XXX_DiscardUnknown()

func (*MVCCUpdateIntentOp) XXX_Marshal Uses

func (m *MVCCUpdateIntentOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MVCCUpdateIntentOp) XXX_Merge Uses

func (dst *MVCCUpdateIntentOp) XXX_Merge(src proto.Message)

func (*MVCCUpdateIntentOp) XXX_Size Uses

func (m *MVCCUpdateIntentOp) XXX_Size() int

func (*MVCCUpdateIntentOp) XXX_Unmarshal Uses

func (m *MVCCUpdateIntentOp) XXX_Unmarshal(b []byte) error

type MVCCWriteIntentOp Uses

type MVCCWriteIntentOp struct {
    TxnID           github_com_cockroachdb_cockroach_pkg_util_uuid.UUID `protobuf:"bytes,1,opt,name=txn_id,json=txnId,proto3,customtype=github.com/cockroachdb/cockroach/pkg/util/uuid.UUID" json:"txn_id"`
    TxnKey          []byte                                              `protobuf:"bytes,2,opt,name=txn_key,json=txnKey,proto3" json:"txn_key,omitempty"`
    TxnMinTimestamp hlc.Timestamp                                       `protobuf:"bytes,4,opt,name=txn_min_timestamp,json=txnMinTimestamp,proto3" json:"txn_min_timestamp"`
    Timestamp       hlc.Timestamp                                       `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp"`
}

MVCCUpdateIntentOp corresponds to an intent being written for a given transaction.

func (*MVCCWriteIntentOp) Descriptor Uses

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

func (*MVCCWriteIntentOp) Marshal Uses

func (m *MVCCWriteIntentOp) Marshal() (dAtA []byte, err error)

func (*MVCCWriteIntentOp) MarshalTo Uses

func (m *MVCCWriteIntentOp) MarshalTo(dAtA []byte) (int, error)

func (*MVCCWriteIntentOp) ProtoMessage Uses

func (*MVCCWriteIntentOp) ProtoMessage()

func (*MVCCWriteIntentOp) Reset Uses

func (m *MVCCWriteIntentOp) Reset()

func (*MVCCWriteIntentOp) Size Uses

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

func (*MVCCWriteIntentOp) String Uses

func (m *MVCCWriteIntentOp) String() string

func (*MVCCWriteIntentOp) Unmarshal Uses

func (m *MVCCWriteIntentOp) Unmarshal(dAtA []byte) error

func (*MVCCWriteIntentOp) XXX_DiscardUnknown Uses

func (m *MVCCWriteIntentOp) XXX_DiscardUnknown()

func (*MVCCWriteIntentOp) XXX_Marshal Uses

func (m *MVCCWriteIntentOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MVCCWriteIntentOp) XXX_Merge Uses

func (dst *MVCCWriteIntentOp) XXX_Merge(src proto.Message)

func (*MVCCWriteIntentOp) XXX_Size Uses

func (m *MVCCWriteIntentOp) XXX_Size() int

func (*MVCCWriteIntentOp) XXX_Unmarshal Uses

func (m *MVCCWriteIntentOp) XXX_Unmarshal(b []byte) error

type MVCCWriteValueOp Uses

type MVCCWriteValueOp struct {
    Key       []byte        `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
    Timestamp hlc.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp"`
    Value     []byte        `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
}

MVCCWriteValueOp corresponds to a value being written outside of a transaction.

func (*MVCCWriteValueOp) Descriptor Uses

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

func (*MVCCWriteValueOp) Marshal Uses

func (m *MVCCWriteValueOp) Marshal() (dAtA []byte, err error)

func (*MVCCWriteValueOp) MarshalTo Uses

func (m *MVCCWriteValueOp) MarshalTo(dAtA []byte) (int, error)

func (*MVCCWriteValueOp) ProtoMessage Uses

func (*MVCCWriteValueOp) ProtoMessage()

func (*MVCCWriteValueOp) Reset Uses

func (m *MVCCWriteValueOp) Reset()

func (*MVCCWriteValueOp) Size Uses

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

func (*MVCCWriteValueOp) String Uses

func (m *MVCCWriteValueOp) String() string

func (*MVCCWriteValueOp) Unmarshal Uses

func (m *MVCCWriteValueOp) Unmarshal(dAtA []byte) error

func (*MVCCWriteValueOp) XXX_DiscardUnknown Uses

func (m *MVCCWriteValueOp) XXX_DiscardUnknown()

func (*MVCCWriteValueOp) XXX_Marshal Uses

func (m *MVCCWriteValueOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MVCCWriteValueOp) XXX_Merge Uses

func (dst *MVCCWriteValueOp) XXX_Merge(src proto.Message)

func (*MVCCWriteValueOp) XXX_Size Uses

func (m *MVCCWriteValueOp) XXX_Size() int

func (*MVCCWriteValueOp) XXX_Unmarshal Uses

func (m *MVCCWriteValueOp) XXX_Unmarshal(b []byte) error

type RangeAppliedState Uses

type RangeAppliedState struct {
    // raft_applied_index is the highest (and last) index applied to the Raft
    // state machine.
    RaftAppliedIndex uint64 `protobuf:"varint,1,opt,name=raft_applied_index,json=raftAppliedIndex,proto3" json:"raft_applied_index,omitempty"`
    // lease_applied_index is the highest (and last) lease index applied to the
    // Raft state machine.
    LeaseAppliedIndex uint64 `protobuf:"varint,2,opt,name=lease_applied_index,json=leaseAppliedIndex,proto3" json:"lease_applied_index,omitempty"`
    // range_stats is the set of mvcc stats that accounts for the current value
    // of the Raft state machine.
    RangeStats MVCCPersistentStats `protobuf:"bytes,3,opt,name=range_stats,json=rangeStats,proto3" json:"range_stats"`
}

RangeAppliedState combines the raft and lease applied indices with mvcc stats. These are all persisted on each transition of the Raft state machine (i.e. on each Raft application), so they are stored in the same RocksDB key for efficiency.

func NewPopulatedRangeAppliedState Uses

func NewPopulatedRangeAppliedState(r randyMvcc3, easy bool) *RangeAppliedState

func (*RangeAppliedState) Descriptor Uses

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

func (*RangeAppliedState) Equal Uses

func (this *RangeAppliedState) Equal(that interface{}) bool

func (*RangeAppliedState) Marshal Uses

func (m *RangeAppliedState) Marshal() (dAtA []byte, err error)

func (*RangeAppliedState) MarshalTo Uses

func (m *RangeAppliedState) MarshalTo(dAtA []byte) (int, error)

func (*RangeAppliedState) ProtoMessage Uses

func (*RangeAppliedState) ProtoMessage()

func (*RangeAppliedState) Reset Uses

func (m *RangeAppliedState) Reset()

func (*RangeAppliedState) Size Uses

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

func (*RangeAppliedState) String Uses

func (m *RangeAppliedState) String() string

func (*RangeAppliedState) Unmarshal Uses

func (m *RangeAppliedState) Unmarshal(dAtA []byte) error

func (*RangeAppliedState) XXX_DiscardUnknown Uses

func (m *RangeAppliedState) XXX_DiscardUnknown()

func (*RangeAppliedState) XXX_Marshal Uses

func (m *RangeAppliedState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RangeAppliedState) XXX_Merge Uses

func (dst *RangeAppliedState) XXX_Merge(src proto.Message)

func (*RangeAppliedState) XXX_Size Uses

func (m *RangeAppliedState) XXX_Size() int

func (*RangeAppliedState) XXX_Unmarshal Uses

func (m *RangeAppliedState) XXX_Unmarshal(b []byte) error

type RegistryVersion Uses

type RegistryVersion int32
const (
    // The only version so far.
    RegistryVersion_Base RegistryVersion = 0
)

func (RegistryVersion) EnumDescriptor Uses

func (RegistryVersion) EnumDescriptor() ([]byte, []int)

func (RegistryVersion) String Uses

func (x RegistryVersion) String() string

type SSTUserProperties Uses

type SSTUserProperties struct {
    Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
    // ts_min is the minimum mvcc timestamp present in this sstable.
    TsMin *hlc.Timestamp `protobuf:"bytes,2,opt,name=ts_min,json=tsMin,proto3" json:"ts_min,omitempty"`
    // ts_max is the maximum mvcc timestamp present in this sstable.
    TsMax *hlc.Timestamp `protobuf:"bytes,3,opt,name=ts_max,json=tsMax,proto3" json:"ts_max,omitempty"`
}

SSTUserProperties contains the user-added properties of a single sstable.

func (*SSTUserProperties) Descriptor Uses

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

func (*SSTUserProperties) Marshal Uses

func (m *SSTUserProperties) Marshal() (dAtA []byte, err error)

func (*SSTUserProperties) MarshalTo Uses

func (m *SSTUserProperties) MarshalTo(dAtA []byte) (int, error)

func (*SSTUserProperties) ProtoMessage Uses

func (*SSTUserProperties) ProtoMessage()

func (*SSTUserProperties) Reset Uses

func (m *SSTUserProperties) Reset()

func (*SSTUserProperties) Size Uses

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

func (*SSTUserProperties) String Uses

func (m *SSTUserProperties) String() string

func (*SSTUserProperties) Unmarshal Uses

func (m *SSTUserProperties) Unmarshal(dAtA []byte) error

func (*SSTUserProperties) XXX_DiscardUnknown Uses

func (m *SSTUserProperties) XXX_DiscardUnknown()

func (*SSTUserProperties) XXX_Marshal Uses

func (m *SSTUserProperties) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SSTUserProperties) XXX_Merge Uses

func (dst *SSTUserProperties) XXX_Merge(src proto.Message)

func (*SSTUserProperties) XXX_Size Uses

func (m *SSTUserProperties) XXX_Size() int

func (*SSTUserProperties) XXX_Unmarshal Uses

func (m *SSTUserProperties) XXX_Unmarshal(b []byte) error

type SSTUserPropertiesCollection Uses

type SSTUserPropertiesCollection struct {
    Sst   []SSTUserProperties `protobuf:"bytes,1,rep,name=sst,proto3" json:"sst"`
    Error string              `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
}

SSTUserPropertiesCollection contains the user-added properties of every sstable in a RocksDB instance.

func (*SSTUserPropertiesCollection) Descriptor Uses

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

func (*SSTUserPropertiesCollection) Marshal Uses

func (m *SSTUserPropertiesCollection) Marshal() (dAtA []byte, err error)

func (*SSTUserPropertiesCollection) MarshalTo Uses

func (m *SSTUserPropertiesCollection) MarshalTo(dAtA []byte) (int, error)

func (*SSTUserPropertiesCollection) ProtoMessage Uses

func (*SSTUserPropertiesCollection) ProtoMessage()

func (*SSTUserPropertiesCollection) Reset Uses

func (m *SSTUserPropertiesCollection) Reset()

func (*SSTUserPropertiesCollection) Size Uses

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

func (*SSTUserPropertiesCollection) String Uses

func (m *SSTUserPropertiesCollection) String() string

func (*SSTUserPropertiesCollection) Unmarshal Uses

func (m *SSTUserPropertiesCollection) Unmarshal(dAtA []byte) error

func (*SSTUserPropertiesCollection) XXX_DiscardUnknown Uses

func (m *SSTUserPropertiesCollection) XXX_DiscardUnknown()

func (*SSTUserPropertiesCollection) XXX_Marshal Uses

func (m *SSTUserPropertiesCollection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SSTUserPropertiesCollection) XXX_Merge Uses

func (dst *SSTUserPropertiesCollection) XXX_Merge(src proto.Message)

func (*SSTUserPropertiesCollection) XXX_Size Uses

func (m *SSTUserPropertiesCollection) XXX_Size() int

func (*SSTUserPropertiesCollection) XXX_Unmarshal Uses

func (m *SSTUserPropertiesCollection) XXX_Unmarshal(b []byte) error

type TickersAndHistograms Uses

type TickersAndHistograms struct {
    Tickers    map[string]uint64        `protobuf:"bytes,1,rep,name=tickers,proto3" json:"tickers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
    Histograms map[string]HistogramData `protobuf:"bytes,2,rep,name=histograms,proto3" json:"histograms" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}

TickersAndHistograms holds maps from ticker/histogram name to its value for all stats measured by a `rocksdb::Statistics` object.

func (*TickersAndHistograms) Descriptor Uses

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

func (*TickersAndHistograms) Marshal Uses

func (m *TickersAndHistograms) Marshal() (dAtA []byte, err error)

func (*TickersAndHistograms) MarshalTo Uses

func (m *TickersAndHistograms) MarshalTo(dAtA []byte) (int, error)

func (*TickersAndHistograms) ProtoMessage Uses

func (*TickersAndHistograms) ProtoMessage()

func (*TickersAndHistograms) Reset Uses

func (m *TickersAndHistograms) Reset()

func (*TickersAndHistograms) Size Uses

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

func (*TickersAndHistograms) String Uses

func (m *TickersAndHistograms) String() string

func (*TickersAndHistograms) Unmarshal Uses

func (m *TickersAndHistograms) Unmarshal(dAtA []byte) error

func (*TickersAndHistograms) XXX_DiscardUnknown Uses

func (m *TickersAndHistograms) XXX_DiscardUnknown()

func (*TickersAndHistograms) XXX_Marshal Uses

func (m *TickersAndHistograms) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TickersAndHistograms) XXX_Merge Uses

func (dst *TickersAndHistograms) XXX_Merge(src proto.Message)

func (*TickersAndHistograms) XXX_Size Uses

func (m *TickersAndHistograms) XXX_Size() int

func (*TickersAndHistograms) XXX_Unmarshal Uses

func (m *TickersAndHistograms) XXX_Unmarshal(b []byte) error

type TxnEpoch Uses

type TxnEpoch int32

TxnEpoch is a zero-indexed epoch for a transaction. When a transaction retries, it increments its epoch, invalidating all of its previous writes.

type TxnMeta Uses

type TxnMeta struct {
    // id is a unique UUID value which identifies the transaction.
    // This field is always filled in.
    ID  github_com_cockroachdb_cockroach_pkg_util_uuid.UUID `protobuf:"bytes,1,opt,name=id,proto3,customtype=github.com/cockroachdb/cockroach/pkg/util/uuid.UUID" json:"id"`
    // 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 []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
    // Incremented on txn retry.
    Epoch TxnEpoch `protobuf:"varint,4,opt,name=epoch,proto3,casttype=TxnEpoch" json:"epoch,omitempty"`
    // The proposed timestamp for the transaction. This starts as the current wall
    // time on the txn coordinator, and is forwarded by the timestamp cache if the
    // txn attempts to write "beneath" another txn's writes.
    //
    // Writes within the txn are performed using the most up-to-date value of this
    // timestamp that is available. For example, suppose a txn starts at some
    // timestamp, writes a key/value, and has its timestamp forwarded while doing
    // so because a later version already exists at that key. As soon as the txn
    // coordinator learns of the updated timestamp, it will begin performing
    // writes at the updated timestamp. The coordinator may, however, continue
    // issuing writes at the original timestamp before it learns about the
    // forwarded timestamp. The process of resolving the intents when the txn
    // commits will bump any intents written at an older timestamp to the final
    // commit timestamp.
    //
    // Note that reads do not occur at this timestamp; they instead occur at
    // OrigTimestamp, which is tracked in the containing roachpb.Transaction.
    //
    // Writes used to be performed at the txn's original timestamp, which was
    // necessary to avoid lost update anomalies in snapshot isolation mode. We no
    // longer support snapshot isolation mode, and there are now several important
    // reasons that writes are performed at this timestamp instead of the txn's
    // original timestamp:
    //
    //    1. This timestamp is forwarded by the timestamp cache when this
    //       transaction attempts to write beneath a more recent read. Leaving the
    //       intent at the original timestamp would write beneath that read, which
    //       would violate an invariant that time-bound iterators rely on.
    //
    //       For example, consider a client that uses a time-bound iterator to
    //       poll for changes to a key. The client reads (ts5, ts10], sees no
    //       writes, and reports that no changes have occurred up to t10. Then a
    //       txn writes an intent at its original timestamp ts7. The txn's
    //       timestamp is forwarded to ts11 by the timestamp cache thanks to the
    //       client's read. Meanwhile, the client reads (ts10, ts15] and, again
    //       seeing no intents, reports that no changes have occurred to the key
    //       up to t15. Now the txn commits at ts11 and bumps the intent to ts11.
    //       But the client thinks it has seen all changes up to t15, and so never
    //       sees the intent! We avoid this problem by writing intents at the
    //       provisional commit timestamp insteadr. In this example, the intent
    //       would instead be written at ts11 and picked up by the client's next
    //       read from (ts10, ts15].
    //
    //    2. Unnecessary PushTxn roundtrips are avoided. If a transaction is
    //       forwarded from ts5 to ts10, the rest of its intents will be written
    //       at ts10. Reads at t < ts10 that encounter these intents can ignore
    //       them; if the intents had instead been left at ts5, these reads would
    //       have needed to send PushTxn requests just to find out that the txn
    //       had, in fact, been forwarded to a non-conflicting time.
    //
    //    3. Unnecessary intent rewriting is avoided. Writing at the original
    //       timestamp when this timestamp has been forwarded guarantees that the
    //       value will need to be rewritten at the forwarded timestamp if the
    //       transaction commits.
    //
    Timestamp hlc.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp"`
    // The timestamp that the transaction was assigned by its gateway when it
    // began its first epoch. This is the earliest timestamp that the transaction
    // could have written any of its intents at.
    //
    // The timestamp is currently used in two places:
    // 1. by the transaction itself and by concurrent transactions when
    //    determining whether this transaction's record can be initially
    //    written. The timestamp is compared against the transaction's
    //    corresponding write timestamp cache entry to ensure that a
    //    finalized transaction can never commit, either after a replay
    //    or a transaction abort. See CanCreateTxnRecord.
    // 2. by intent resolution to efficiently scan for intents while
    //    using a time-bound iterator - i.e. there can be intents to
    //    resolve up to the timestamp that the txn started with.
    MinTimestamp hlc.Timestamp `protobuf:"bytes,9,opt,name=min_timestamp,json=minTimestamp,proto3" json:"min_timestamp"`
    // The transaction's priority, ratcheted on transaction pushes.
    Priority TxnPriority `protobuf:"varint,6,opt,name=priority,proto3,casttype=TxnPriority" json:"priority,omitempty"`
    // A zero-indexed sequence number which is increased on each request
    // sent as part of the transaction. When set in the header of a batch of
    // requests, the value will correspond to the sequence number of the
    // last request. Used to provide idempotency and to protect against
    // out-of-order application (by means of a transaction retry).
    Sequence TxnSeq `protobuf:"varint,7,opt,name=sequence,proto3,casttype=TxnSeq" json:"sequence,omitempty"`
}

TxnMeta is the metadata of a Transaction record.

func NewPopulatedTxnMeta Uses

func NewPopulatedTxnMeta(r randyMvcc3, easy bool) *TxnMeta

func (*TxnMeta) Descriptor Uses

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

func (*TxnMeta) Equal Uses

func (this *TxnMeta) Equal(that interface{}) bool

func (*TxnMeta) Marshal Uses

func (m *TxnMeta) Marshal() (dAtA []byte, err error)

func (*TxnMeta) MarshalTo Uses

func (m *TxnMeta) MarshalTo(dAtA []byte) (int, error)

func (*TxnMeta) ProtoMessage Uses

func (*TxnMeta) ProtoMessage()

func (*TxnMeta) Reset Uses

func (m *TxnMeta) Reset()

func (TxnMeta) Short Uses

func (t TxnMeta) Short() string

Short returns a prefix of the transaction's ID.

func (*TxnMeta) Size Uses

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

func (*TxnMeta) String Uses

func (m *TxnMeta) String() string

func (*TxnMeta) Unmarshal Uses

func (m *TxnMeta) Unmarshal(dAtA []byte) error

func (*TxnMeta) XXX_DiscardUnknown Uses

func (m *TxnMeta) XXX_DiscardUnknown()

func (*TxnMeta) XXX_Marshal Uses

func (m *TxnMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxnMeta) XXX_Merge Uses

func (dst *TxnMeta) XXX_Merge(src proto.Message)

func (*TxnMeta) XXX_Size Uses

func (m *TxnMeta) XXX_Size() int

func (*TxnMeta) XXX_Unmarshal Uses

func (m *TxnMeta) XXX_Unmarshal(b []byte) error

type TxnPriority Uses

type TxnPriority int32

TxnPriority defines the priority that a transaction operates at. Transactions with high priorities are preferred over transaction with low priorities when resolving conflicts between themselves. For example, transaction priorities are used to determine which transaction to abort when resolving transaction deadlocks.

const (
    // MinTxnPriority is the minimum allowed txn priority.
    MinTxnPriority TxnPriority = 0
    // MaxTxnPriority is the maximum allowed txn priority.
    MaxTxnPriority TxnPriority = math.MaxInt32
)

type TxnSeq Uses

type TxnSeq int32

TxnSeq is a zero-indexed sequence number asssigned to a a request performed by a transaction. Writes within a transaction have unique sequences and start at sequence number 1. Reads within a transaction have non-unique sequences and start at sequence number 0.

Writes within a transaction logically take place in sequence number order. Reads within a transaction observe only writes performed by the transaction at equal or lower sequence numbers.

Package enginepb imports 11 packages (graph) and is imported by 51 packages. Updated 2019-08-30. Refresh now. Tools for package owners.