storagebase

package
v0.0.0-...-5695764 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package storagebase is a generated protocol buffer package.

It is generated from these files:

cockroach/storage/storagebase/state.proto

It has these top-level messages:

ReplicaState
RangeInfo

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowState   = fmt.Errorf("proto: integer overflow")
)

Functions

This section is empty.

Types

type CmdIDKey

type CmdIDKey string

CmdIDKey is a Raft command id.

type FilterArgs

type FilterArgs struct {
	Ctx   context.Context
	CmdID CmdIDKey
	Index int
	Sid   roachpb.StoreID
	Req   roachpb.Request
	Hdr   roachpb.Header
}

FilterArgs groups the arguments to a ReplicaCommandFilter.

func (*FilterArgs) InRaftCmd

func (f *FilterArgs) InRaftCmd() bool

InRaftCmd returns true if the filter is running in the context of a Raft command (it could be running outside of one, for example for a read).

type RangeInfo

type RangeInfo struct {
	ReplicaState `protobuf:"bytes,1,opt,name=state,embedded=state" json:"state"`
	// The highest (and last) index in the Raft log.
	LastIndex  uint64 `protobuf:"varint,2,opt,name=lastIndex,proto3" json:"lastIndex,omitempty"`
	NumPending uint64 `protobuf:"varint,3,opt,name=num_pending,json=numPending,proto3" json:"num_pending,omitempty"`
}

func (*RangeInfo) Descriptor

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

func (*RangeInfo) Marshal

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

func (*RangeInfo) MarshalTo

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

func (*RangeInfo) ProtoMessage

func (*RangeInfo) ProtoMessage()

func (*RangeInfo) Reset

func (m *RangeInfo) Reset()

func (*RangeInfo) Size

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

func (*RangeInfo) String

func (m *RangeInfo) String() string

func (*RangeInfo) Unmarshal

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

type ReplicaCommandFilter

type ReplicaCommandFilter func(args FilterArgs) *roachpb.Error

ReplicaCommandFilter may be used in tests through the StorageTestingMocker to intercept the handling of commands and artificially generate errors. Return nil to continue with regular processing or non-nil to terminate processing with the returned error. Note that in a multi-replica test this filter will be run once for each replica and must produce consistent results each time.

type ReplicaState

type ReplicaState struct {
	// The highest (and last) index applied to the state machine.
	RaftAppliedIndex uint64 `protobuf:"varint,1,opt,name=raft_applied_index,json=raftAppliedIndex,proto3" json:"raft_applied_index,omitempty"`
	// The highest (and last) lease index applied to the state machine.
	LeaseAppliedIndex uint64 `protobuf:"varint,2,opt,name=lease_applied_index,json=leaseAppliedIndex,proto3" json:"lease_applied_index,omitempty"`
	// The Range descriptor.
	// The pointer may change, but the referenced RangeDescriptor struct itself
	// must be treated as immutable; it is leaked out of the lock.
	//
	// Changes of the descriptor should normally go through one of the
	// (*Replica).setDesc* methods.
	Desc *cockroach_roachpb.RangeDescriptor `protobuf:"bytes,3,opt,name=desc" json:"desc,omitempty"`
	// The latest lease holder, if any.
	Lease *cockroach_roachpb1.Lease `protobuf:"bytes,4,opt,name=lease" json:"lease,omitempty"`
	// The truncation state of the Raft log.
	TruncatedState *cockroach_roachpb2.RaftTruncatedState `protobuf:"bytes,5,opt,name=truncated_state,json=truncatedState" json:"truncated_state,omitempty"`
	// gcThreshold is the GC threshold of the Range, typically updated when keys
	// are garbage collected. Reads and writes at timestamps <= this time will
	// not be served.
	GCThreshold cockroach_util_hlc.Timestamp                `protobuf:"bytes,6,opt,name=gc_threshold,json=gcThreshold" json:"gc_threshold"`
	Stats       cockroach_storage_engine_enginepb.MVCCStats `protobuf:"bytes,7,opt,name=stats" json:"stats"`
	Frozen      bool                                        `protobuf:"varint,8,opt,name=frozen,proto3" json:"frozen,omitempty"`
}

ReplicaState is the part of the Range Raft state machine which is cached in memory and which is manipulated exclusively through consensus.

func (*ReplicaState) Descriptor

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

func (*ReplicaState) Marshal

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

func (*ReplicaState) MarshalTo

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

func (*ReplicaState) ProtoMessage

func (*ReplicaState) ProtoMessage()

func (*ReplicaState) Reset

func (m *ReplicaState) Reset()

func (*ReplicaState) Size

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

func (*ReplicaState) String

func (m *ReplicaState) String() string

func (*ReplicaState) Unmarshal

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL