-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented get_blob on sampling rocksdb adapter #732
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks
let blob_bytes = load_blob( | ||
self.settings.blob_storage_directory.clone(), | ||
blob_id.as_ref(), | ||
&column_idx.to_be_bytes(), | ||
) | ||
.await | ||
.unwrap(); | ||
Ok(S::deserialize(blob_bytes) | ||
.map(|blob| Some(blob)) | ||
.unwrap_or_default()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion for grouping deserialization with the loading. The load_blob().unwrap()
can be changed to ?
.
let blob_bytes = load_blob( | |
self.settings.blob_storage_directory.clone(), | |
blob_id.as_ref(), | |
&column_idx.to_be_bytes(), | |
) | |
.await | |
.unwrap(); | |
Ok(S::deserialize(blob_bytes) | |
.map(|blob| Some(blob)) | |
.unwrap_or_default()) | |
let blob = S::deserialize( | |
load_blob( | |
self.settings.blob_storage_directory.clone(), | |
blob_id.as_ref(), | |
&column_idx.to_be_bytes(), | |
) | |
.await?, | |
) | |
.map(|b| Some(b)) | |
.unwrap_or_default(); | |
Ok(blob) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually your variant is better, only lets change the unwrap and it's good to go!
This PR adds a get_blob implementation on the rocksdb Adapter for the sampling service.