You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/12/04 00:16:35 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #3257: Bump Nessie to 0.15.1 + related changes

rdblue commented on a change in pull request #3257:
URL: https://github.com/apache/iceberg/pull/3257#discussion_r762354130



##########
File path: core/src/main/java/org/apache/iceberg/BaseMetastoreTableOperations.java
##########
@@ -175,8 +182,7 @@ protected void refreshFromMetadataLocation(String newLocation, Predicate<Excepti
           .retry(numRetries).exponentialBackoff(100, 5000, 600000, 4.0 /* 100, 400, 1600, ... */)
           .throwFailureWhenFinished()
           .shouldRetryTest(shouldRetry)
-          .run(metadataLocation -> newMetadata.set(
-              TableMetadataParser.read(io(), metadataLocation)));
+          .run(metadataLocation -> newMetadata.set(metadataLoader.apply(metadataLocation)));

Review comment:
       I'm just catching up on this PR, sorry to be late.
   
   I'm curious why this uses a `Function` passed into refresh rather than defining a load metadata method. The function passed in from `NessieTableOperations` is actually a method reference, so couldn't this just be a call to that method, `loadTableMetadata`?
   
   ```java
       .run(metadataLocation -> loadTableMetadata(metadataLocation));
   
   ...
   
     public TableMetadata loadTableMetadata(String metadataLocation) {
       return TableMetadataParser.read(io(), metadataLocation);
     }
   ```

##########
File path: core/src/main/java/org/apache/iceberg/BaseMetastoreTableOperations.java
##########
@@ -175,8 +182,7 @@ protected void refreshFromMetadataLocation(String newLocation, Predicate<Excepti
           .retry(numRetries).exponentialBackoff(100, 5000, 600000, 4.0 /* 100, 400, 1600, ... */)
           .throwFailureWhenFinished()
           .shouldRetryTest(shouldRetry)
-          .run(metadataLocation -> newMetadata.set(
-              TableMetadataParser.read(io(), metadataLocation)));
+          .run(metadataLocation -> newMetadata.set(metadataLoader.apply(metadataLocation)));

Review comment:
       @rymurr, I'm just catching up on this PR, sorry to be late.
   
   I'm curious why this uses a `Function` passed into refresh rather than defining a load metadata method. The function passed in from `NessieTableOperations` is actually a method reference, so couldn't this just be a call to that method, `loadTableMetadata`?
   
   ```java
       .run(metadataLocation -> loadTableMetadata(metadataLocation));
   
   ...
   
     public TableMetadata loadTableMetadata(String metadataLocation) {
       return TableMetadataParser.read(io(), metadataLocation);
     }
   ```




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