You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's your opportunity to implement a RESP command in Garnet!
Syntax: ZMSCORE key member [member ...]
Command description:
Returns the scores associated with the specified members in the sorted set stored at key.
For every member that does not exist in the sorted set, a nil value is returned.
Response:
One of the following:
Nil reply: if the member does not exist in the sorted set. Array reply: a list of string member scores as double-precision floating point numbers.
How to approach this task:
Add the new command info to the sortedSetCommandsInfoMap in the RespCommandsInfo class (Garnet.server/Resp/RespCommandsInfo.cs)
Add the new command string to the returned HashSet in the RespInfo.GetCommands method (Garnet.server/Resp/RespInfo.cs)
Add the appropriate fast parsing logic for the new command in the RespCommand.FastParseArrayCommand method (use other commands as reference) (Garnet.server/Resp/RespCommand.cs)
Implement the wrapper method to the storage layer in StorageSession (Garnet.server/Storage/Session/ObjectStore/SortedSetOps.cs)
Define a new method in IGarnetAPI and implement it in GarnetApiObjectCommands, calling the method you have implemented in step #4 (Garnet.server/API/IGarnetAPI.cs, Garnet.server/API/GarnetApiObjectCommands.cs)
Add a new method to the RespServerSession class which will call the storage API and return the appropriate response (Garnet.server/Resp/Objects/SortedSetCommands.cs)
Add a new method to SortedSetObjImpl which will perform the required operation on the hash object (Garnet.server/Objects/SortedSet/SortedSetObjectImpl.cs)
Add a new enum value to SortedSetOperation and add the appropriate case to the switch in SortedSetObject.Operate, in which you will call the method defined in step #8 (Garnet.server/Objects/SortedSet/SortedSetObject.cs)
Add an appropriate case to the switch in TransactionManager.SortedSetObjectKeys (Garnet.server/Transaction/TxnKeyManager.cs)
Add tests for the new command in the RespSortedSetTests class (Garnet.test/RespSortedSetTests.cs)
Tip: First add a simple test that calls the new command and use it to debug as you develop, it will make your life much easier!
If you have any questions, the Garnet team is here to help!
The text was updated successfully, but these errors were encountered:
Here's your opportunity to implement a RESP command in Garnet!
Syntax:
ZMSCORE key member [member ...]
Command description:
Returns the scores associated with the specified
members
in the sorted set stored atkey
.For every
member
that does not exist in the sorted set, a nil value is returned.Response:
One of the following:
Nil reply: if the member does not exist in the sorted set.
Array reply: a list of string
member
scores as double-precision floating point numbers.How to approach this task:
Tip: First add a simple test that calls the new command and use it to debug as you develop, it will make your life much easier!
If you have any questions, the Garnet team is here to help!
The text was updated successfully, but these errors were encountered: