Skip to content
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

Feat: Metadata storage #30

Merged
merged 5 commits into from
Nov 23, 2022
Merged

Feat: Metadata storage #30

merged 5 commits into from
Nov 23, 2022

Conversation

hhio618
Copy link
Collaborator

@hhio618 hhio618 commented Nov 2, 2022

src/meta.rs Outdated
let mut metadata_file = File::create(
metadata_path
.to_owned()
.join(format!("{}", resource_id.crc32)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whole resource_id must be used in the filename here.
E.g. 123-45678 where 123 is size of the data, and 45678 is CRC-32 checksum.

src/meta.rs Outdated
name,
extension,
kind,
extra,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we only need to store extra part. We can put created_data into extra structure. It's not needed to store id (because it is stored in the filename), name and extension (because it's derived from path which is stored in index). I'm not sure about kind, if we can avoid storing it, that would be good. We should store only strictly necessary data.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe we should keep the id field as it's needed to pass the index tests!

src/meta.rs Outdated Show resolved Hide resolved
@kirillt
Copy link
Member

kirillt commented Nov 23, 2022

Refactored metadata loading and purified ResourceMeta structure. It will be changed further after we merge #29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants