clesaec commented on code in PR #1790:
URL: https://github.com/apache/avro/pull/1790#discussion_r931115882
##########
lang/java/avro/src/main/java/org/apache/avro/file/SnappyCodec.java:
##########
@@ -37,7 +40,7 @@ static class Option extends CodecFactory {
@Override
protected Codec createInstance() {
- return new SnappyCodec();
+ return SnappyCodec.INSTANCE;
Review Comment:
Hello,
A comment and a question :
As SnappyCodec contains a crc32 field that change [its state on Compress
call](https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/file/SnappyCodec.java#L57-L58),
usage of a singleton will lead to error in multi thread environment.
On your issue, do you have any log that contains "Snappy was not available".
That could explain why "snappy" is null [with this
code](https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/file/CodecFactory.java#L68-L72)
?
--
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]