cockroach: github.com/cockroachdb/cockroach/pkg/storage/closedts/ctpb Index | Files

package ctpb

import "github.com/cockroachdb/cockroach/pkg/storage/closedts/ctpb"

Index

Package Files

client.go entry.go entry.pb.go server.go

Variables

var (
    ErrInvalidLengthEntry = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowEntry   = fmt.Errorf("proto: integer overflow")
)

func RegisterClosedTimestampServer Uses

func RegisterClosedTimestampServer(s *grpc.Server, srv ClosedTimestampServer)

type Client Uses

type Client interface {
    Send(*Reaction) error
    Recv() (*Entry, error)
    CloseSend() error
    Context() context.Context
}

Client is the interface for closed timestamp update clients.

type ClosedTimestampClient Uses

type ClosedTimestampClient interface {
    Get(ctx context.Context, opts ...grpc.CallOption) (ClosedTimestamp_GetClient, error)
}

ClosedTimestampClient is the client API for ClosedTimestamp service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewClosedTimestampClient Uses

func NewClosedTimestampClient(cc *grpc.ClientConn) ClosedTimestampClient

type ClosedTimestampServer Uses

type ClosedTimestampServer interface {
    Get(ClosedTimestamp_GetServer) error
}

ClosedTimestampServer is the server API for ClosedTimestamp service.

type ClosedTimestamp_GetClient Uses

type ClosedTimestamp_GetClient interface {
    Send(*Reaction) error
    Recv() (*Entry, error)
    grpc.ClientStream
}

type ClosedTimestamp_GetServer Uses

type ClosedTimestamp_GetServer interface {
    Send(*Entry) error
    Recv() (*Reaction, error)
    grpc.ServerStream
}

type Entry Uses

type Entry struct {
    Epoch           Epoch                                                        `protobuf:"varint,1,opt,name=epoch,proto3,casttype=Epoch" json:"epoch,omitempty"`
    ClosedTimestamp hlc.Timestamp                                                `protobuf:"bytes,2,opt,name=closed_timestamp,json=closedTimestamp,proto3" json:"closed_timestamp"`
    MLAI            map[github_com_cockroachdb_cockroach_pkg_roachpb.RangeID]LAI `protobuf:"bytes,3,rep,name=mlai,proto3,castkey=github.com/cockroachdb/cockroach/pkg/roachpb.RangeID,castvalue=LAI" json:"mlai,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
    // Full is true if the emitter promises that any future write to any range
    // mentioned in this Entry will be reflected in a subsequent Entry before any
    // stale follower reads are possible. For example, if range 1 is assigned an
    // MLAI of 12 in this Entry and isn't mentioned in the five subsequent
    // entries, the recipient may behave as if the MLAI of 12 were repeated across
    // all of these entries.
    //
    // In practice, a Full message is received when a stream of Entries is first
    // established (or the Epoch changes), and all other updates are incremental
    // (i.e. not Full).
    Full bool `protobuf:"varint,4,opt,name=full,proto3" json:"full,omitempty"`
}

An Entry is a closed timestamp update. It consists of a closed timestamp (i.e. a timestamp at or below which the origin node guarantees no more new writes are going to be permitted), an associated epoch in which the origin node promises it was live (for the closed timestamp), a map of minimum lease applied indexes (which have to be caught up to before being allowed to use the closed timestamp) as well as an indicator of whether this update supplies a full initial state or an increment to be merged into a previous state. In practice, the first Entry received for each epoch is full, while the remainder are incremental. An incremental update represents the implicit promise that the state accumulated since the last full Entry is the true full state.

func (*Entry) Descriptor Uses

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

func (*Entry) Marshal Uses

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

func (*Entry) MarshalTo Uses

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

func (*Entry) ProtoMessage Uses

func (*Entry) ProtoMessage()

func (*Entry) Reset Uses

func (m *Entry) Reset()

func (*Entry) Size Uses

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

func (Entry) String Uses

func (e Entry) String() string

String formats Entry for human consumption as well as testing (by avoiding randomness in the output caused by map iteraton order).

func (*Entry) Unmarshal Uses

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

func (*Entry) XXX_DiscardUnknown Uses

func (m *Entry) XXX_DiscardUnknown()

func (*Entry) XXX_Marshal Uses

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

func (*Entry) XXX_Merge Uses

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

func (*Entry) XXX_Size Uses

func (m *Entry) XXX_Size() int

func (*Entry) XXX_Unmarshal Uses

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

type Epoch Uses

type Epoch int64

Epoch is an int64 with its own type to avoid mix-ups in positional arguments.

type InboundClient Uses

type InboundClient interface {
    Send(*Entry) error
    Recv() (*Reaction, error)
    Context() context.Context
}

InboundClient is an interface that narrows ClosedTimestamp_GetServer down to what's actually required.

type LAI Uses

type LAI int64

LAI is an int64 denoting a lease applied index with its own type to avoid mix-ups in positional arguments.

type Reaction Uses

type Reaction struct {
    Requested []github_com_cockroachdb_cockroach_pkg_roachpb.RangeID `protobuf:"varint,1,rep,packed,name=Requested,proto3,casttype=github.com/cockroachdb/cockroach/pkg/roachpb.RangeID" json:"Requested,omitempty"`
}

Reactions flow in the direction opposite to Entries and request for ranges to be included in the next Entry. Under rare circumstances, ranges may be omitted from closed timestamp updates, and so serving follower reads from them would fail. The Reaction mechanism serves to explicitly request the missing information when that happens.

func (*Reaction) Descriptor Uses

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

func (*Reaction) Marshal Uses

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

func (*Reaction) MarshalTo Uses

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

func (*Reaction) ProtoMessage Uses

func (*Reaction) ProtoMessage()

func (*Reaction) Reset Uses

func (m *Reaction) Reset()

func (*Reaction) Size Uses

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

func (Reaction) String Uses

func (r Reaction) String() string

func (*Reaction) Unmarshal Uses

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

func (*Reaction) XXX_DiscardUnknown Uses

func (m *Reaction) XXX_DiscardUnknown()

func (*Reaction) XXX_Marshal Uses

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

func (*Reaction) XXX_Merge Uses

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

func (*Reaction) XXX_Size Uses

func (m *Reaction) XXX_Size() int

func (*Reaction) XXX_Unmarshal Uses

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

type Server Uses

type Server interface {
    Get(InboundClient) error
}

Server is the interface implemented by types that want to serve incoming closed timestamp update streams.

type ServerShim Uses

type ServerShim struct{ Server }

ServerShim is a wrapper around Server that provides the wider interface that gRPC expects.

func (ServerShim) Get Uses

func (s ServerShim) Get(client ClosedTimestamp_GetServer) error

Get implements ClosedTimestampServer by passing through to the wrapped Server.

Package ctpb imports 11 packages (graph) and is imported by 20 packages. Updated 2019-07-26. Refresh now. Tools for package owners.