Struct solana_core::crds_gossip_pull::CrdsGossipPull [−][src]
Fields
pull_request_time: HashMap<Pubkey, u64>
timestamp of last request
purged_values: VecDeque<(Hash, u64)>
hash and insert time
failed_inserts: VecDeque<(Hash, u64)>
crds_timeout: u64
msg_timeout: u64
num_pulls: usize
Implementations
impl CrdsGossipPull
[src]
pub fn new_pull_request(
&self,
thread_pool: &ThreadPool,
crds: &Crds,
self_id: &Pubkey,
self_shred_version: u16,
now: u64,
gossip_validators: Option<&HashSet<Pubkey>>,
stakes: &HashMap<Pubkey, u64>,
bloom_size: usize
) -> Result<(Pubkey, Vec<CrdsFilter>, CrdsValue), CrdsGossipError>
[src]
&self,
thread_pool: &ThreadPool,
crds: &Crds,
self_id: &Pubkey,
self_shred_version: u16,
now: u64,
gossip_validators: Option<&HashSet<Pubkey>>,
stakes: &HashMap<Pubkey, u64>,
bloom_size: usize
) -> Result<(Pubkey, Vec<CrdsFilter>, CrdsValue), CrdsGossipError>
generate a random request
pub fn mark_pull_request_creation_time(&mut self, from: &Pubkey, now: u64)
[src]
time when a request to from
was initiated
This is used for weighted random selection during new_pull_request
It’s important to use the local nodes request creation time as the weight
instead of the response received time otherwise failed nodes will increase their weight.
pub fn record_old_hash(&mut self, hash: Hash, timestamp: u64)
[src]
Store an old hash in the purged values set
pub fn process_pull_requests<I>(
&mut self,
crds: &mut Crds,
callers: I,
now: u64
) where
I: IntoIterator<Item = CrdsValue>,
[src]
&mut self,
crds: &mut Crds,
callers: I,
now: u64
) where
I: IntoIterator<Item = CrdsValue>,
process a pull request
pub fn generate_pull_responses(
&self,
crds: &Crds,
requests: &[(CrdsValue, CrdsFilter)],
output_size_limit: usize,
now: u64
) -> Vec<Vec<CrdsValue>>
[src]
&self,
crds: &Crds,
requests: &[(CrdsValue, CrdsFilter)],
output_size_limit: usize,
now: u64
) -> Vec<Vec<CrdsValue>>
Create gossip responses to pull requests
pub fn filter_pull_responses(
&self,
crds: &Crds,
timeouts: &HashMap<Pubkey, u64>,
responses: Vec<CrdsValue>,
now: u64,
stats: &mut ProcessPullStats
) -> (Vec<VersionedCrdsValue>, Vec<VersionedCrdsValue>, Vec<Hash>)
[src]
&self,
crds: &Crds,
timeouts: &HashMap<Pubkey, u64>,
responses: Vec<CrdsValue>,
now: u64,
stats: &mut ProcessPullStats
) -> (Vec<VersionedCrdsValue>, Vec<VersionedCrdsValue>, Vec<Hash>)
pub fn process_pull_responses(
&mut self,
crds: &mut Crds,
from: &Pubkey,
responses: Vec<VersionedCrdsValue>,
responses_expired_timeout: Vec<VersionedCrdsValue>,
failed_inserts: Vec<Hash>,
now: u64,
stats: &mut ProcessPullStats
) -> Vec<(CrdsValueLabel, Hash, u64)>
[src]
&mut self,
crds: &mut Crds,
from: &Pubkey,
responses: Vec<VersionedCrdsValue>,
responses_expired_timeout: Vec<VersionedCrdsValue>,
failed_inserts: Vec<Hash>,
now: u64,
stats: &mut ProcessPullStats
) -> Vec<(CrdsValueLabel, Hash, u64)>
process a vec of pull responses
pub fn purge_failed_inserts(&mut self, now: u64)
[src]
pub fn build_crds_filters(
&self,
thread_pool: &ThreadPool,
crds: &Crds,
bloom_size: usize
) -> Vec<CrdsFilter>
[src]
&self,
thread_pool: &ThreadPool,
crds: &Crds,
bloom_size: usize
) -> Vec<CrdsFilter>
pub fn make_timeouts_def(
&self,
self_id: &Pubkey,
stakes: &HashMap<Pubkey, u64>,
epoch_ms: u64,
min_ts: u64
) -> HashMap<Pubkey, u64>
[src]
&self,
self_id: &Pubkey,
stakes: &HashMap<Pubkey, u64>,
epoch_ms: u64,
min_ts: u64
) -> HashMap<Pubkey, u64>
pub fn make_timeouts(
&self,
self_id: &Pubkey,
stakes: &HashMap<Pubkey, u64>,
epoch_ms: u64
) -> HashMap<Pubkey, u64>
[src]
&self,
self_id: &Pubkey,
stakes: &HashMap<Pubkey, u64>,
epoch_ms: u64
) -> HashMap<Pubkey, u64>
pub fn purge_active(
&mut self,
thread_pool: &ThreadPool,
crds: &mut Crds,
now: u64,
timeouts: &HashMap<Pubkey, u64>
) -> usize
[src]
&mut self,
thread_pool: &ThreadPool,
crds: &mut Crds,
now: u64,
timeouts: &HashMap<Pubkey, u64>
) -> usize
Purge values from the crds that are older then active_timeout
The value_hash of an active item is put into self.purged_values queue
pub fn purge_purged(&mut self, min_ts: u64)
[src]
Purge values from the self.purged_values
queue that are older then purge_timeout
Trait Implementations
impl Clone for CrdsGossipPull
[src]
fn clone(&self) -> CrdsGossipPull
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for CrdsGossipPull
[src]
Auto Trait Implementations
impl RefUnwindSafe for CrdsGossipPull
impl Send for CrdsGossipPull
impl Sync for CrdsGossipPull
impl Unpin for CrdsGossipPull
impl UnwindSafe for CrdsGossipPull
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoRequest<T> for T
[src]
pub fn into_request(self) -> Request<T>
[src]
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,