Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lucifercr07 committed Dec 23, 2024
1 parent fc21706 commit f2cd715
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions internal/iothread/cmd_compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,10 @@ func composeFlushDB(responses ...ops.StoreResponse) interface{} {
return clientio.OK
}

// composeMSet processes responses from multiple shards for an "MSet" operation
// (Multi-set operation). It loops through the responses to check if any shard returned an error.
// composePFMerge processes responses from multiple shards for an "PFMerge" operation.
// It loops through the responses to check if any shard returned an error.
// If an error is detected, it immediately returns that error. Otherwise, it returns "OK"
// to indicate that all "MSet" operations across shards were successful.
// to indicate that all merged HyperLogLog is set to the destination variable successfully.
func composePFMerge(responses ...ops.StoreResponse) interface{} {
for idx := range responses {
if responses[idx].EvalResponse.Error != nil {
Expand Down
5 changes: 3 additions & 2 deletions internal/iothread/cmd_decompose.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ func decomposeCopy(ctx context.Context, thread *BaseIOThread, cd *cmd.DiceDBCmd)
return decomposedCmds, nil
}

// decomposeMSet decomposes the PFMERGE command into individual GET commands for each HLL.
// For each key it creates a separate GET command to get the value at the given key.
// decomposePFMerge decomposes the PFMERGE command into individual GET commands for each HLL.
// For each key it creates a separate GET command to get the value at the given key, and waits for all responses to be
// returned before proceeding.
func decomposePFMerge(ctx context.Context, thread *BaseIOThread, cd *cmd.DiceDBCmd) ([]*cmd.DiceDBCmd, error) {
// Waiting for GET command response for all the keys to be merged
resp := make([]*object.InternalObj, 0, len(cd.Args)-1)
Expand Down
2 changes: 1 addition & 1 deletion internal/iothread/iothread.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import (
"github.com/google/uuid"
)

const defaultRequestTimeout = 600 * time.Second
const defaultRequestTimeout = 6 * time.Second

var requestCounter uint32

Expand Down

0 comments on commit f2cd715

Please sign in to comment.