Remove additional cruft from ServerManager's channels
No longer needed code.
This commit is contained in:
parent
c980d492c6
commit
1a09a5b2cf
|
@ -50,14 +50,6 @@ const (
|
||||||
// will take ~26min for all servers to rebalance. A 10K cluster in
|
// will take ~26min for all servers to rebalance. A 10K cluster in
|
||||||
// the same scenario will take ~2.6min to rebalance.
|
// the same scenario will take ~2.6min to rebalance.
|
||||||
newRebalanceConnsPerSecPerServer = 64
|
newRebalanceConnsPerSecPerServer = 64
|
||||||
|
|
||||||
// maxConsulServerManagerEvents is the size of the consulServersCh
|
|
||||||
// buffer.
|
|
||||||
maxConsulServerManagerEvents = 16
|
|
||||||
|
|
||||||
// defaultClusterSize is the assumed cluster size if no serf cluster
|
|
||||||
// is available.
|
|
||||||
defaultClusterSize = 1024
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ConsulClusterInfo interface {
|
type ConsulClusterInfo interface {
|
||||||
|
@ -80,14 +72,6 @@ type ServerManager struct {
|
||||||
serverConfigValue atomic.Value
|
serverConfigValue atomic.Value
|
||||||
serverConfigLock sync.Mutex
|
serverConfigLock sync.Mutex
|
||||||
|
|
||||||
// consulServersCh is used to receive events related to the
|
|
||||||
// maintenance of the list of consulServers
|
|
||||||
consulServersCh chan consulServerEventTypes
|
|
||||||
|
|
||||||
// refreshRebalanceDurationCh is used to signal that a refresh should
|
|
||||||
// occur
|
|
||||||
refreshRebalanceDurationCh chan bool
|
|
||||||
|
|
||||||
// shutdownCh is a copy of the channel in consul.Client
|
// shutdownCh is a copy of the channel in consul.Client
|
||||||
shutdownCh chan struct{}
|
shutdownCh chan struct{}
|
||||||
|
|
||||||
|
@ -191,11 +175,8 @@ func NewServerManager(logger *log.Logger, shutdownCh chan struct{}, cci ConsulCl
|
||||||
sm = new(ServerManager)
|
sm = new(ServerManager)
|
||||||
sm.logger = logger
|
sm.logger = logger
|
||||||
sm.clusterInfo = cci
|
sm.clusterInfo = cci
|
||||||
sm.consulServersCh = make(chan consulServerEventTypes, maxConsulServerManagerEvents)
|
|
||||||
sm.shutdownCh = shutdownCh
|
sm.shutdownCh = shutdownCh
|
||||||
|
|
||||||
sm.refreshRebalanceDurationCh = make(chan bool, maxConsulServerManagerEvents)
|
|
||||||
|
|
||||||
sc := serverConfig{}
|
sc := serverConfig{}
|
||||||
sc.servers = make([]*server_details.ServerDetails, 0)
|
sc.servers = make([]*server_details.ServerDetails, 0)
|
||||||
sm.serverConfigValue.Store(sc)
|
sm.serverConfigValue.Store(sc)
|
||||||
|
@ -283,12 +264,6 @@ func (sm *ServerManager) RemoveServer(server *server_details.ServerDetails) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// requestRefreshRebalanceDuration sends a message to which causes a background
|
|
||||||
// thread to recalc the duration
|
|
||||||
func (sm *ServerManager) requestRefreshRebalanceDuration() {
|
|
||||||
sm.refreshRebalanceDurationCh <- true
|
|
||||||
}
|
|
||||||
|
|
||||||
// refreshServerRebalanceTimer is called
|
// refreshServerRebalanceTimer is called
|
||||||
func (sm *ServerManager) refreshServerRebalanceTimer(timer *time.Timer) {
|
func (sm *ServerManager) refreshServerRebalanceTimer(timer *time.Timer) {
|
||||||
serverCfg := sm.getServerConfig()
|
serverCfg := sm.getServerConfig()
|
||||||
|
|
Loading…
Reference in a new issue