mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-01 01:38:18 +00:00
perf(get): reuse reader paths and lock namespaces (#6015)
Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -28,12 +28,17 @@ pub struct LocalLock {
|
||||
/// Global lock manager for fast local locks
|
||||
manager: Arc<GlobalLockManager>,
|
||||
/// Namespace identifier
|
||||
namespace: String,
|
||||
namespace: Arc<str>,
|
||||
}
|
||||
|
||||
impl LocalLock {
|
||||
/// Create new local lock
|
||||
pub fn new(namespace: String, manager: Arc<GlobalLockManager>) -> Self {
|
||||
Self::new_shared(namespace.into(), manager)
|
||||
}
|
||||
|
||||
/// Create a local lock that shares an existing namespace allocation.
|
||||
pub(crate) fn new_shared(namespace: Arc<str>, manager: Arc<GlobalLockManager>) -> Self {
|
||||
Self { namespace, manager }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user