Value object representing a virtual node in the hash ring.
A virtual node has a hash value, sequence number, and references a physical node.
Summary
Functions
Compares two virtual nodes by hash, then sequence.
Gets the virtual node hash.
Gets the physical node.
Gets the node key from the physical node.
Gets the virtual node sequence.
Checks if virtual node a is greater than b.
Checks if virtual node a is less than b.
Creates a new virtual node.
Types
@type t() :: %ExRingRing.Domain.ValueObjects.VirtualNode{ hash: non_neg_integer(), node: ExRingRing.Domain.Entities.Node.t(), sequence: non_neg_integer() }
Functions
Compares two virtual nodes by hash, then sequence.
@spec get_hash(t()) :: non_neg_integer()
Gets the virtual node hash.
@spec get_node(t()) :: ExRingRing.Domain.Entities.Node.t()
Gets the physical node.
Gets the node key from the physical node.
@spec get_sequence(t()) :: non_neg_integer()
Gets the virtual node sequence.
Checks if virtual node a is greater than b.
Checks if virtual node a is less than b.
@spec new(non_neg_integer(), non_neg_integer(), ExRingRing.Domain.Entities.Node.t()) :: t()
Creates a new virtual node.