Struct kitsune_p2p_dht::region::RegionData
source · pub struct RegionData {
pub hash: RegionHash,
pub size: u32,
pub count: u32,
}
Expand description
The pertinent data that we care about for each Region. This is what gets sent over gossip so that nodes can discover which Regions are different between them.
The size and count data can also act as heuristics to help us fine-tune the gossip algorithm, although currently they are unused (except for the purpose of disambiguation in the rare case of an XOR hash collision).
Fields§
§hash: RegionHash
The XOR of hashes of all Ops in this Region
size: u32
The total size of Op data contained in this Region
count: u32
The number of Ops in this Region.
Trait Implementations§
source§impl AccessOpStore<OpData, RegionData> for TestNode
impl AccessOpStore<OpData, RegionData> for TestNode
source§fn query_op_data(&self, region: &RegionCoords) -> Vec<Op> ⓘ
fn query_op_data(&self, region: &RegionCoords) -> Vec<Op> ⓘ
Query the actual ops inside a region
source§fn query_region_data(&self, region: &RegionCoords) -> RegionData
fn query_region_data(&self, region: &RegionCoords) -> RegionData
Query the RegionData of a region, including the hash of all ops, size, and count
source§fn fetch_region_set(
&self,
coords: RegionCoordSetLtcs
) -> MustBoxFuture<'_, Result<RegionSetLtcs, ()>>
fn fetch_region_set(
&self,
coords: RegionCoordSetLtcs
) -> MustBoxFuture<'_, Result<RegionSetLtcs, ()>>
Fetch a set of Regions (the coords and the data) given the set of coords
source§fn integrate_ops<Ops: Clone + Iterator<Item = Op>>(&mut self, ops: Ops)
fn integrate_ops<Ops: Clone + Iterator<Item = Op>>(&mut self, ops: Ops)
Integrate incoming ops, updating the necessary stores
source§fn gossip_params(&self) -> GossipParams
fn gossip_params(&self) -> GossipParams
Get the GossipParams associated with this store
source§fn integrate_op(&mut self, op: Arc<O>)
fn integrate_op(&mut self, op: Arc<O>)
Integrate a single op
source§fn region_set(&self, arq_set: ArqBoundsSet, now: TimeQuantum) -> RegionSet<D>
fn region_set(&self, arq_set: ArqBoundsSet, now: TimeQuantum) -> RegionSet<D>
Get the RegionSet for this node, suitable for gossiping
source§impl Add<RegionData> for RegionData
impl Add<RegionData> for RegionData
source§impl AddAssign<RegionData> for RegionData
impl AddAssign<RegionData> for RegionData
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moresource§impl Clone for RegionData
impl Clone for RegionData
source§fn clone(&self) -> RegionData
fn clone(&self) -> RegionData
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RegionData
impl Debug for RegionData
source§impl<'de> Deserialize<'de> for RegionData
impl<'de> Deserialize<'de> for RegionData
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<RegionData> for RegionDataCompact
impl From<RegionData> for RegionDataCompact
source§fn from(d: RegionData) -> Self
fn from(d: RegionData) -> Self
Converts to this type from the input type.
source§impl From<RegionDataCompact> for RegionData
impl From<RegionDataCompact> for RegionData
source§fn from(RegionDataCompact: RegionDataCompact) -> Self
fn from(RegionDataCompact: RegionDataCompact) -> Self
Converts to this type from the input type.
source§impl OpRegion<RegionData> for OpData
impl OpRegion<RegionData> for OpData
source§fn region_data(&self) -> RegionData
fn region_data(&self) -> RegionData
The RegionData that would be produced if this op were the only op
in the region. The sum of these produces the RegionData for the whole
region.
source§fn bound(timestamp: Timestamp, loc: Loc) -> Self
fn bound(timestamp: Timestamp, loc: Loc) -> Self
Create an Op with arbitrary data but that has the given timestamp and location.
Used for bounded range queries based on the PartialOrd impl of the op.
source§fn coords(&self, topo: &Topology) -> SpacetimeQuantumCoords
fn coords(&self, topo: &Topology) -> SpacetimeQuantumCoords
The quantized space and time coordinates, based on the location and timestamp.
source§impl PartialEq<RegionData> for RegionData
impl PartialEq<RegionData> for RegionData
source§fn eq(&self, other: &RegionData) -> bool
fn eq(&self, other: &RegionData) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl RegionDataConstraints for RegionData
impl RegionDataConstraints for RegionData
source§impl Serialize for RegionData
impl Serialize for RegionData
source§impl Sub<RegionData> for RegionData
impl Sub<RegionData> for RegionData
source§impl SubAssign<RegionData> for RegionData
impl SubAssign<RegionData> for RegionData
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moresource§impl Sum<RegionData> for RegionData
impl Sum<RegionData> for RegionData
source§impl Zero for RegionData
impl Zero for RegionData
impl Eq for RegionData
impl StructuralEq for RegionData
impl StructuralPartialEq for RegionData
Auto Trait Implementations§
impl RefUnwindSafe for RegionData
impl Send for RegionData
impl Sync for RegionData
impl Unpin for RegionData
impl UnwindSafe for RegionData
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.