MCPcopy Create free account
hub / github.com/apache/kvrocks-controller / ToSlotString

Method ToSlotString

store/cluster.go:101–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99}
100
101func (cluster *Cluster) ToSlotString() (string, error) {
102 var builder strings.Builder
103 for i, shard := range cluster.Shards {
104 shardSlotsString, err := shard.ToSlotsString()
105 if err != nil {
106 return "", fmt.Errorf("found err at shard[%d]: %w", i, err)
107 }
108 builder.WriteString(shardSlotsString)
109 }
110 return builder.String(), nil
111}
112
113func (cluster *Cluster) GetShard(shardIndex int) (*Shard, error) {
114 if shardIndex < 0 || shardIndex >= len(cluster.Shards) {

Callers 1

SyncClusterInfoMethod · 0.80

Calls 3

ToSlotsStringMethod · 0.80
ErrorfMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected