Repository navigation
Sonic redis database accessors - #184
Conversation
02dab74 to
efb3a9b
Compare
Add typed accessor interfaces (PortAccessor, InterfaceAccessor, VLANAccessor, DeviceAccessor) with Redis-backed implementations for reading and writing SONiC CONFIG_DB and STATE_DB entries. Moving these to a public package makes them reusable outside the internal agent. Signed-off-by: Daniel Beres <daniel.beres@sap.com>
efb3a9b to
855910c
Compare
Signed-off-by: Daniel Beres <daniel.beres@sap.com>
…erStatus Signed-off-by: Daniel Beres <daniel.beres@sap.com>
7dab0d1 to
61d7c44
Compare
byteocean
left a comment
There was a problem hiding this comment.
LGTM, Thanks. But I have one extra point which could be further thought about. I am wondering, would it be better to put all these prefixes for keys as constant strings somewhere in a file, and use only variable names when an entry is set. E.g., const portPrefex string = 'PORT|', etc. because by doing so, one can have an overview of involved Redis entries and easy to find once one of them got changed in a different version?
Overall, I agree with @byteocean 's suggestion. |
Proposed Changes
What
Add typed SONiC DB accessor interfaces to the public
pkg/sonicpackage:PortAccessorInterfaceAccessorVLANAccessorDeviceAccessorThe package provides Redis-backed implementations for reading and writing
SONiC
CONFIG_DBandSTATE_DBentries.Fixes #
Moving them to a public package makes the SONiC DB access layer reusable by
other components without depending on internal agent packages.