MCPcopy Create free account
hub / github.com/Permify/permify / GetPartitionOwner

Method GetPartitionOwner

pkg/consistent/consistent.go:377–384  ·  view source on GitHub ↗

GetPartitionOwner retrieves the owner of the specified partition in a thread-safe manner. It ensures that the access to shared resources is synchronized.

(partitionID int)

Source from the content-addressed store, hash-verified

375// GetPartitionOwner retrieves the owner of the specified partition in a thread-safe manner.
376// It ensures that the access to shared resources is synchronized.
377func (c *Consistent) GetPartitionOwner(partitionID int) Member {
378 // Acquire a read lock to ensure thread-safe access to the partitions map.
379 c.mu.RLock()
380 defer c.mu.RUnlock()
381
382 // Delegate the actual lookup to the non-thread-safe internal helper function.
383 return c.getPartitionOwnerInternal(partitionID)
384}
385
386// getPartitionOwnerInternal retrieves the owner of the specified partition without thread safety.
387// This function assumes that synchronization has been handled by the caller.

Callers 1

LocateKeyMethod · 0.95

Calls 1

Tested by

no test coverage detected