rpuch commented on code in PR #4562:
URL: https://github.com/apache/ignite-3/pull/4562#discussion_r1802471629


##########
modules/core/src/main/java/org/apache/ignite/internal/util/io/IgniteDataInput.java:
##########
@@ -95,6 +95,35 @@ public interface IgniteDataInput extends DataInput {
      */
     int read(byte[] b, int off, int len) throws IOException;
 
+    /**
+     * Reads a length (that is, a non-negative integer that will most likely 
be small).
+     *
+     * @throws IOException If something goes wrong.
+     */
+    int readLength() throws IOException;

Review Comment:
   Because it is about a specific subset of unsigned ints: lengths. Lengths 
have a specific distribution of values (the smaller the value, the more the 
probability that it will be used) as shorter strings and collections are more 
probable than long ones. This allows to use a specific encoding method (namely, 
'naive var int') to exploit this distribution.



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to