store_op.go
internal/ops/store_op.go - Overview
Defines the structure for representing a store operation and its response within the DiceDB system.
Detailed Documentation
StoreOp
type StoreOp struct {
SeqID uint8 // SeqID is the sequence id of the operation within a single request (optional, may be used for ordering)
RequestID uint32 // RequestID identifies the request that this StoreOp belongs to
Cmd *cmd.DiceDBCmd // Cmd is the atomic Store command (e.g., GET, SET)
ShardID uint8 // ShardID of the shard on which the Store command will be executed
CmdHandlerID string // CmdHandlerID is the ID of the command handler that sent this Store operation
Client *comm.Client // Client that sent this Store operation. TODO: This can potentially replace the CmdHandlerID in the future
HTTPOp bool // HTTPOp is true if this Store operation is an HTTP operation
WebsocketOp bool // WebsocketOp is true if this Store operation is a Websocket operation
PreProcessing bool // PreProcessing indicates whether a comamnd operation requires preprocessing before execution. This is mainly used is multi-step-multi-shard commands
}
Purpose: Represents a store operation to be performed within the DiceDB system.
Parameters:
SeqID
: The sequence ID of the operation within a single request. Type:uint8
.RequestID
: The ID of the request that thisStoreOp
belongs to. Type:uint32
.Cmd
: The atomic store command (e.g., GET, SET). Type:*cmd.DiceDBCmd
.ShardID
: The shard ID on which the store command will be executed. Type:uint8
.CmdHandlerID
: The ID of the command handler that sent this store operation. Type:string
.Client
: The client that sent this store operation. Type:*comm.Client
.HTTPOp
: Indicates if this store operation is an HTTP operation. Type:bool
.WebsocketOp
: Indicates if this store operation is a Websocket operation. Type:bool
.PreProcessing
: Indicates whether a command operation requires preprocessing before execution. Type:bool
.
Returns:
- None
StoreResponse
type StoreResponse struct {
RequestID uint32 // RequestID that this StoreResponse belongs to
EvalResponse *eval.EvalResponse // Result of the Store operation, for now the type is set to []byte, but this can change in the future.
SeqID uint8 // Sequence ID to maintain the order of responses, used to track the sequence in which operations are processed or received.
}
Purpose: Represents the response of a store operation.
Parameters:
RequestID
: The ID of the request that thisStoreResponse
belongs to. Type:uint32
.EvalResponse
: The result of the store operation. Type:*eval.EvalResponse
.SeqID
: The sequence ID to maintain the order of responses. Type:uint8
.
Returns:
- None