MCPcopy
hub / github.com/dapr/dapr / Equal

Method Equal

pkg/placement/hashing/consistent_hash.go:114–119  ·  view source on GitHub ↗

Equal reports whether two Hosts have the same identity in the placement ring. The Load field is daprd-local and excluded from the comparison: two Hosts representing the same placement-ring entry can carry different daprd-observed load values without being considered different.

(o *Host)

Source from the content-addressed store, hash-verified

112// Hosts representing the same placement-ring entry can carry different
113// daprd-observed load values without being considered different.
114func (h *Host) Equal(o *Host) bool {
115 if h == nil || o == nil {
116 return h == o
117 }
118 return h.Name == o.Name && h.Port == o.Port && h.AppID == o.AppID
119}
120
121// Equal reports whether two consistent hash rings would route actors to the
122// same set of hosts. Only the inputs to ring construction (loadMap entries

Callers 15

TestGetHostAdressFunction · 0.45
TestAddrPriorityFunction · 0.45
TestIsCGNATFunction · 0.45
TestSetEnvVariablesFunction · 0.45
TestEnvOrElseFunction · 0.45
TestFilterFunction · 0.45
TestParseServiceAddrFunction · 0.45
TestGetClusterDomainFunction · 0.45

Calls

no outgoing calls

Tested by 15

TestGetHostAdressFunction · 0.36
TestAddrPriorityFunction · 0.36
TestIsCGNATFunction · 0.36
TestSetEnvVariablesFunction · 0.36
TestEnvOrElseFunction · 0.36
TestFilterFunction · 0.36
TestParseServiceAddrFunction · 0.36
TestGetClusterDomainFunction · 0.36