Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Announce ¶
type Announce struct { Add Map // contains newly discovered endpoints Update Map // contains endpoints with changes (reserved for later use with load factor) Del []InfoShort // contains endpoints that are no longer present in YDB cluster }
Announce consolidates changes observed in YDB endpoints since previous observation.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is thread safe in-memory storage for endpoints.
func (*DB) Compare ¶
func (db *DB) Compare(endpoints []*Ydb_Discovery.EndpointInfo) bool
Compare takes current state of endpoints and compares it with internal endpoints Map. It returns true if incoming state is identical to internal or false otherwise.
func (*DB) Update ¶
func (db *DB) Update(endpoints []*Ydb_Discovery.EndpointInfo) (Announce, int, int)
Update takes current state of endpoints and - updates internal DB accordingly - constructs endpoints announcement that reflects performed changes.
type Filter ¶ added in v0.0.1
func (*Filter) Filter ¶ added in v0.0.1
func (f *Filter) Filter(endpoints []*Ydb_Discovery.EndpointInfo) ( preferred []*Ydb_Discovery.EndpointInfo, notPreferred []*Ydb_Discovery.EndpointInfo, )
func (*Filter) WithQueryService ¶ added in v0.0.1
type InfoShort ¶
type InfoShort struct { Address string Location string AddressHash uint64 NodeID uint32 Port uint32 }
InfoShort uniquely identifies YDB endpoint.
func NewInfoShort ¶
func NewInfoShort(ep *Ydb_Discovery.EndpointInfo) InfoShort
func NewInfoShortFromParams ¶ added in v0.0.2
func (*InfoShort) GetAddress ¶
type Map ¶
type Map map[InfoShort]*Ydb_Discovery.EndpointInfo
Map stores endpoints as kay-value structure.
Click to show internal directories.
Click to hide internal directories.