@@ -41,11 +41,11 @@ func TestBuildCopIteratorWithRowCountHint(t *testing.T) {
41
41
vars := kv .NewVariables (& killed )
42
42
opt := & kv.ClientSendOption {}
43
43
44
+ ranges := copr .BuildKeyRanges ("a" , "c" , "d" , "e" , "h" , "x" , "y" , "z" )
44
45
req := & kv.Request {
45
- Tp : kv .ReqTypeDAG ,
46
- KeyRanges : kv .NewNonParitionedKeyRanges (copr .BuildKeyRanges ("a" , "c" , "d" , "e" , "h" , "x" , "y" , "z" )),
47
- FixedRowCountHint : []int {1 , 1 , 3 , copr .CopSmallTaskRow },
48
- Concurrency : 15 ,
46
+ Tp : kv .ReqTypeDAG ,
47
+ KeyRanges : kv .NewNonParitionedKeyRangesWithHint (ranges , []int {1 , 1 , 3 , copr .CopSmallTaskRow }),
48
+ Concurrency : 15 ,
49
49
}
50
50
it , errRes := copClient .BuildCopIterator (ctx , req , vars , opt )
51
51
require .Nil (t , errRes )
@@ -55,11 +55,11 @@ func TestBuildCopIteratorWithRowCountHint(t *testing.T) {
55
55
require .Equal (t , smallConc , 1 )
56
56
require .Equal (t , rateLimit .GetCapacity (), 2 )
57
57
58
+ ranges = copr .BuildKeyRanges ("a" , "c" , "d" , "e" , "h" , "x" , "y" , "z" )
58
59
req = & kv.Request {
59
- Tp : kv .ReqTypeDAG ,
60
- KeyRanges : kv .NewNonParitionedKeyRanges (copr .BuildKeyRanges ("a" , "c" , "d" , "e" , "h" , "x" , "y" , "z" )),
61
- FixedRowCountHint : []int {1 , 1 , 3 , 3 },
62
- Concurrency : 15 ,
60
+ Tp : kv .ReqTypeDAG ,
61
+ KeyRanges : kv .NewNonParitionedKeyRangesWithHint (ranges , []int {1 , 1 , 3 , 3 }),
62
+ Concurrency : 15 ,
63
63
}
64
64
it , errRes = copClient .BuildCopIterator (ctx , req , vars , opt )
65
65
require .Nil (t , errRes )
@@ -70,11 +70,11 @@ func TestBuildCopIteratorWithRowCountHint(t *testing.T) {
70
70
require .Equal (t , rateLimit .GetCapacity (), 3 )
71
71
72
72
// cross-region long range
73
+ ranges = copr .BuildKeyRanges ("a" , "z" )
73
74
req = & kv.Request {
74
- Tp : kv .ReqTypeDAG ,
75
- KeyRanges : kv .NewNonParitionedKeyRanges (copr .BuildKeyRanges ("a" , "z" )),
76
- FixedRowCountHint : []int {10 },
77
- Concurrency : 15 ,
75
+ Tp : kv .ReqTypeDAG ,
76
+ KeyRanges : kv .NewNonParitionedKeyRangesWithHint (ranges , []int {10 }),
77
+ Concurrency : 15 ,
78
78
}
79
79
it , errRes = copClient .BuildCopIterator (ctx , req , vars , opt )
80
80
require .Nil (t , errRes )
@@ -84,11 +84,11 @@ func TestBuildCopIteratorWithRowCountHint(t *testing.T) {
84
84
require .Equal (t , smallConc , 2 )
85
85
require .Equal (t , rateLimit .GetCapacity (), 3 )
86
86
87
+ ranges = copr .BuildKeyRanges ("a" , "z" )
87
88
req = & kv.Request {
88
- Tp : kv .ReqTypeDAG ,
89
- KeyRanges : kv .NewNonParitionedKeyRanges (copr .BuildKeyRanges ("a" , "z" )),
90
- FixedRowCountHint : []int {copr .CopSmallTaskRow + 1 },
91
- Concurrency : 15 ,
89
+ Tp : kv .ReqTypeDAG ,
90
+ KeyRanges : kv .NewNonParitionedKeyRangesWithHint (ranges , []int {copr .CopSmallTaskRow + 1 }),
91
+ Concurrency : 15 ,
92
92
}
93
93
it , errRes = copClient .BuildCopIterator (ctx , req , vars , opt )
94
94
require .Nil (t , errRes )
@@ -115,12 +115,12 @@ func TestBuildCopIteratorWithBatchStoreCopr(t *testing.T) {
115
115
vars := kv .NewVariables (& killed )
116
116
opt := & kv.ClientSendOption {}
117
117
118
+ ranges := copr .BuildKeyRanges ("a" , "c" , "d" , "e" , "h" , "x" , "y" , "z" )
118
119
req := & kv.Request {
119
- Tp : kv .ReqTypeDAG ,
120
- KeyRanges : kv .NewNonParitionedKeyRanges (copr .BuildKeyRanges ("a" , "c" , "d" , "e" , "h" , "x" , "y" , "z" )),
121
- FixedRowCountHint : []int {1 , 1 , 3 , 3 },
122
- Concurrency : 15 ,
123
- StoreBatchSize : 1 ,
120
+ Tp : kv .ReqTypeDAG ,
121
+ KeyRanges : kv .NewNonParitionedKeyRangesWithHint (ranges , []int {1 , 1 , 3 , 3 }),
122
+ Concurrency : 15 ,
123
+ StoreBatchSize : 1 ,
124
124
}
125
125
it , errRes := copClient .BuildCopIterator (ctx , req , vars , opt )
126
126
require .Nil (t , errRes )
@@ -131,12 +131,12 @@ func TestBuildCopIteratorWithBatchStoreCopr(t *testing.T) {
131
131
require .Equal (t , len (tasks [1 ].ToPBBatchTasks ()), 1 )
132
132
require .Equal (t , tasks [1 ].RowCountHint , 9 )
133
133
134
+ ranges = copr .BuildKeyRanges ("a" , "c" , "d" , "e" , "h" , "x" , "y" , "z" )
134
135
req = & kv.Request {
135
- Tp : kv .ReqTypeDAG ,
136
- KeyRanges : kv .NewNonParitionedKeyRanges (copr .BuildKeyRanges ("a" , "c" , "d" , "e" , "h" , "x" , "y" , "z" )),
137
- FixedRowCountHint : []int {1 , 1 , 3 , 3 },
138
- Concurrency : 15 ,
139
- StoreBatchSize : 3 ,
136
+ Tp : kv .ReqTypeDAG ,
137
+ KeyRanges : kv .NewNonParitionedKeyRangesWithHint (ranges , []int {1 , 1 , 3 , 3 }),
138
+ Concurrency : 15 ,
139
+ StoreBatchSize : 3 ,
140
140
}
141
141
it , errRes = copClient .BuildCopIterator (ctx , req , vars , opt )
142
142
require .Nil (t , errRes )
@@ -146,12 +146,12 @@ func TestBuildCopIteratorWithBatchStoreCopr(t *testing.T) {
146
146
require .Equal (t , tasks [0 ].RowCountHint , 14 )
147
147
148
148
// paging will disable store batch.
149
+ ranges = copr .BuildKeyRanges ("a" , "c" , "d" , "e" , "h" , "x" , "y" , "z" )
149
150
req = & kv.Request {
150
- Tp : kv .ReqTypeDAG ,
151
- KeyRanges : kv .NewNonParitionedKeyRanges (copr .BuildKeyRanges ("a" , "c" , "d" , "e" , "h" , "x" , "y" , "z" )),
152
- FixedRowCountHint : []int {1 , 1 , 3 , 3 },
153
- Concurrency : 15 ,
154
- StoreBatchSize : 3 ,
151
+ Tp : kv .ReqTypeDAG ,
152
+ KeyRanges : kv .NewNonParitionedKeyRangesWithHint (ranges , []int {1 , 1 , 3 , 3 }),
153
+ Concurrency : 15 ,
154
+ StoreBatchSize : 3 ,
155
155
Paging : struct {
156
156
Enable bool
157
157
MinPagingSize uint64
0 commit comments