Skip to content

Commit

Permalink
use int64
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <[email protected]>
  • Loading branch information
timvaillancourt committed Nov 23, 2024
1 parent e965a41 commit 3e9c685
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions go/vt/discovery/topology_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type TopologyWatcher struct {
cell string
refreshInterval time.Duration
refreshKnownTablets bool
concurrency int
concurrency int64
ctx context.Context
cancelFunc context.CancelFunc
// wg keeps track of all launched Go routines.
Expand All @@ -92,7 +92,7 @@ type TopologyWatcher struct {

// NewTopologyWatcher returns a TopologyWatcher that monitors all
// the tablets in a cell, and reloads them as needed.
func NewTopologyWatcher(ctx context.Context, topoServer *topo.Server, hc HealthCheck, f TabletFilter, cell string, refreshInterval time.Duration, refreshKnownTablets bool, topoReadConcurrency int) *TopologyWatcher {
func NewTopologyWatcher(ctx context.Context, topoServer *topo.Server, hc HealthCheck, f TabletFilter, cell string, refreshInterval time.Duration, refreshKnownTablets bool, topoReadConcurrency int64) *TopologyWatcher {
tw := &TopologyWatcher{
topoServer: topoServer,
healthcheck: hc,
Expand Down
4 changes: 2 additions & 2 deletions go/vt/topo/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ var (
"vtorc", "vtbackup"}

// Default read concurrency to use in order to avoid overhwelming the topo server.
DefaultReadConcurrency = 32
DefaultReadConcurrency int64 = 32
)

func init() {
Expand All @@ -196,7 +196,7 @@ func registerTopoFlags(fs *pflag.FlagSet) {
fs.StringVar(&topoImplementation, "topo_implementation", topoImplementation, "the topology implementation to use")
fs.StringVar(&topoGlobalServerAddress, "topo_global_server_address", topoGlobalServerAddress, "the address of the global topology server")
fs.StringVar(&topoGlobalRoot, "topo_global_root", topoGlobalRoot, "the path of the global topology data in the global topology server")
fs.IntVar(&DefaultReadConcurrency, "topo_read_concurrency", DefaultReadConcurrency, "Maximum concurrency of topo reads.")
fs.Int64Var(&DefaultReadConcurrency, "topo_read_concurrency", DefaultReadConcurrency, "Maximum concurrency of topo reads.")
}

// RegisterFactory registers a Factory for an implementation for a Server.
Expand Down
2 changes: 1 addition & 1 deletion go/vt/topo/stats_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func NewStatsConn(cell string, conn Conn) *StatsConn {
cell: cell,
conn: conn,
readOnly: false,
readSem: semaphore.NewWeighted(int64(DefaultReadConcurrency)),
readSem: semaphore.NewWeighted(DefaultReadConcurrency),
}
}

Expand Down

0 comments on commit 3e9c685

Please sign in to comment.