You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2022/07/27 14:12:51 UTC

[GitHub] [avro] clesaec commented on a diff in pull request #1790: [AVRO-3590] fix Snappy CodecFactory is null

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: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org