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

jackietien pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/tsfile.git


The following commit(s) were added to refs/heads/develop by this push:
     new 9c870225 Pipe: Improved batch performance by reducing unnecessary 
serialization
9c870225 is described below

commit 9c87022576b9c4b6c5a39af8cafa83b3753dcc1e
Author: Caideyipi <[email protected]>
AuthorDate: Mon Jan 29 10:37:05 2024 +0800

    Pipe: Improved batch performance by reducing unnecessary serialization
---
 .../org/apache/tsfile/write/record/Tablet.java     | 26 ++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/tsfile/src/main/java/org/apache/tsfile/write/record/Tablet.java 
b/tsfile/src/main/java/org/apache/tsfile/write/record/Tablet.java
index c16bfa2e..943b5a3c 100644
--- a/tsfile/src/main/java/org/apache/tsfile/write/record/Tablet.java
+++ b/tsfile/src/main/java/org/apache/tsfile/write/record/Tablet.java
@@ -606,6 +606,15 @@ public class Tablet {
     return values;
   }
 
+  /**
+   * Note that the function will judge 2 tablets to be equal when their 
contents are logically the
+   * same. Namely, a tablet with bitmap "null" may be equal to another tablet 
with 3 columns and
+   * bitmap "[null, null, null]", and a tablet with rowSize 2 is judged 
identical to other tablets
+   * regardless of any timeStamps with indexes larger than or equal to 2.
+   *
+   * @param o the tablet to compare
+   * @return true if the tablets are logically equal
+   */
   @Override
   public boolean equals(Object o) {
     if (this == o) {
@@ -756,8 +765,21 @@ public class Tablet {
     if (thisBitMaps == thatBitMaps) {
       return true;
     }
-    if (thisBitMaps == null || thatBitMaps == null) {
-      return false;
+    if (thisBitMaps == null) {
+      for (int i = 0; i < columns; i++) {
+        if (thatBitMaps[i] != null) {
+          return false;
+        }
+      }
+      return true;
+    }
+    if (thatBitMaps == null) {
+      for (int i = 0; i < columns; i++) {
+        if (thisBitMaps[i] != null) {
+          return false;
+        }
+      }
+      return true;
     }
 
     for (int i = 0; i < columns; i++) {

Reply via email to