MCPcopy
hub / github.com/redis/go-redis / executeOnAllShards

Method executeOnAllShards

osscluster_router.go:97–108  ·  view source on GitHub ↗

executeOnAllShards executes command on all master shards

(ctx context.Context, cmd Cmder, policy *routing.CommandPolicy)

Source from the content-addressed store, hash-verified

95
96// executeOnAllShards executes command on all master shards
97func (c *ClusterClient) executeOnAllShards(ctx context.Context, cmd Cmder, policy *routing.CommandPolicy) error {
98 state, err := c.state.Get(ctx)
99 if err != nil {
100 return err
101 }
102
103 if len(state.Masters) == 0 {
104 return errClusterNoNodes
105 }
106
107 return c.executeParallel(ctx, cmd, state.Masters, policy)
108}
109
110// executeMultiShard handles commands that operate on multiple keys across shards
111func (c *ClusterClient) executeMultiShard(ctx context.Context, cmd Cmder, policy *routing.CommandPolicy) error {

Callers 1

routeAndRunMethod · 0.95

Calls 2

executeParallelMethod · 0.95
GetMethod · 0.65

Tested by

no test coverage detected