You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/04/09 18:03:26 UTC
[GitHub] [beam] scwhittle commented on a change in pull request #14498: [BEAM-12142] Reduce ThreadLocal interaction with MetricsEnvironment by leaving unchanging holder object in thread local state
scwhittle commented on a change in pull request #14498:
URL: https://github.com/apache/beam/pull/14498#discussion_r610815450
##########
File path: sdks/java/core/src/main/java/org/apache/beam/sdk/metrics/MetricsEnvironment.java
##########
@@ -52,8 +53,8 @@
private static final AtomicBoolean METRICS_SUPPORTED = new AtomicBoolean(false);
private static final AtomicBoolean REPORTED_MISSING_CONTAINER = new AtomicBoolean(false);
- private static final ThreadLocal<@Nullable MetricsContainer> CONTAINER_FOR_THREAD =
- new ThreadLocal<>();
+ private static final ThreadLocal<@Nullable MetricsContainerHolder> CONTAINER_FOR_THREAD =
Review comment:
Yes due to the withInitialValue, however I believe I tried it and it didn't seem to work without the Nullable. I think it didn't like it later with the get method
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org