.setFramed(useFramedTransport);
                    final ThriftClientConfig clientConfig = new ThriftClientConfig()
                        .setConnectTimeout(new Duration(clientSocketTimeout, TimeUnit.SECONDS));
                    final HiveMetastoreFactory factory = new SimpleHiveMetastoreFactory(thriftClientManager, clientConfig, metastoreConfig);
                    client = closer.register(ThriftHiveMetastore.Client.forHiveMetastore(factory.getDefaultClient()));
                    isConnected = true;
                    if (isConnected && conf.getBoolVar(ConfVars.METASTORE_EXECUTE_SET_UGI)) {
                        // Call set_ugi, only in unsecure mode.
                        try {