Documentation ¶
Index ¶
- Constants
- type ATSConsistentHash
- type ATSConsistentHashNode
- type OrderedMapUint64Node
- type OrderedMapUint64NodeIterator
- type SimpleATSConsistentHash
- func (h *SimpleATSConsistentHash) First() OrderedMapUint64NodeIterator
- func (h *SimpleATSConsistentHash) Insert(node *ATSConsistentHashNode, weight float64) error
- func (h *SimpleATSConsistentHash) Lookup(name string) (OrderedMapUint64NodeIterator, bool, error)
- func (h *SimpleATSConsistentHash) LookupHash(hashVal uint64) (OrderedMapUint64NodeIterator, bool)
- func (h *SimpleATSConsistentHash) LookupIter(i OrderedMapUint64NodeIterator) (OrderedMapUint64NodeIterator, bool)
- func (h *SimpleATSConsistentHash) String() string
- type SimpleOrderedMapUInt64Node
- func (m *SimpleOrderedMapUInt64Node) At(i int) (uint64, *ATSConsistentHashNode)
- func (m *SimpleOrderedMapUInt64Node) First() OrderedMapUint64NodeIterator
- func (m *SimpleOrderedMapUInt64Node) Insert(key uint64, val *ATSConsistentHashNode)
- func (m *SimpleOrderedMapUInt64Node) InsertBulk(keys []uint64, vals []*ATSConsistentHashNode) error
- func (m *SimpleOrderedMapUInt64Node) Last() OrderedMapUint64NodeIterator
- func (m *SimpleOrderedMapUInt64Node) LowerBound(key uint64) OrderedMapUint64NodeIterator
- func (m *SimpleOrderedMapUInt64Node) String() string
- type SimpleOrderedMapUint64NodeIterator
- func (i *SimpleOrderedMapUint64NodeIterator) Index() int
- func (i *SimpleOrderedMapUint64NodeIterator) Key() uint64
- func (i *SimpleOrderedMapUint64NodeIterator) Next() OrderedMapUint64NodeIterator
- func (i *SimpleOrderedMapUint64NodeIterator) NextWrap() OrderedMapUint64NodeIterator
- func (i *SimpleOrderedMapUint64NodeIterator) Prev() OrderedMapUint64NodeIterator
- func (i *SimpleOrderedMapUint64NodeIterator) Val() *ATSConsistentHashNode
- type SortableUint64
Constants ¶
View Source
const DefaultSimpleATSConsistentHashReplicas = 1024
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ATSConsistentHash ¶
type ATSConsistentHash interface { Insert(node *ATSConsistentHashNode, weight float64) error String() string // Lookup returns the found node, its map iterator, and whether the lookup wrapped Lookup(name string) (OrderedMapUint64NodeIterator, bool, error) LookupHash(hashVal uint64) (OrderedMapUint64NodeIterator, bool) LookupIter(OrderedMapUint64NodeIterator) (OrderedMapUint64NodeIterator, bool) First() OrderedMapUint64NodeIterator // debug }
func NewSimpleATSConsistentHash ¶
func NewSimpleATSConsistentHash(replicas int) ATSConsistentHash
type ATSConsistentHashNode ¶
type ATSConsistentHashNode struct { Available bool Name string ProxyURL *url.URL Transport *http.Transport // pRecord fields (ParentSelection.h) Hostname string Port int FailedAt time.Time FailCount int UpAt int Scheme string Index int Weight float64 }
ATSConsistentHashNode is an ATS ParentRecord
func (ATSConsistentHashNode) String ¶
func (n ATSConsistentHashNode) String() string
type OrderedMapUint64Node ¶
type OrderedMapUint64Node interface { Insert(key uint64, val *ATSConsistentHashNode) String() string InsertBulk(keys []uint64, vals []*ATSConsistentHashNode) error First() OrderedMapUint64NodeIterator Last() OrderedMapUint64NodeIterator At(index int) (uint64, *ATSConsistentHashNode) LowerBound(val uint64) OrderedMapUint64NodeIterator }
func NewSimpleOrderedMapUint64Node ¶
func NewSimpleOrderedMapUint64Node() OrderedMapUint64Node
type OrderedMapUint64NodeIterator ¶
type OrderedMapUint64NodeIterator interface { Val() *ATSConsistentHashNode Key() uint64 Next() OrderedMapUint64NodeIterator NextWrap() OrderedMapUint64NodeIterator Index() int }
func NewSimpleOrderedMapUint64NodeIterator ¶
func NewSimpleOrderedMapUint64NodeIterator(key uint64, val *ATSConsistentHashNode, index int, m *SimpleOrderedMapUInt64Node) OrderedMapUint64NodeIterator
type SimpleATSConsistentHash ¶
type SimpleATSConsistentHash struct { Replicas int NodeMap OrderedMapUint64Node }
func (*SimpleATSConsistentHash) First ¶
func (h *SimpleATSConsistentHash) First() OrderedMapUint64NodeIterator
func (*SimpleATSConsistentHash) Insert ¶
func (h *SimpleATSConsistentHash) Insert(node *ATSConsistentHashNode, weight float64) error
func (*SimpleATSConsistentHash) Lookup ¶
func (h *SimpleATSConsistentHash) Lookup(name string) (OrderedMapUint64NodeIterator, bool, error)
Lookup returns the found node, its map iterator, and whether the lookup wrapped
func (*SimpleATSConsistentHash) LookupHash ¶
func (h *SimpleATSConsistentHash) LookupHash(hashVal uint64) (OrderedMapUint64NodeIterator, bool)
func (*SimpleATSConsistentHash) LookupIter ¶
func (h *SimpleATSConsistentHash) LookupIter(i OrderedMapUint64NodeIterator) (OrderedMapUint64NodeIterator, bool)
func (*SimpleATSConsistentHash) String ¶
func (h *SimpleATSConsistentHash) String() string
type SimpleOrderedMapUInt64Node ¶
type SimpleOrderedMapUInt64Node struct { M map[uint64]*ATSConsistentHashNode O []uint64 }
func (*SimpleOrderedMapUInt64Node) At ¶
func (m *SimpleOrderedMapUInt64Node) At(i int) (uint64, *ATSConsistentHashNode)
func (*SimpleOrderedMapUInt64Node) First ¶
func (m *SimpleOrderedMapUInt64Node) First() OrderedMapUint64NodeIterator
First returns the iterator to the first element in the map. Returns nil if the map is empty
func (*SimpleOrderedMapUInt64Node) Insert ¶
func (m *SimpleOrderedMapUInt64Node) Insert(key uint64, val *ATSConsistentHashNode)
func (*SimpleOrderedMapUInt64Node) InsertBulk ¶
func (m *SimpleOrderedMapUInt64Node) InsertBulk(keys []uint64, vals []*ATSConsistentHashNode) error
func (*SimpleOrderedMapUInt64Node) Last ¶
func (m *SimpleOrderedMapUInt64Node) Last() OrderedMapUint64NodeIterator
Last returns the iterator to the last element in the map. Returns nil if the map is empty
func (*SimpleOrderedMapUInt64Node) LowerBound ¶
func (m *SimpleOrderedMapUInt64Node) LowerBound(key uint64) OrderedMapUint64NodeIterator
func (*SimpleOrderedMapUInt64Node) String ¶
func (m *SimpleOrderedMapUInt64Node) String() string
type SimpleOrderedMapUint64NodeIterator ¶
type SimpleOrderedMapUint64NodeIterator struct {
// contains filtered or unexported fields
}
func (*SimpleOrderedMapUint64NodeIterator) Index ¶
func (i *SimpleOrderedMapUint64NodeIterator) Index() int
func (*SimpleOrderedMapUint64NodeIterator) Key ¶
func (i *SimpleOrderedMapUint64NodeIterator) Key() uint64
func (*SimpleOrderedMapUint64NodeIterator) Next ¶
func (i *SimpleOrderedMapUint64NodeIterator) Next() OrderedMapUint64NodeIterator
func (*SimpleOrderedMapUint64NodeIterator) NextWrap ¶
func (i *SimpleOrderedMapUint64NodeIterator) NextWrap() OrderedMapUint64NodeIterator
func (*SimpleOrderedMapUint64NodeIterator) Prev ¶
func (i *SimpleOrderedMapUint64NodeIterator) Prev() OrderedMapUint64NodeIterator
func (*SimpleOrderedMapUint64NodeIterator) Val ¶
func (i *SimpleOrderedMapUint64NodeIterator) Val() *ATSConsistentHashNode
type SortableUint64 ¶
type SortableUint64 []uint64
func (SortableUint64) Len ¶
func (a SortableUint64) Len() int
func (SortableUint64) Less ¶
func (a SortableUint64) Less(i, j int) bool
func (SortableUint64) Swap ¶
func (a SortableUint64) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.