You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: balancer.go
    path of file: ./repos/sharingan/grpc-server/v1.33.2/balancer/rls/internal
    
    the code of the file until where you have to start completion: /*
 *
 * Copyright 2020 gRPC authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package rls

import (
	"sync"

	"google.golang.org/grpc"
	"google.golang.org/grpc/balancer"
	"google.golang.org/grpc/grpclog"
	"google.golang.org/grpc/internal/grpcsync"
)

var (
	_ balancer.Balancer = (*rlsBalancer)(nil)

	// For overriding in tests.
	newRLSClientFunc = newRLSClient
	logger           = grpclog.Component("rls")
)

// rlsBalancer implements the RLS LB policy.
type rlsBalancer struct {
	done *grpcsync.Event
	cc   balancer.ClientConn
	opts balancer.BuildOptions

	// Mutex protects all the state maintained by the LB policy.
	// TODO(easwars): O
    
func (lb *rlsBalancer) updateControlChannel(newCfg *lbConfig) {
	oldCfg := lb.lbCfg
	if newCfg.lookupService == oldCfg.lookupService && newCfg.lookupServiceTimeout == oldCfg.lookupServiceTimeout {
		return
	}

	// Use RPC timeout from new config, if different from existing one.
	timeout := oldCfg.lookupServiceTimeout
	if timeout != newCfg.lookupServiceTimeout {
		timeout = newCfg.lookupServiceTimeout
	}

	if newCfg.lookupService == oldCfg.lookupService {
		// This is the case where only the timeout has changed. We will continue
		// to use the existing clientConn. but will create a new rlsClient with
		// the new timeout.
		lb.rlsC = newRLSClientFunc(lb.rlsCC, lb.opts.Target.Endpoint, timeout)
		return
	}

	// This is the case where the RLS server name has changed. We need to create
	// a new clientConn and close the old one.
	var dopts []grpc.DialOption
	if dialer := lb.opts.Dialer; dialer != nil {
		dopts = append(dopts, grpc.WithContextDialer(dialer))
	}
	dopts = append(dopts, dialCreds(lb.opts))

	cc, err := grpc.Dial(newCfg.lookupService, dopts...)
	if err != nil {
		logger.Errorf("rls: dialRLS(%s, %v): %v", newCfg.lookupService, lb.opts, err)
		// An error from a non-blocking dial indicates something serious. We
		// should continue to use the old control channel if one exists, and
		// return so that the rest of the config updates can be processes.
		return
	}
	if lb.rlsCC != nil {
		lb.rlsCC.Close()
	}
	lb.rlsCC = cc
	lb.rlsC = newRLSClientFunc(cc, lb.opts.Target.Endpoint, timeout)
}