Skip to content

Commit

Permalink
more lint
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmdeng authored and Michael Deng committed Jan 29, 2025
1 parent 4ee38f7 commit 4aa676d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions dm/config/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ type SyncerConfig struct {
Compact bool `yaml:"compact" toml:"compact" json:"compact"`
MultipleRows bool `yaml:"multiple-rows" toml:"multiple-rows" json:"multiple-rows"`

AutoIdCacheSize uint64 `yaml:"auto-id-cache" toml:"auto-id-cache" json:"auto-id-cache"`
AutoIDCacheSize uint64 `yaml:"auto-id-cache" toml:"auto-id-cache" json:"auto-id-cache"`

// deprecated
MaxRetry int `yaml:"max-retry" toml:"max-retry" json:"max-retry"`
Expand Down Expand Up @@ -1177,7 +1177,7 @@ type SyncerConfigForDowngrade struct {
SafeModeDuration string `yaml:"safe-mode-duration,omitempty"`
Compact bool `yaml:"compact,omitempty"`
MultipleRows bool `yaml:"multipleRows,omitempty"`
AutoIdCacheSize uint64 `yaml:"auto-id-cache-size,omitempty"`
AutoIDCacheSize uint64 `yaml:"auto-id-cache-size,omitempty"`
}

// NewSyncerConfigsForDowngrade converts SyncerConfig to SyncerConfigForDowngrade.
Expand All @@ -1198,7 +1198,7 @@ func NewSyncerConfigsForDowngrade(syncerConfigs map[string]*SyncerConfig) map[st
EnableANSIQuotes: syncerConfig.EnableANSIQuotes,
Compact: syncerConfig.Compact,
MultipleRows: syncerConfig.MultipleRows,
AutoIdCacheSize: syncerConfig.AutoIdCacheSize,
AutoIDCacheSize: syncerConfig.AutoIDCacheSize,
}
syncerConfigsForDowngrade[configName] = newSyncerConfig
}
Expand Down
8 changes: 4 additions & 4 deletions dm/syncer/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type DDLWorker struct {
tableRouter *regexprrouter.RouteTable
sourceTableNamesFlavor conn.LowerCaseTableNamesFlavor
collationCompatible string
autoIdCacheSize uint64
autoIDCacheSize uint64
charsetAndDefaultCollation map[string]string
idAndCollationMap map[int]string
baList *filter.Filter
Expand Down Expand Up @@ -107,7 +107,7 @@ func NewDDLWorker(pLogger *log.Logger, syncer *Syncer) *DDLWorker {
tableRouter: syncer.tableRouter,
sourceTableNamesFlavor: syncer.SourceTableNamesFlavor,
collationCompatible: syncer.cfg.CollationCompatible,
autoIdCacheSize: syncer.cfg.AutoIdCacheSize,
autoIDCacheSize: syncer.cfg.AutoIDCacheSize,
charsetAndDefaultCollation: syncer.charsetAndDefaultCollation,
idAndCollationMap: syncer.idAndCollationMap,
baList: syncer.baList,
Expand Down Expand Up @@ -1492,7 +1492,7 @@ ColumnLoop:
}

func (ddl *DDLWorker) adjustAutoIdCache(ddlInfo *ddlInfo) {
if ddl.autoIdCacheSize <= 0 {
if ddl.autoIDCacheSize <= 0 {
return
}

Expand All @@ -1518,7 +1518,7 @@ func (ddl *DDLWorker) adjustAutoIdCache(ddlInfo *ddlInfo) {
if addAutoIdCache {
createStmt.Options = append(createStmt.Options, &ast.TableOption{
Tp: ast.TableOptionAutoIdCache,
UintValue: ddl.autoIdCacheSize,
UintValue: ddl.autoIDCacheSize,
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion dm/syncer/ddl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ func TestAdjustAutoIdCache(t *testing.T) {
for _, cse := range cases {
syncer := NewSyncer(&config.SubTaskConfig{
SyncerConfig: config.SyncerConfig{
AutoIdCacheSize: cse.cacheSize,
AutoIDCacheSize: cse.cacheSize,
},
}, nil, nil)
syncer.tctx = tctx
Expand Down

0 comments on commit 4aa676d

Please sign in to comment.