Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipe: Improved batch performance by reducing unnecessary serialization #23

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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