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 2021/03/31 03:58:47 UTC

[GitHub] [avro] thiru-mg opened a new pull request #1168: AVRO-3051: Modernized Avro data parser

thiru-mg opened a new pull request #1168:
URL: https://github.com/apache/avro/pull/1168


   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [x] My PR addresses the following [Avro Jira](https://issues.apache.org/jira/browse/AVRO/) issues and references them in the PR title. For example, "AVRO-1234: My Avro PR"
     - https://issues.apache.org/jira/browse/AVRO-3051
     - In case you are adding a dependency, check if the license complies with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   
   ### Tests
   
   - [x] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason: only refactoring. No bug fix or new functionality
   
   ### Commits
   
   - [x] 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
   
   - [x] 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.

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



[GitHub] [avro] emkornfield commented on a change in pull request #1168: AVRO-3051: Modernized Avro data parser

Posted by GitBox <gi...@apache.org>.
emkornfield commented on a change in pull request #1168:
URL: https://github.com/apache/avro/pull/1168#discussion_r605348991



##########
File path: lang/c++/impl/parsing/JsonCodec.cc
##########
@@ -470,30 +466,30 @@ class JsonEncoder : public Encoder {
     JsonHandler<F> handler_;
     P parser_;
 
-    void init(OutputStream &os);
-    void flush();
-    int64_t byteCount() const;
-    void encodeNull();
-    void encodeBool(bool b);
-    void encodeInt(int32_t i);
-    void encodeLong(int64_t l);
-    void encodeFloat(float f);
-    void encodeDouble(double d);
-    void encodeString(const std::string &s);
-    void encodeBytes(const uint8_t *bytes, size_t len);
-    void encodeFixed(const uint8_t *bytes, size_t len);
-    void encodeEnum(size_t e);
-    void arrayStart();
-    void arrayEnd();
-    void mapStart();
-    void mapEnd();
-    void setItemCount(size_t count);
-    void startItem();
-    void encodeUnionIndex(size_t e);
+    void init(OutputStream &os) override;

Review comment:
       also, not sure if they already are, but if these aren't, then enclosing private details in the anonymous namespace is also a good idea.




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

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



[GitHub] [avro] emkornfield commented on a change in pull request #1168: AVRO-3051: Modernized Avro data parser

Posted by GitBox <gi...@apache.org>.
emkornfield commented on a change in pull request #1168:
URL: https://github.com/apache/avro/pull/1168#discussion_r604578849



##########
File path: lang/c++/impl/parsing/JsonCodec.cc
##########
@@ -470,30 +466,30 @@ class JsonEncoder : public Encoder {
     JsonHandler<F> handler_;
     P parser_;
 
-    void init(OutputStream &os);
-    void flush();
-    int64_t byteCount() const;
-    void encodeNull();
-    void encodeBool(bool b);
-    void encodeInt(int32_t i);
-    void encodeLong(int64_t l);
-    void encodeFloat(float f);
-    void encodeDouble(double d);
-    void encodeString(const std::string &s);
-    void encodeBytes(const uint8_t *bytes, size_t len);
-    void encodeFixed(const uint8_t *bytes, size_t len);
-    void encodeEnum(size_t e);
-    void arrayStart();
-    void arrayEnd();
-    void mapStart();
-    void mapEnd();
-    void setItemCount(size_t count);
-    void startItem();
-    void encodeUnionIndex(size_t e);
+    void init(OutputStream &os) override;

Review comment:
       if these are being declared in a .cc should they be final instead?




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

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



[GitHub] [avro] thiru-mg commented on a change in pull request #1168: AVRO-3051: Modernized Avro data parser

Posted by GitBox <gi...@apache.org>.
thiru-mg commented on a change in pull request #1168:
URL: https://github.com/apache/avro/pull/1168#discussion_r605348072



##########
File path: lang/c++/impl/parsing/JsonCodec.cc
##########
@@ -470,30 +466,30 @@ class JsonEncoder : public Encoder {
     JsonHandler<F> handler_;
     P parser_;
 
-    void init(OutputStream &os);
-    void flush();
-    int64_t byteCount() const;
-    void encodeNull();
-    void encodeBool(bool b);
-    void encodeInt(int32_t i);
-    void encodeLong(int64_t l);
-    void encodeFloat(float f);
-    void encodeDouble(double d);
-    void encodeString(const std::string &s);
-    void encodeBytes(const uint8_t *bytes, size_t len);
-    void encodeFixed(const uint8_t *bytes, size_t len);
-    void encodeEnum(size_t e);
-    void arrayStart();
-    void arrayEnd();
-    void mapStart();
-    void mapEnd();
-    void setItemCount(size_t count);
-    void startItem();
-    void encodeUnionIndex(size_t e);
+    void init(OutputStream &os) override;

Review comment:
       Good point. Took care of this and similar uses throughout.




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

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



[GitHub] [avro] thiru-mg merged pull request #1168: AVRO-3051: Modernized Avro data parser

Posted by GitBox <gi...@apache.org>.
thiru-mg merged pull request #1168:
URL: https://github.com/apache/avro/pull/1168


   


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

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