pub struct DistributedLockManager {
pub node_id: u32,
pub coordinator_id: u32,
/* private fields */
}Fields§
§node_id: u32현재 노드의 고유 ID
coordinator_id: u32락 인가를 총괄할 마스터(또는 특정 파티션의 리더) 노드 ID
Implementations§
Source§impl DistributedLockManager
impl DistributedLockManager
pub fn new( node_id: u32, coordinator_id: u32, lock_in_rx: Receiver<LockMessage>, lock_out_tx: Sender<LockMessage>, ) -> Arc<Self>
Sourcepub async fn acquire(
&self,
table: &str,
key: &[u8],
lease_ms: u64,
timeout: Duration,
) -> Result<u64, DlmError>
pub async fn acquire( &self, table: &str, key: &[u8], lease_ms: u64, timeout: Duration, ) -> Result<u64, DlmError>
[클라이언트 파트] 락을 비동기로 요청하고 획득할 때까지 대기합니다.
Sourcepub async fn release(&self, table: &str, key: &[u8], fencing_token: u64)
pub async fn release(&self, table: &str, key: &[u8], fencing_token: u64)
[클라이언트 파트] 획득한 락을 자발적으로 반환합니다.
Sourcepub async fn run_receiver_loop(self: Arc<Self>)
pub async fn run_receiver_loop(self: Arc<Self>)
[백그라운드 루프] Inbound로 들어오는 LockMessage 지속 처리
Auto Trait Implementations§
impl !Freeze for DistributedLockManager
impl !RefUnwindSafe for DistributedLockManager
impl Send for DistributedLockManager
impl Sync for DistributedLockManager
impl Unpin for DistributedLockManager
impl UnsafeUnpin for DistributedLockManager
impl !UnwindSafe for DistributedLockManager
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more