You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2023/05/12 04:01:35 UTC

[iotdb] 01/01: Optimize measurementId serialization in WAL

This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch optimize_measurementid_serialize
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit b0e871541566ad08b4428bb7b6a1518f39d4b4dd
Author: HTHou <hh...@outlook.com>
AuthorDate: Fri May 12 12:00:38 2023 +0800

    Optimize measurementId serialization in WAL
---
 server/src/main/java/org/apache/iotdb/db/wal/utils/WALWriteUtils.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/wal/utils/WALWriteUtils.java b/server/src/main/java/org/apache/iotdb/db/wal/utils/WALWriteUtils.java
index 5eb016ced79..0e7a73d5f6b 100644
--- a/server/src/main/java/org/apache/iotdb/db/wal/utils/WALWriteUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/wal/utils/WALWriteUtils.java
@@ -124,7 +124,8 @@ public class WALWriteUtils {
       return write(NO_BYTE_TO_READ, buffer);
     }
     int len = 0;
-    byte[] bytes = s.getBytes();
+    byte[] bytes = new byte[s.length()];
+    s.getBytes(0, s.length(), bytes, 0);
     len += write(bytes.length, buffer);
     buffer.put(bytes);
     len += bytes.length;