Convert com.twitter.finagle.Addr.Metadata to an instance of ZkMetadata.
Convert com.twitter.finagle.Addr.Metadata to an instance of
ZkMetadata. If ZkMetadata is not present in metadata
,
return None.
Orders a Finagle Address based on a deterministic hash of its shard id.
Orders a Finagle Address based on a deterministic hash of its shard id.
If shard id information is identical, either both lack metadata, both lack a shard id, or both have the same shard id, ordering is then computed by Address.hashOrdering.
We do not consider ZkMetadata.metadata while comparing the Address and only ZkMetadata.shardId portion of the ZkMetadata is considered.
,Avoiding collisions in this hash ordering where inputs are equal is an important property in keeping it deterministic. Thus, it uses a murmurhash under the hood which is known to not have collisions for 32-bit inputs. However, if the input collection does not have shard ids available, we fall back to Address.hashOrdering which may have some caveats to this.
Convert ZkMetadata to an instance of com.twitter.finagle.Addr.Metadata.