Module kitsune_p2p_dht::arq
source · Expand description
The Quantized DHT Arc type
Arq coordinates are expressed in terms of powers-of-two, representing
the “chunk” or “segment” size to work with. The actual extent of the Arq
is expressed as a start
and an offset
, in terms of the chunk size.
So, Arq boundaries can only ever fall on a quantized grid which is determined
by the power
setting.
Modules
Methods to help with ascii representations of Arqs
Structs
A quantized DHT arc.
A collection of ArqBounds.
All bounds are guaranteed to be quantized to the same power
(the lowest common power).
“Arq Resizing Strategy”. Defines all parameters necessary to run the arq
resizing algorithm.
The Quantized PeerView
Statistics about the power levels of all arqs in a view.
Used to make inferences about what your neighbors are up to.
A summary of what happened while updating an Arq
Enums
A Strategy for generating PeerViews.
The enum allows us to add new strategies over time.
A “view” of the peers in a neighborhood. The view consists of a few
observations about the distribution of peers within a particular arc, used
to make inferences about the rest of the (out-of-view) DHT, ultimately
enabling the calculation of the target arc size for the agent who has this View.
Traits
Represents the start point or “left edge” of an Arq.
Functions
The actual coverage provided by these peers. Assumes that this is the
entire view of the DHT, all peers are accounted for here.
Given a center and a length, give Arq which matches most closely given the provided strategy
Calculate whether a given combination of power and count corresponds to
full DHT coverage.
Convenience method for taking the power of 2 in u32
Convenience method for taking the power of 2 in f64
Calculate the unique pairing of power and count implied by a given length
and max number of chunks
Print ascii for arq bounds
Print a collection of arqs