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

[GitHub] [avro] complone opened a new pull request, #1790: [AVRO-3590] fix Snappy CodecFactory is null

complone opened a new pull request, #1790:
URL: https://github.com/apache/avro/pull/1790

   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   Related to [AVRO-3590](https://issues.apache.org/jira/browse/AVRO-3590)
   
   ### Tests
   
   ```TestAllCodec#testCodec```
   
   ### Commits
   
   - [ ] My commits all reference Jira issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](https://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [ ] In case of new functionality, my PR adds documentation that describes how to use it.
     - All the public functions and the classes in the PR contain Javadoc that explain what it does
   


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

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


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

Posted by GitBox <gi...@apache.org>.
complone commented on code in PR #1790:
URL: https://github.com/apache/avro/pull/1790#discussion_r931775163


##########
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:
   For related descriptions, see:
   https://issues.apache.org/jira/browse/AVRO-3590



##########
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:
   @clesaec For related descriptions, see:
   https://issues.apache.org/jira/browse/AVRO-3590



-- 
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


[GitHub] [avro] complone commented on pull request #1790: [AVRO-3590] fix Snappy CodecFactory is null

Posted by GitBox <gi...@apache.org>.
complone commented on PR #1790:
URL: https://github.com/apache/avro/pull/1790#issuecomment-1197665255

   > TestAllCodec#testCodec
   
   In TestAllCodec#testCodec snappyCodec can be added normally and CodeFactory is not empty


-- 
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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
complone commented on code in PR #1790:
URL: https://github.com/apache/avro/pull/1790#discussion_r931775163


##########
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:
   @clesaec The code itself is not empty when it is called, and it is empty when addCodec adds SnappyCodec, see:
   https://issues.apache.org/jira/browse/AVRO-3590



-- 
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