Skip to content

Commit

Permalink
Pipe: Improved batch performance by reducing unnecessary serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Caideyipi authored Jan 29, 2024
1 parent 69088d0 commit 9c87022
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions tsfile/src/main/java/org/apache/tsfile/write/record/Tablet.java
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,15 @@ public static Object[] readTabletValuesFromBuffer(
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) {
Expand Down Expand Up @@ -756,8 +765,21 @@ private boolean isBitMapsEqual(BitMap[] thisBitMaps, BitMap[] thatBitMaps, int c
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++) {
Expand Down

0 comments on commit 9c87022

Please sign in to comment.