-
Notifications
You must be signed in to change notification settings - Fork 4
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
Adding a simple persistence provider #11
base: main
Are you sure you want to change the base?
Adding a simple persistence provider #11
Conversation
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
76b6df3
to
cb17d89
Compare
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.
First comments, need to take a deeper look on code level again
kuksa-persistence-provider/Readme.md
Outdated
@@ -0,0 +1,71 @@ | |||
# KUKSA Persistence Provider | |||
|
|||
All data in KUKSA is ephemereal. However, in a car there is often data that does not change over the lifetime of a vehicle, and data where you want changes to be persisted over ignition cycles. |
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.
All data in KUKSA is ephemereal. However, in a car there is often data that does not change over the lifetime of a vehicle, and data where you want changes to be persisted over ignition cycles. | |
All data in KUKSA is ephemeral. However, in a car there is often data that does not change over the lifetime of a vehicle, and data where you want changes to be persisted over ignition cycles. |
|
||
All data in KUKSA is ephemereal. However, in a car there is often data that does not change over the lifetime of a vehicle, and data where you want changes to be persisted over ignition cycles. | ||
|
||
This provider can achieve this. It can restore certain values upon startup, either sensor (current) values, or actuations. |
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.
Have you put soe thought into how this would work for actuations with the new concept that will be introduced in the kuksa.val.v2?
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.
Not that good I think - Isn't the thoughts in kuksa.val.v2 that there should only be a single instance interested in the target/actuation-value? I.e. there cannot be multiple entities interested in the same actuation value?
|
||
This provider can achieve this. It can restore certain values upon startup, either sensor (current) values, or actuations. | ||
|
||
An example for one-time restoration of current values are attributes that are maybe not set in a default VSS model deployed to ALL cars of a specific variant, but nevertheless are constant of a specific car, such as the VIN or the Vehicle Color. |
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.
An example for one-time restoration of current values are attributes that are maybe not set in a default VSS model deployed to ALL cars of a specific variant, but nevertheless are constant of a specific car, such as the VIN or the Vehicle Color. | |
An example for one-time restoration of current values are attributes that are maybe not set in a default VSS model deployed to ALL cars of a specific variant, but nevertheless are constant of a specific car, such as the VIN or the Vehicle.Color. |
either use Vehicle.Color or vehicle color
kuksa-persistence-provider/Readme.md
Outdated
|
||
An example for one-time restoration of current values are attributes that are maybe not set in a default VSS model deployed to ALL cars of a specific variant, but nevertheless are constant of a specific car, such as the VIN or the Vehicle Color. | ||
|
||
This provider can also watch (subscribe) certain current or actuation values. This is useful when interacting with components that do not provide their own persistence management. Assume a climate control UI that can react on unser input and interact with the HVAC system, but is otherwise stateless. By watching and restoring the desired target temperature, the user's preference is saved and restored, without the HVAC UI needing any specific code to handle this. |
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.
This provider can also watch (subscribe) certain current or actuation values. This is useful when interacting with components that do not provide their own persistence management. Assume a climate control UI that can react on unser input and interact with the HVAC system, but is otherwise stateless. By watching and restoring the desired target temperature, the user's preference is saved and restored, without the HVAC UI needing any specific code to handle this. | |
This provider can also monitor (subscribe) certain current or actuation values. This is useful when interacting with components that do not provide their own persistence management. Assume a climate control UI that can react on unser input and interact with the HVAC system, but is otherwise stateless. By watching and restoring the desired target temperature, the user's preference is saved and restored, without the HVAC UI needing any specific code to handle this. |
] | ||
}, | ||
|
||
"restore-and-watch": { |
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.
okay if this here is called watch ignore my command above
}; | ||
|
||
if datapoint_entries.is_none() { | ||
return; |
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.
log 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.
Is this only for error situations, i.e. we have already got one of the log messages above? Replace None
with return None
above?
* SPDX-License-Identifier: Apache-2.0 | ||
********************************************************************************/ | ||
|
||
pub mod filestorage; |
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.
why split storage and filestorage into two files? Just move this to filestorage imo
…le-djson Feature/persistence intergrate djson
@lukasmittag - I was in contact with Sebastian and merged a PR from Matthias, so your previous comments are out of sync. Do you want to "reapply" them or should I integrate them? I anyway need to squash the commits as Matthias do not have signed the ECA. |
I created a replacement PR at #13 where the commits have been squashed. It seems most comments have been addressed. I have not tested the PR, but this is incubation but we should preferably say something in main README |
This is a simple persistence provider.
It allows to persist and restore chosen VSS path between databroker restarts.