broker_protocol_extensions

package
v0.85.3-0...-ca5b0a9 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromEtcdResponseHeader

func FromEtcdResponseHeader(h epb.ResponseHeader) pb.Header_Etcd

FromEtcdResponseHeader converts an etcd ResponseHeader to an equivalent Header_Etcd.

func JournalRouteMatchesAssignments

func JournalRouteMatchesAssignments(rt BrokerRoute, assignments keyspace.KeyValues) bool

JournalRouteMatchesAssignments returns true iff the Route is equivalent to the Route marshaled with each of the journal's |assignments|.

func NewUnroutedHeader

func NewUnroutedHeader(s *allocator.State) (hdr pb.Header)

NewUnroutedHeader returns a Header with its ProcessId and Etcd fields derived from the v3_allocator.State, and Route left as zero-valued. It is a helper for APIs which do not utilize item resolution but still return Headers (eg, List and Update).

Types

type BrokerJournalSpec

type BrokerJournalSpec struct {
	JournalSpec pb.JournalSpec
}

func (*BrokerJournalSpec) DesiredReplication

func (m *BrokerJournalSpec) DesiredReplication() int

DesiredReplication returns the configured Replication of the spec. It implements allocator.ItemValue.

func (*BrokerJournalSpec) IsConsistent

func (m *BrokerJournalSpec) IsConsistent(_ keyspace.KeyValue, assignments keyspace.KeyValues) bool

IsConsistent returns true if the Route stored under each of |assignments| agrees with the Route implied by the |assignments| keys. It implements allocator.ItemValue.

type BrokerRoute

type BrokerRoute struct {
	Route pb.Route
}

BrokerRoute extends protocol.Route allowing initialization from allocator assignments and attaching endpoints from a keyspace

func (*BrokerRoute) AttachEndpoints

func (m *BrokerRoute) AttachEndpoints(ks *keyspace.KeySpace)

AttachEndpoints maps Route members through the KeySpace to their respective specs, and attaches the associated Endpoint of each to the Route. KeySpace must already be read-locked.

func (BrokerRoute) Equivalent

func (m BrokerRoute) Equivalent(other *BrokerRoute) bool

func (*BrokerRoute) Init

func (m *BrokerRoute) Init(assignments keyspace.KeyValues)

Init Initializes Route with the provided allocator Assignments.

Jump to

Keyboard shortcuts

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