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:
[email protected]
With regards,
Apache Git Services