You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/02/03 16:35:45 UTC

[GitHub] [pulsar] codelipenghui opened a new pull request #6193: Fix get schema version in HttpLookupService.

codelipenghui opened a new pull request #6193: Fix get schema version in HttpLookupService.
URL: https://github.com/apache/pulsar/pull/6193
 
 
   ### Motivation
   
   Fix get schema version in HttpLookupService.  The com.yahoo.sketches.Util.bytesToLong method need to flip the byte[]. Otherwise, will get a wrong long value. So use ByteBuffer to convert byte[] version to long. 
   
   This issue will happens when users use http protocol client and multiple version schemas.
   
   ### Verifying this change
   
   New tests added for HttpLookupService and BinaryLookupService.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (yes)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (no)
   

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


With regards,
Apache Git Services

[GitHub] [pulsar] sijie closed pull request #6193: Fix get schema version in HttpLookupService.

Posted by GitBox <gi...@apache.org>.
sijie closed pull request #6193: Fix get schema version in HttpLookupService.
URL: https://github.com/apache/pulsar/pull/6193
 
 
   

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


With regards,
Apache Git Services

[GitHub] [pulsar] sijie commented on issue #6193: Fix get schema version in HttpLookupService.

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #6193: Fix get schema version in HttpLookupService.
URL: https://github.com/apache/pulsar/pull/6193#issuecomment-582232424
 
 
   /pulsarbot run-failure-checks

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


With regards,
Apache Git Services

[GitHub] [pulsar] sijie commented on a change in pull request #6193: Fix get schema version in HttpLookupService.

Posted by GitBox <gi...@apache.org>.
sijie commented on a change in pull request #6193: Fix get schema version in HttpLookupService.
URL: https://github.com/apache/pulsar/pull/6193#discussion_r374251833
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/HttpLookupService.java
 ##########
 @@ -176,5 +176,12 @@ public void close() throws Exception {
         httpClient.close();
     }
 
+    private long bytesToLong(byte[] bytes) {
+        schemaVersionConvertBuffer.clear();
+        schemaVersionConvertBuffer.put(bytes, 0, bytes.length);
 
 Review comment:
   hmm. this would result in copying memory. and it is not thread-safe.
   
   I would suggest just using `ByteBuffer.wrap(bytes)` to get a ByteBuffer and then read the long number.

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


With regards,
Apache Git Services

[GitHub] [pulsar] skyrocknroll commented on issue #6193: Fix get schema version in HttpLookupService.

Posted by GitBox <gi...@apache.org>.
skyrocknroll commented on issue #6193: Fix get schema version in HttpLookupService.
URL: https://github.com/apache/pulsar/pull/6193#issuecomment-582987455
 
 
   /pulsarbot run-failure-checks

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


With regards,
Apache Git Services

[GitHub] [pulsar] codelipenghui commented on issue #6193: Fix get schema version in HttpLookupService.

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #6193: Fix get schema version in HttpLookupService.
URL: https://github.com/apache/pulsar/pull/6193#issuecomment-582291241
 
 
   /pulsarbot run-failure-checks

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


With regards,
Apache Git Services

[GitHub] [pulsar] sijie commented on issue #6193: Fix get schema version in HttpLookupService.

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #6193: Fix get schema version in HttpLookupService.
URL: https://github.com/apache/pulsar/pull/6193#issuecomment-582274811
 
 
   /pulsarbot run-failure-checks

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


With regards,
Apache Git Services

[GitHub] [pulsar] codelipenghui opened a new pull request #6193: Fix get schema version in HttpLookupService.

Posted by GitBox <gi...@apache.org>.
codelipenghui opened a new pull request #6193: Fix get schema version in HttpLookupService.
URL: https://github.com/apache/pulsar/pull/6193
 
 
   ### Motivation
   
   Fix get schema version in HttpLookupService.  The com.yahoo.sketches.Util.bytesToLong method need to flip the byte[]. Otherwise, will get a wrong long value. So use ByteBuffer to convert byte[] version to long. 
   
   This issue will happens when users use http protocol client and multiple version schemas.
   
   ### Verifying this change
   
   New tests added for HttpLookupService and BinaryLookupService.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (yes)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (no)
   

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


With regards,
Apache Git Services

[GitHub] [pulsar] sijie merged pull request #6193: Fix get schema version in HttpLookupService.

Posted by GitBox <gi...@apache.org>.
sijie merged pull request #6193: Fix get schema version in HttpLookupService.
URL: https://github.com/apache/pulsar/pull/6193
 
 
   

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


With regards,
Apache Git Services

[GitHub] [pulsar] sijie commented on issue #6193: Fix get schema version in HttpLookupService.

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #6193: Fix get schema version in HttpLookupService.
URL: https://github.com/apache/pulsar/pull/6193#issuecomment-582247307
 
 
   /pulsarbot run-failure-checks

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


With regards,
Apache Git Services

[GitHub] [pulsar] codelipenghui commented on issue #6193: Fix get schema version in HttpLookupService.

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #6193: Fix get schema version in HttpLookupService.
URL: https://github.com/apache/pulsar/pull/6193#issuecomment-581688305
 
 
   @sijie I have addressed your comment, please take a look, thanks.

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


With regards,
Apache Git Services