cockroach: github.com/cockroachdb/cockroach/pkg/kv/kvserver/protectedts/ptpb Index | Files

package ptpb

import "github.com/cockroachdb/cockroach/pkg/kv/kvserver/protectedts/ptpb"

Index

Package Files

protectedts.pb.go

Variables

var (
    ErrInvalidLengthProtectedts = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowProtectedts   = fmt.Errorf("proto: integer overflow")
)
var ProtectionMode_name = map[int32]string{
    0: "PROTECT_AFTER",
}
var ProtectionMode_value = map[string]int32{
    "PROTECT_AFTER": 0,
}

type Metadata Uses

type Metadata struct {
    // Version is incremented whenever a Record is created or removed.
    Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
    // NumRecords is the number of records which exist in the subsystem.
    NumRecords uint64 `protobuf:"varint,2,opt,name=num_records,json=numRecords,proto3" json:"num_records,omitempty"`
    // NumSpans is the number of spans currently being protected by the
    // protectedts subsystem.
    NumSpans uint64 `protobuf:"varint,3,opt,name=num_spans,json=numSpans,proto3" json:"num_spans,omitempty"`
    // TotalBytes is the number of bytes currently in use by records
    // to store their spans and metadata.
    TotalBytes uint64 `protobuf:"varint,4,opt,name=total_bytes,json=totalBytes,proto3" json:"total_bytes,omitempty"`
}

Metadata is the system metadata. The metadata is stored explicitly and all operations which create or release Records increment the version and update the metadata fields accordingly.

The version provides a mechanism for cheap caching and forms the basis of the implementation of the Tracker. The Tracker needs to provide a recent view of the protectedts subsystem for GC to proceed. The protectedts state changes rarely. The timestamp of cached state can by updated by merely observing that the version has not changed.

func (*Metadata) Descriptor Uses

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

func (*Metadata) Marshal Uses

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

func (*Metadata) MarshalTo Uses

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

func (*Metadata) ProtoMessage Uses

func (*Metadata) ProtoMessage()

func (*Metadata) Reset Uses

func (m *Metadata) Reset()

func (*Metadata) Size Uses

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

func (*Metadata) String Uses

func (m *Metadata) String() string

func (*Metadata) Unmarshal Uses

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

func (*Metadata) XXX_DiscardUnknown Uses

func (m *Metadata) XXX_DiscardUnknown()

func (*Metadata) XXX_Marshal Uses

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

func (*Metadata) XXX_Merge Uses

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

func (*Metadata) XXX_Size Uses

func (m *Metadata) XXX_Size() int

func (*Metadata) XXX_Unmarshal Uses

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

type ProtectionMode Uses

type ProtectionMode int32

ProtectionMode defines the semantics of a Record.

const (
    // PROTECT_AFTER ensures that all data values live at or after the specified
    // timestamp will be protected from GC.
    PROTECT_AFTER ProtectionMode = 0
)

func (ProtectionMode) EnumDescriptor Uses

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

func (ProtectionMode) String Uses

func (x ProtectionMode) String() string

type Record Uses

type Record struct {
    // ID uniquely identifies this row.
    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"`
    // Timestamp is the timestamp which is protected.
    Timestamp hlc.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp"`
    // Mode specifies whether this record protects all values live at timestamp
    // or all values live at or after that timestamp.
    Mode ProtectionMode `protobuf:"varint,3,opt,name=mode,proto3,enum=cockroach.protectedts.ProtectionMode" json:"mode,omitempty"`
    // MetaType is used to interpret the data stored in Meta.
    // Users of Meta should set a unique value for MetaType which provides enough
    // information to interpret the data in Meta. See the comment on Meta for how
    // these two fields should be used in tandem.
    MetaType string `protobuf:"bytes,4,opt,name=meta_type,json=metaType,proto3" json:"meta_type,omitempty"`
    // Meta is client-provided metadata about the record.
    // This data allows the Record to be correlated with data from another
    // subsystem. For example, this field may contain the ID of a job which
    // created this record. The metadata allows an out-of-band reconciliation
    // process to discover and remove records which no longer correspond to
    // running jobs. Such a mechanism acts as a failsafe against unreliable
    // jobs infrastructure.
    Meta []byte `protobuf:"bytes,5,opt,name=meta,proto3" json:"meta,omitempty"`
    // Verified marks that this Record is known to have successfully provided
    // protection. It is updated after Verification. Updates to this field do not
    // change the Version of the subsystem.
    Verified bool `protobuf:"varint,6,opt,name=verified,proto3" json:"verified,omitempty"`
    // Spans are the spans which this Record protects.
    Spans []roachpb.Span `protobuf:"bytes,7,rep,name=spans,proto3" json:"spans"`
}

Record corresponds to a protected timestamp.

func (*Record) Descriptor Uses

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

func (*Record) Marshal Uses

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

func (*Record) MarshalTo Uses

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

func (*Record) ProtoMessage Uses

func (*Record) ProtoMessage()

func (*Record) Reset Uses

func (m *Record) Reset()

func (*Record) Size Uses

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

func (*Record) String Uses

func (m *Record) String() string

func (*Record) Unmarshal Uses

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

func (*Record) XXX_DiscardUnknown Uses

func (m *Record) XXX_DiscardUnknown()

func (*Record) XXX_Marshal Uses

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

func (*Record) XXX_Merge Uses

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

func (*Record) XXX_Size Uses

func (m *Record) XXX_Size() int

func (*Record) XXX_Unmarshal Uses

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

type State Uses

type State struct {
    Metadata `protobuf:"bytes,1,opt,name=metadata,proto3,embedded=metadata" json:"metadata"`
    Records  []Record `protobuf:"bytes,2,rep,name=records,proto3" json:"records"`
}

State is the complete system state.

func (*State) Descriptor Uses

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

func (*State) Marshal Uses

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

func (*State) MarshalTo Uses

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

func (*State) ProtoMessage Uses

func (*State) ProtoMessage()

func (*State) Reset Uses

func (m *State) Reset()

func (*State) Size Uses

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

func (*State) String Uses

func (m *State) String() string

func (*State) Unmarshal Uses

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

func (*State) XXX_DiscardUnknown Uses

func (m *State) XXX_DiscardUnknown()

func (*State) XXX_Marshal Uses

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

func (*State) XXX_Merge Uses

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

func (*State) XXX_Size Uses

func (m *State) XXX_Size() int

func (*State) XXX_Unmarshal Uses

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

Package ptpb imports 7 packages (graph) and is imported by 18 packages. Updated 2020-03-06. Refresh now. Tools for package owners.