maedhroz commented on code in PR #1774:
URL: https://github.com/apache/cassandra/pull/1774#discussion_r941645611


##########
src/java/org/apache/cassandra/io/util/DataOutputBuffer.java:
##########
@@ -221,6 +240,17 @@ public ByteBuffer buffer(boolean duplicate)
         return result;
     }
 
+    /**
+     * Gets the underlying ByteBuffer and calls {@link ByteBuffer#flip()}.  
This method is "unsafe" in the sense that
+     * it returns the underlying buffer, which may be modified by other 
methods after calling this method.  If the calling
+     * logic knows that no new calls to this object will happen after calling 
this method, then this method can avoid the
+     * copying done in {@link #getData()} and {@link #asNewBuffer()}.

Review Comment:
   I think the original intent was also to avoid `buffer(true)`, which we no 
longer used outside `HintsWriter`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to