-
Notifications
You must be signed in to change notification settings - Fork 11
refactor: use bytesize and parse-display #116
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
Conversation
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
| .unwrap() | ||
| FoyerEngine::try_new( | ||
| dir.path(), | ||
| ByteSize::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.
Default to zero.
| env_name: "PERCAS_CONFIG_STORAGE_DISK_CAPACITY", | ||
| ent_path: "storage.disk_capacity", | ||
| ent_type: "integer", | ||
| ent_type: "string", |
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.
ByteSize can accept "1234" as bytes. So this change is not breaking.
| } | ||
|
|
||
| let mut db = FsDeviceBuilder::new(data_dir).with_capacity(disk_capacity as usize); | ||
| let mut db = FsDeviceBuilder::new(data_dir).with_capacity(disk_capacity.0 as 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.
@MrCroxx Entrypoint that foyer can use bytesize.
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.
But foyer may not want to add an external dep in the public API. Let me think of the boundary ...
| BlockEngineBuilder::new(dev) | ||
| .with_recover_concurrency(parallelism) | ||
| .with_block_size(DEFAULT_BLOCK_SIZE) | ||
| .with_block_size(DEFAULT_BLOCK_SIZE.0 as 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.
@MrCroxx Entrypoint that foyer can use bytesize.
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
f8dcc36 to
111b32a
Compare
No description provided.