-
Notifications
You must be signed in to change notification settings - Fork 21
Support basic types #46
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
Support basic types #46
Conversation
1afa640 to
4149339
Compare
License Check Results🚀 The license check job ran with the Bazel command: bazel run //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
- Add basic types to kvsvalue - Add type info into the json format
- Added tests for all the basic types
4149339 to
54e67a6
Compare
- Rebase to main and take json-backend changes
54e67a6 to
2bdefbc
Compare
- add eclipse license header
|
@vinodreddy-g Do you want to reduce the storage-space in the written json-files like mentioned in the FT? Something like this maybe: When you first see this you probably need to open a documentation to understand the t and v, but i think they are mostly self explaining. Also additional info from @vbogdanb : Please use lowercase letters for the types (I32 -> i32) |
| @@ -1,46 +1,197 @@ | |||
| // Copyright (c) 2025 Contributors to the Eclipse Foundation | |||
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.
Unrelated to this change: maybe missing license headers can be prevented with pre-commit hook, or at least CI task?
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.
Ci task has to merged from central repo .I will ask dan.
| } | ||
| } | ||
| "Null" => { | ||
| if let JsonValue::Null = value { |
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.
You can just return KvsValue::Null. But this raises a question - how can null be distinguished from erroneous condition?
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.
Will fix the error handling and few things are missing as new PR.
- Chnaged the "type" to "t" and "value" to "v" - And used smaller case for type info in json
- Fixed the review comments on kvs_value
- Fixed the parsing in backend - Fixed the tests
bfd259b to
072f9c9
Compare
src/rust/rust_kvs/tests/common.rs
Outdated
| (_, _) => false, | ||
| _ => false, | ||
| } | ||
| // ...existing code... |
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.
What is the meaning of this comment?
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.
removed it.
| .map(|(k, v)| (k.clone(), KvsValue::from(v))) | ||
| .collect(), | ||
| ), | ||
| JsonValue::Number(_) |
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.
Remaining types can be handled with _ => KvsValue::Null.
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
| JsonValue::Boolean(b) => KvsValue::Boolean(b), | ||
| JsonValue::String(s) => KvsValue::String(s), | ||
| JsonValue::Null => KvsValue::Null, | ||
| JsonValue::Object(mut obj) => { |
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.
No mut would be preferred, but it's ok.
- Taking ownership of JsonValue and KvsValue in backend file.
e26aba4 to
d08963c
Compare
- changed the kvsvalue structure - changed the json_backend default matching arm
- Used index.get as before
- error message checks in kvs_value.rs
b4bd6e7 to
bd0d88d
Compare
|
@arkjedrz fixed the comments |
No description provided.