(batchsize int)
| 188 | } |
| 189 | |
| 190 | func (s *BinlogVerifyStore) Batches(batchsize int) []BinlogVerifyBatch { |
| 191 | s.mutex.Lock() |
| 192 | defer s.mutex.Unlock() |
| 193 | |
| 194 | batches := make([]BinlogVerifyBatch, 0) |
| 195 | for schemaName, _ := range s.store { |
| 196 | for tableName, paginationKeySet := range s.store[schemaName] { |
| 197 | paginationKeyBatch := make([]interface{}, 0, batchsize) |
| 198 | |
| 199 | for paginationKeyStr, _ := range paginationKeySet { |
| 200 | paginationKeyBatch = append(paginationKeyBatch, paginationKeyStr) |
| 201 | if len(paginationKeyBatch) >= batchsize { |
| 202 | batches = append(batches, BinlogVerifyBatch{ |
| 203 | SchemaName: schemaName, |
| 204 | TableName: tableName, |
| 205 | PaginationKeys: paginationKeyBatch, |
| 206 | }) |
| 207 | paginationKeyBatch = make([]interface{}, 0, batchsize) |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | if len(paginationKeyBatch) > 0 { |
| 212 | batches = append(batches, BinlogVerifyBatch{ |
| 213 | SchemaName: schemaName, |
| 214 | TableName: tableName, |
| 215 | PaginationKeys: paginationKeyBatch, |
| 216 | }) |
| 217 | } |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | return batches |
| 222 | } |
| 223 | |
| 224 | func (s *BinlogVerifyStore) CurrentRowCount() uint64 { |
| 225 | return s.currentRowCount |
no outgoing calls
no test coverage detected