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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]