arunpandianp commented on code in PR #36742:
URL: https://github.com/apache/beam/pull/36742#discussion_r2519363832
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/util/ThreadLocalByteStringOutputStream.java:
##########
@@ -74,38 +82,39 @@ public ByteStringOutputStream stream() {
@Override
public void close() {
stream.reset();
- if (releaseThreadLocal) {
+ if (refHolder != null) {
refHolder.inUse = false;
}
}
}
private static class RefHolder {
- public SoftReference<@Nullable ByteStringOutputStream> streamRef =
- new SoftReference<>(new ByteStringOutputStream());
+ public ByteStringOutputStream stream = new ByteStringOutputStream();
Review Comment:
Good idea. Removed RefHolder and simplified 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]