shishkovilja commented on code in PR #12335:
URL: https://github.com/apache/ignite/pull/12335#discussion_r2349401216


##########
modules/core/src/main/java/org/apache/ignite/internal/direct/stream/DirectByteBufferStream.java:
##########
@@ -862,6 +864,16 @@ public void writeKeyCacheObject(KeyCacheObject keyObj) {
         }
     }
 
+    /**
+     * @param val Value.
+     */
+    public void writeGridLongList(@Nullable GridLongList val) {

Review Comment:
   > I think this implementation could use the fact that writeLongArray(long[] 
arr, int len) performs internal null check for the first argument and writes -1 
if null was passed.
   
   But we need to pass arguments to `#writeLongArray`, such as `size`.
   
   ---
   
   > From that perspective it may make sense to get rid of these two methods in 
DirectByteBufferStream and move logic of creating GridLongList instances to 
DirectMessageReader/DirectMessageWriter implementations.
   
   We need to call `DirectMessageReader#readGridLongList` [1] and 
`#writeGridLongList` [2] during collections reads / writes.
   
   1. 
https://github.com/apache/ignite/blob/e61d95ae6b4a623b81b68375551712fb4f115eb2/modules/core/src/main/java/org/apache/ignite/internal/direct/stream/DirectByteBufferStream.java#L2177
 
   2. 
https://github.com/apache/ignite/blob/e61d95ae6b4a623b81b68375551712fb4f115eb2/modules/core/src/main/java/org/apache/ignite/internal/direct/stream/DirectByteBufferStream.java#L2077



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

Reply via email to