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 2022/03/11 20:55:11 UTC
[GitHub] [iceberg] jackye1995 commented on a change in pull request #4309: Core : Fix NPE post HadoopMetricContext Deserialization
jackye1995 commented on a change in pull request #4309:
URL: https://github.com/apache/iceberg/pull/4309#discussion_r825093965
##########
File path: core/src/main/java/org/apache/iceberg/hadoop/HadoopMetricsContext.java
##########
@@ -114,12 +111,18 @@ public void increment(Integer amount) {
};
}
- private void writeObject(ObjectOutputStream out) throws IOException {
- out.defaultWriteObject();
- }
+ private FileSystem.Statistics statistics() {
+ FileSystem.Statistics localStatisticsRef = statistics;
Review comment:
why do we need a `localStatisticsRef`?
If we already have `private transient FileSystem.Statistics statistics`, I think we can just check against that and see:
```java
if (statistics == null) {
synchronized (this) {
if (statistics == null) {
this.statistics = FileSystem.getStatistics(scheme, null);
}
}
}
return statistics;
```
I think this is also used in places like https://github.com/apache/iceberg/blob/master/core/src/main/java/org/apache/iceberg/SerializableTable.java#L117-L132
--
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