theosib-amazon commented on code in PR #959:
URL: https://github.com/apache/parquet-mr/pull/959#discussion_r873884939
##########
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/CodecFactory.java:
##########
@@ -184,8 +192,18 @@ public CompressionCodecName getCodecName() {
}
+ /*
+ Modified for https://issues.apache.org/jira/browse/PARQUET-2126
+ */
@Override
public BytesCompressor getCompressor(CompressionCodecName codecName) {
+ Thread me = Thread.currentThread();
Review Comment:
A thread object is created once and exist until the thread dies. Thread does
not override hashcode, so it falls back to the implementation in Object, which
returns a fixed object ID.
I did consider using ThreadLocal, but then it would not be possible for
release() to clean up all of the (de)compressors from defunct threads.
The way I did it appears to be the recommended solution, since that's what I
find when I google this problem.
--
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]