-
Notifications
You must be signed in to change notification settings - Fork 539
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
common: Table: Adding set/get/del API
In addition Table class provide a direct access to Redis DB. The set() command writes to Redis using HSET command. Usage: DBConnector db(0, "localhost", 6379, 0); Table t(&db1, "A_TABLE"); FieldValueTuple a("field", "value"); vector<FieldValueTuple> attrs = { a }; t.set("key1", attrs); The get() command read values using the HGETALL command. Usage: vector<FieldValueTuple> v; if (!t.get("TEST", v)) { cout << "not exists" << endl; return 0; } for(auto i : v) { cout << fvField(i) << " = " << fvValue(i) << endl; } The del() command simply deletes an entry (Using DEL command) portsyncd: Migrate to Table::get() API Move the check API to Table::get() common: ProducerTable: Refactor API to use Table::formatHSET common: ProducerTable: change set and del to inherit from Table APIs common: ConsumerTable: Remove peek() API Remove peek() API, which is now Table::get() API Signed-off-by: Elad Raz <eladr@mellanox.com>
- Loading branch information
Showing
8 changed files
with
84 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters