Xuanwo commented on code in PR #174:
URL: https://github.com/apache/iceberg-rust/pull/174#discussion_r1477279307


##########
crates/catalog/hms/src/catalog.rs:
##########
@@ -71,19 +54,29 @@ impl Debug for HmsCatalog {
 impl HmsCatalog {
     /// Create a new hms catalog.
     pub fn new(config: HmsCatalogConfig) -> Result<Self> {
-        let mut channel = thrift::transport::TTcpChannel::new();
-        channel
-            .open(config.address.as_str())
-            .map_err(from_thrift_error)?;
-        let (i_chan, o_chan) = channel.split().map_err(from_thrift_error)?;
-        let i_chan = TBufferedReadTransport::new(i_chan);
-        let o_chan = TBufferedWriteTransport::new(o_chan);
-        let i_proto = TBinaryInputProtocol::new(i_chan, true);
-        let o_proto = TBinaryOutputProtocol::new(o_chan, true);
-        let client = ThriftHiveMetastoreSyncClient::new(i_proto, o_proto);
+        let address = config
+            .address
+            .as_str()
+            .to_socket_addrs()
+            .map_err(from_io_error)?
+            .next()
+            .ok_or_else(|| {
+                Error::new(
+                    ErrorKind::Unexpected,
+                    format!("invalid address: {}", config.address),
+                )
+            })?;
+
+        let client = ThriftHiveMetastoreClientBuilder::new("hms")
+            .address(address)
+            // Framed thrift rpc is not enabled by default in HMS, we use
+            // buffered instead.
+            
.make_codec(volo_thrift::codec::default::DefaultMakeCodec::buffered())

Review Comment:
   Tracked at https://github.com/apache/iceberg-rust/issues/188



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to