-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Indexer-Grpc-V2] Add FileStoreOperatorV2. #15779
Conversation
⏱️ 2h 34m total CI duration on this PR
|
3ddf5e5
to
a9bb3d0
Compare
a9bb3d0
to
402b6bf
Compare
ecosystem/indexer-grpc/indexer-grpc-utils/src/file_store_operator_v2/file_store_operator.rs
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
402b6bf
to
3c69c17
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
overall looks good; some nits.
#[derive(Serialize, Deserialize, Default, Clone)] | ||
pub struct BatchMetadata { | ||
// "[first_version, last_version), size_bytes" | ||
pub files: Vec<(u64, u64, usize)>, |
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.
let's name these fields; readers are required to read this comment to understand these numbers.
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.
Done
.unwrap() | ||
.next_entry() | ||
.await | ||
.unwrap() |
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.
for the first unwrap, can we change to expect
and include path information in the message?
for the second unwrap, can we include something like IO error happens for path
?
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.
hmm, why not check the existence of the metadata file directly? or what does is_initialized mean?
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.
It checks if the folder is empty..
Trying to capture the case when the folder is not empty, but metadata is disappeared for any reason (which likely indicates data corruption). In that case I'd like to treat it as an error rather than re-initialize it.
"Verifying the path exists for LocalFileStore." | ||
); | ||
if !path.exists() { | ||
panic!("LocalFileStore path does not exist."); |
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.
nit: include the path in the error message.
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.
The path is printed out right above.
..Default::default() | ||
}; | ||
|
||
let response = Object::list(&self.bucket_name, request) |
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.
ditto
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.
Done
/// The tag of the store, for logging. | ||
fn tag(&self) -> &str; | ||
|
||
async fn is_initialized(&self) -> bool; |
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.
need comments: what does true
and false
stand for?
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.
Done
end_file_index = end_file_index.min(file_index.saturating_add(max_files)); | ||
} | ||
|
||
for i in file_index..end_file_index { |
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.
as a follow-up, let's add unit tests for this logic.
3c69c17
to
42f5a77
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
Description
How Has This Been Tested?
Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?
Checklist