Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
albertlockett committed Jul 4, 2024
1 parent fa2fe37 commit 13de1b2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rust/lance/src/index/vector/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,22 @@ pub async fn maybe_sample_training_data(
}

#[derive(Debug)]
pub (crate) struct PartitionLoadLock {
pub struct PartitionLoadLock {
partition_locks: Vec<Arc<Mutex<()>>>,
}

impl PartitionLoadLock {
pub fn new(num_partitions: usize) -> Self {
Self {
partition_locks: (0..num_partitions).map(|_| Arc::new(Mutex::new(()))).collect(),
partition_locks: (0..num_partitions)
.map(|_| Arc::new(Mutex::new(())))
.collect(),
}
}

pub fn get_partition_mutex(&self, partition_id: usize) -> Arc<Mutex<()>> {
let mtx = &self.partition_locks[partition_id];

mtx.clone()
}
}

0 comments on commit 13de1b2

Please sign in to comment.