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: [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]