Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nolouch committed Oct 11, 2018
1 parent 61d6777 commit aa92a14
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tools/pd-simulator/simulator/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,15 +301,15 @@ func generateKeys(size int) []string {
func generateTableKeys(tableCount, size int) []string {
v := make([]string, 0, size)
groupNumber := size / tableCount
id := 0
tableID := 0
var key []byte
for size > 0 {
id++
tableID := id
tableID++
for rowID := 0; rowID < groupNumber && size > 0; rowID++ {
key := table.GenerateRowKey(int64(tableID), int64(rowID))
if rowID == 0 {
key = table.GenerateTableKey(int64(tableID))
continue
} else {
key = table.GenerateRowKey(int64(tableID), int64(rowID))
}
key = table.EncodeBytes(key)
v = append(v, string(key))
Expand Down Expand Up @@ -355,7 +355,7 @@ func mustDecodeMvccKey(key []byte) []byte {

// generateTiDBEncodedSplitKey calculates the split key with start and end key,
// the keys are encoded according to the TiDB encoding rules.
// The algorithm is the computationally the logical median.
// The split key is the logical median.
func generateTiDBEncodedSplitKey(start, end []byte) []byte {
if bytes.Equal(start, end) {
simutil.Logger.Fatal("start key and end key should not be same")
Expand Down

0 comments on commit aa92a14

Please sign in to comment.