phrocker commented on a change in pull request #3801: NIFI-6760: When
writing/reading the length of a DataFrame, do so usin…
URL: https://github.com/apache/nifi/pull/3801#discussion_r333496658
##########
File path:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/clustered/client/async/nio/LoadBalanceSession.java
##########
@@ -319,16 +319,15 @@ private ByteBuffer getFlowFileContent() throws
IOException {
final byte[] compressed = compressDataFrame(byteBuffer,
bytesRead);
final int compressedMaxLen = compressed.length;
- buffer = ByteBuffer.allocate(3 + compressedMaxLen);
+ buffer = ByteBuffer.allocate(5 + compressedMaxLen);
buffer.put((byte)
LoadBalanceProtocolConstants.DATA_FRAME_FOLLOWS);
- buffer.putShort((short) compressedMaxLen);
Review comment:
@markap14 You wrote 2 byte short ...but the primitive is signed, unlike
char. is that why you had to remove buffer.putShort((short) bytesRead); to
avoid an auto boxing issue ? if so, could you instead split into a separate
data frame or is that more work than changing formats? This seems like it has
the implication of version mismatches occurring due to differing wire format.
----------------------------------------------------------------
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