Skip to content

Comments

SWSSDBConnector_new_keyed to c-api#1026

Merged
qiluo-msft merged 4 commits intosonic-net:masterfrom
qiluo-msft:qiluo/c-api-dbkey
Jun 13, 2025
Merged

SWSSDBConnector_new_keyed to c-api#1026
qiluo-msft merged 4 commits intosonic-net:masterfrom
qiluo-msft:qiluo/c-api-dbkey

Conversation

@qiluo-msft
Copy link
Contributor

This is to reopen #991

The rust code using swss-common needs to access redis instances from different containers and namespaces.

@mssonicbld
Copy link
Collaborator

/azp run

@qiluo-msft qiluo-msft requested a review from r12f June 10, 2025 22:35
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft qiluo-msft requested a review from Copilot June 10, 2025 22:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR reopens a previous pull request to introduce a new API function SWSSDBConnector_new_keyed that allows a Rust client to access multiple Redis instances in different containers and namespaces.

  • Added a new API function in both header and source files to support keyed connectors.
  • Extended the unit tests to verify that an empty containerName and netns result in behavior identical to the original SWSSDBConnector_new_named.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/c_api_ut.cpp Added test for new_keyed, checking equivalence with new_named
common/c-api/dbconnector.h Declared the new_keyed function prototype
common/c-api/dbconnector.cpp Implemented the new_keyed function using keyed parameters

@qiluo-msft qiluo-msft marked this pull request as ready for review June 11, 2025 17:34
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft qiluo-msft merged commit 08bc52d into sonic-net:master Jun 13, 2025
15 checks passed
@qiluo-msft qiluo-msft deleted the qiluo/c-api-dbkey branch June 13, 2025 22:51
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202412: Azure/sonic-swss-common.msft#61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants