func NewTopologyWriter(topology *server.Topology, lc *client.LocalConnection, cm *ConnectionManager) *TopologyWriter { return &TopologyWriter{ toWrite: topology.Clone(), localConnection: lc, connectionManager: cm, finished: false, } }
func (cm *ConnectionManager) updateTopology(topology *server.Topology) { if cm.topology.Equal(topology) { return } rmEq := cm.topology != nil && cm.topology.AllRMs.Equal(topology.AllRMs) // Even if no semantic change, the DBVersion/TxnId may have // changed, so we must update our cache. cm.topology = topology.Clone() if rmEq { return } server.Log("Topology change:", topology) rmToServerCopy := cm.cloneRMToServer() for _, cconn := range cm.connCountToClient { cconn.TopologyChange(topology, rmToServerCopy) } }