You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "ajantha-bhat (via GitHub)" <gi...@apache.org> on 2023/03/02 02:24:13 UTC

[GitHub] [iceberg] ajantha-bhat commented on a diff in pull request #6789: Nessie: Add refresh for catalog APIs

ajantha-bhat commented on code in PR #6789:
URL: https://github.com/apache/iceberg/pull/6789#discussion_r1122533913


##########
nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java:
##########
@@ -310,19 +312,28 @@ public Configuration getConf() {
 
   @VisibleForTesting
   String currentHash() {
-    return client.getRef().getHash();
+    return refreshedClient().getRef().getHash();
   }
 
   @VisibleForTesting
   String currentRefName() {
-    return client.getRef().getName();
+    return refreshedClient().getRef().getName();
   }
 
   @VisibleForTesting
   FileIO fileIO() {
     return fileIO;
   }
 
+  private NessieIcebergClient refreshedClient() {
+    try {
+      client.refresh();

Review Comment:
   >  Why not simply call client.refresh() where we need to
   
   Because of exception handling. I can't modify each method to throw `NessieNotFoundException` or catching `NessieNotFoundException` in each method is more lines of code. Hence, I extracted a method. 
   
   > why not call the method simply client()?
   
   ok. I will rename it.
   



-- 
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-unsubscribe@iceberg.apache.org

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


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