-
Notifications
You must be signed in to change notification settings - Fork 264
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
Removed DB specific get api's from Selectable class #378
Conversation
sonic-net#376 to remove DB specific API from selectable class which is generic. However to access to the Derviced Class Redis Select API via python we need to downcast the the Selectable Object. Added Helpfer function to do same. Ref: http://www.swig.org/Doc3.0/Python.html Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
common/redisselect.h
Outdated
int getDbConnectorId() override; | ||
std::string getDbNamespace() override; | ||
int getDbConnectorId(); | ||
std::string getDbNamespace(); |
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.
Suggest add only one function const DBConnector* getDbConnector() const
, and caller could call ret->getNamespace()
, or any other member functions. #Closed
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.
Since the DBConnector is unique_ptr return the reference to the contained object, or a non owning pointer Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
@judyjoseph Please update sonic-py-common client accordingly. |
sure will take care of updating the pmon application ..Thanks for this change ! |
* Address Review comments #376 to remove DB specific API from selectable class which is generic. However to access to the Derviced Class Redis Select API via python we need to downcast the the Selectable Object. Added Helpfer function to do same. Ref: http://www.swig.org/Doc3.0/Python.html Signed-off-by: Abhishek Dosi <abdosi@microsoft.com> * Align the code properly Signed-off-by: Abhishek Dosi <abdosi@microsoft.com> * Address Review Comments. Return the DBConnector Pointer. Since the DBConnector is unique_ptr return the reference to the contained object, or a non owning pointer Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
Why/What I did:-
Change 1:
As per review comments on #376
removed DB specific API from selectable class
to keep it generic.
Change 2:
However to access to the Dervied Class Redis Select
DB API's via python we need to downcast the the Selectable Object
to RedisSelect object.
To do this added Helper function in swig .i file Ref: http://www.swig.org/Doc3.0/Python.html
How I verify:
After this change updated client caclmgrd to call new downcast API and verified we are getting correct information.
Sample Client Side code after this change -