Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
D3Hunter committed Sep 18, 2023
1 parent a148d3d commit e25413d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
10 changes: 1 addition & 9 deletions br/pkg/lightning/backend/external/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,7 @@ func (m *SortedKVMeta) Merge(other *SortedKVMeta) {

// MergeSummary merges the WriterSummary into this SortedKVMeta.
func (m *SortedKVMeta) MergeSummary(summary *WriterSummary) {
m.MinKey = NotNilMin(m.MinKey, summary.Min)
m.MaxKey = NotNilMax(m.MaxKey, summary.Max)
m.TotalKVSize += summary.TotalSize
for _, f := range summary.MultipleFilesStats {
for _, filename := range f.Filenames {
m.DataFiles = append(m.DataFiles, filename[0])
m.StatFiles = append(m.StatFiles, filename[1])
}
}
m.Merge(NewSortedKVMeta(summary))
}

// NotNilMin returns the smallest of a and b, ignoring nil values.
Expand Down
2 changes: 0 additions & 2 deletions br/pkg/lightning/backend/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -1694,8 +1694,6 @@ func (local *Backend) GetExternalEngineKVStatistics(engineUUID uuid.UUID) (
totalKVSize int64, totalKVCount int64) {
v, ok := local.externalEngine[engineUUID]
if !ok {
// we get it after import, but before clean up, so this should not happen
// todo: return error
return 0, 0
}
return v.KVStatistics()
Expand Down
3 changes: 1 addition & 2 deletions executor/importer/table_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,11 @@ func GetCachedKVStoreFrom(pdAddr string, tls *common.TLS) (tidbkv.Storage, error
// GetRegionSplitSizeKeys gets the region split size and keys from PD.
func GetRegionSplitSizeKeys(ctx context.Context) (regionSplitSize int64, regionSplitKeys int64, err error) {
tidbCfg := tidb.GetGlobalConfig()
hostPort := net.JoinHostPort("127.0.0.1", strconv.Itoa(int(tidbCfg.Status.StatusPort)))
tls, err := common.NewTLS(
tidbCfg.Security.ClusterSSLCA,
tidbCfg.Security.ClusterSSLCert,
tidbCfg.Security.ClusterSSLKey,
hostPort,
"",
nil, nil, nil,
)
if err != nil {
Expand Down

0 comments on commit e25413d

Please sign in to comment.