pub struct ShardMetadata {
pub key: ShardKey,
pub owner_node: String,
pub size_bytes: u64,
pub state: ShardState,
pub updated_at_ms: u64,
}Expand description
Metadata about a single shard.
Fields§
§key: ShardKeyThe shard’s key.
owner_node: StringPhysical node currently responsible for this shard.
size_bytes: u64Approximate size in bytes.
state: ShardStateCurrent lifecycle state.
updated_at_ms: u64Unix epoch ms when this metadata was last updated.
Implementations§
Source§impl ShardMetadata
impl ShardMetadata
Sourcepub fn new(
key: ShardKey,
owner_node: impl Into<String>,
size_bytes: u64,
now_ms: u64,
) -> Self
pub fn new( key: ShardKey, owner_node: impl Into<String>, size_bytes: u64, now_ms: u64, ) -> Self
Create a new active shard metadata record.
Sourcepub fn begin_migration(&mut self, target_node: impl Into<String>, now_ms: u64)
pub fn begin_migration(&mut self, target_node: impl Into<String>, now_ms: u64)
Mark the shard as migrating to target_node.
Sourcepub fn complete_migration(&mut self, now_ms: u64)
pub fn complete_migration(&mut self, now_ms: u64)
Complete the migration (shard is now active on the new node).
Trait Implementations§
Source§impl Clone for ShardMetadata
impl Clone for ShardMetadata
Source§fn clone(&self) -> ShardMetadata
fn clone(&self) -> ShardMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ShardMetadata
impl RefUnwindSafe for ShardMetadata
impl Send for ShardMetadata
impl Sync for ShardMetadata
impl Unpin for ShardMetadata
impl UnsafeUnpin for ShardMetadata
impl UnwindSafe for ShardMetadata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request