View Source Kvasir.Offset (kvasir v0.0.18)
Link to this section Summary
Functions
Examples
iex> a = create(%{0 => 24, 1 => 37})
iex> b = create(%{0 => 24, 1 => 37})
iex> compare(a, b)
:eq
iex> a = create(%{0 => 12, 1 => 23})
iex> b = create(%{0 => 24, 1 => 37})
iex> compare(a, b)
:lt
iex> a = create(%{0 => 24, 1 => 37})
iex> b = create(%{0 => 12, 1 => 23})
iex> compare(a, b)
:gt
Using :earliest
Check whether an offset is empty.
Compare two partition offset values and return the lowest. (earliest)
Link to this section Types
@type partition_offset() :: :earliest | :latest | pos_integer()
@type t() :: %Kvasir.Offset{partitions: term()}
Link to this section Functions
examples
Examples
iex> a = create(%{0 => 24, 1 => 37})
iex> b = create(%{0 => 24, 1 => 37})
iex> compare(a, b)
:eq
iex> a = create(%{0 => 12, 1 => 23})
iex> b = create(%{0 => 24, 1 => 37})
iex> compare(a, b)
:lt
iex> a = create(%{0 => 24, 1 => 37})
iex> b = create(%{0 => 12, 1 => 23})
iex> compare(a, b)
:gt
Using :earliest
:
iex> a = create(%{0 => :earliest})
iex> b = create(%{0 => 0})
iex> compare(a, b)
:lt
iex> a = create(%{0 => :earliest})
iex> b = create(%{0 => :earliest})
iex> compare(a, b)
:eq
Check whether an offset is empty.
@spec min(partition_offset(), partition_offset()) :: partition_offset()
Compare two partition offset values and return the lowest. (earliest)