Xuanwo opened a new issue, #430:
URL: https://github.com/apache/iceberg-rust/issues/430

   Current reset catalog's init logic doesn't look good:
   
   ```rust
   pub async fn new(config: RestCatalogConfig) -> Result<Self> {
       let mut catalog = Self {
           client: config.try_create_rest_client()?,
           config,
       };
       catalog.fetch_access_token().await?;
       catalog.client = catalog.config.try_create_rest_client()?;
       catalog.update_config().await?;
       catalog.client = catalog.config.try_create_rest_client()?;
   
       Ok(catalog)
   }
   ```
   
   We need to:
   
   - create a new http client (with `self.config`)
   - fetch_access_token (`self.config.props` changed) 
   - create a new http client (with the new `self.config`)
   - update_config (`self.config.props` changed) 
   - create a new http client (with the new `self.config`)
   
   I suggest separating static and dynamic properties. Keep the configuration 
and HTTP client static, unchanged. Store dynamic properties separately and 
merge them only when sending a request. This approach could also help resolve 
issue #422.


-- 
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.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