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!
LSET
Syntax: LSET key index element
Command description:
Sets the list element at index to element. For more information on the index argument, see LINDEX.
An error is returned for out of range indexes.
Response:
Simple string reply: OK.
How to approach this task:
Add the new command info to the listCommandsInfoMap 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/ListOps.cs)
Define a new method in IGarnetAPI or IGarnetReadAPI 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/ListCommands.cs)
Add a new method to ListObjImpl which will perform the required operation on the list object (Garnet.server/Objects/List/ListObjectImpl.cs)
Add a new enum value to ListOperation and add the appropriate case to the switch in ListObject.Operate, in which you will call the method defined in step #8 (Garnet.server/Objects/List/ListObject.cs)
Add an appropriate case to the switch in TransactionManager.ListObjectKeys (Garnet.server/Transaction/TxnKeyManager.cs)
Add tests for the new command in the RespListTests class (Garnet.test/RespListTests.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!
LSET
Syntax:
LSET key index element
Command description:
Sets the list element at
index
toelement
. For more information on the index argument, seeLINDEX
.An error is returned for out of range indexes.
Response:
Simple string reply: OK.
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: