You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "ibessonov (via GitHub)" <gi...@apache.org> on 2023/06/27 11:42:37 UTC

[GitHub] [ignite-3] ibessonov commented on a diff in pull request #2249: IGNITE-19828 Optimize RAFT log encoder/decoder data format

ibessonov commented on code in PR #2249:
URL: https://github.com/apache/ignite-3/pull/2249#discussion_r1243598274


##########
modules/raft/src/main/java/org/apache/ignite/raft/jraft/entity/codec/v1/V1Decoder.java:
##########
@@ -51,98 +52,127 @@ public LogEntry decode(final byte[] content) {
         return log;
     }
 
+    // Refactored to look closer to Ignites code style.
     public void decode(final LogEntry log, final byte[] content) {
-        // 1-5 type
-        final int iType = Bits.getInt(content, 1);
-        log.setType(EnumOutter.EntryType.forNumber(iType));
-        // 5-13 index
-        // 13-21 term
-        final long index = Bits.getLong(content, 5);
-        final long term = Bits.getLong(content, 13);
+        var reader = new Reader(content);

Review Comment:
   Ok, I'll explain data format in documentation of the _factory_



-- 
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-unsubscribe@ignite.apache.org

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