Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
delete unnecessary data_store
Browse files Browse the repository at this point in the history
  • Loading branch information
lanlou1554 committed Mar 31, 2024
1 parent 6d4111f commit aed7fb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 75 deletions.
75 changes: 0 additions & 75 deletions storage-node/src/cache/data_store/disk.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ impl<R: DataStoreReplacer + Send + Sync> DataStoreCache for MemDiskStoreCache<R>
remote_location: String,
mut data_stream: StorageReaderStream,
) -> ParpulseResult<usize> {
// TODO: Refine the lock.
// TODO(lanlou): Also write the data to network.
let mut bytes_to_disk = None;
let mut evicted_bytes_to_disk: Option<
Vec<(ParpulseDataStoreCacheKey, (Vec<Bytes>, usize))>,
Expand All @@ -110,6 +112,7 @@ impl<R: DataStoreReplacer + Send + Sync> DataStoreCache for MemDiskStoreCache<R>
match data_stream.next().await {
Some(Ok(bytes)) => {
bytes_written += bytes.len();
// Need to write the data to network.
if let Some((bytes_vec, _)) =
mem_store.write_data(mem_store_key.clone(), bytes)
{
Expand Down Expand Up @@ -146,6 +149,7 @@ impl<R: DataStoreReplacer + Send + Sync> DataStoreCache for MemDiskStoreCache<R>
}
}

// Don't need to write the data to network for evicted keys.
if let Some(evicted_bytes_to_disk) = evicted_bytes_to_disk {
for (key, (bytes_vec, data_size)) in evicted_bytes_to_disk {
let disk_store_key = self.disk_store.data_store_key(&key);
Expand All @@ -162,6 +166,7 @@ impl<R: DataStoreReplacer + Send + Sync> DataStoreCache for MemDiskStoreCache<R>
}
}

// Need to write the data to network for the current key.
let disk_store_key = self.disk_store.data_store_key(&remote_location);
// TODO: Write the data store cache first w/ `incompleted` state and update the state
// after finishing writing into the data store.
Expand Down

0 comments on commit aed7fb8

Please sign in to comment.