This commit is contained in:
finley
2025-02-16 19:46:09 +08:00
parent 341c16d065
commit 43dc28d335
7 changed files with 212 additions and 4 deletions

View File

@@ -34,6 +34,11 @@ func (cluster *Cluster) Relay(peerId string, c redis.Connection, cmdLine [][]byt
return cli.Send(cmdLine)
}
// LocalExec executes command at local node
func (cluster *Cluster) LocalExec(c redis.Connection, cmdLine [][]byte) redis.Reply {
return cluster.db.Exec(c, cmdLine)
}
// GetPartitionKey extract hashtag
func GetPartitionKey(key string) string {
beg := strings.Index(key, "{")
@@ -65,4 +70,4 @@ func execRaftCommittedIndex(cluster *Cluster, c redis.Connection, cmdLine CmdLin
return protocol.MakeErrReply(err.Error())
}
return protocol.MakeIntReply(int64(index))
}
}