You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "yschengzi (via GitHub)" <gi...@apache.org> on 2023/06/03 10:08:04 UTC
[GitHub] [iotdb] yschengzi opened a new pull request, #10045: [IOTDB-5966] Pipe: Revision of Tablet serialize and deserialize
yschengzi opened a new pull request, #10045:
URL: https://github.com/apache/iotdb/pull/10045
This PR contains:
- Revision of Tablet serialize and deserialize
- add UT
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] SteveYurongSu merged pull request #10045: [IOTDB-5966] Pipe: Revision of Tablet serialize and deserialize
Posted by "SteveYurongSu (via GitHub)" <gi...@apache.org>.
SteveYurongSu merged PR #10045:
URL: https://github.com/apache/iotdb/pull/10045
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] SteveYurongSu commented on a diff in pull request #10045: [IOTDB-5966] Pipe: Revision of Tablet serialize and deserialize
Posted by "SteveYurongSu (via GitHub)" <gi...@apache.org>.
SteveYurongSu commented on code in PR #10045:
URL: https://github.com/apache/iotdb/pull/10045#discussion_r1215682752
##########
tsfile/src/main/java/org/apache/iotdb/tsfile/write/record/Tablet.java:
##########
@@ -584,58 +605,119 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
- if (o == null || getClass() != o.getClass()) {
+ if (o == null || !getClass().equals(o.getClass())) {
return false;
}
Tablet that = (Tablet) o;
boolean flag =
that.rowSize == rowSize
- && Arrays.equals(that.timestamps, timestamps)
- && Arrays.equals(that.bitMaps, bitMaps)
+ && Objects.equals(that.deviceId, deviceId)
&& Objects.equals(that.schemas, schemas)
- && Objects.equals(that.measurementIndex, measurementIndex)
- && Objects.equals(that.deviceId, deviceId);
+ && Objects.equals(that.measurementIndex, measurementIndex);
if (!flag) {
return false;
}
+ // assert timestamps and bitmaps
+ int columns = (schemas == null ? 0 : schemas.size());
+ if (!isTimestampsEqual(this.timestamps, that.timestamps, rowSize)
+ || !isBitMapsEqual(this.bitMaps, that.bitMaps, columns)) {
+ return false;
+ }
+
// assert values
Object[] thatValues = that.values;
+ if (thatValues == values) {
+ return true;
+ }
+ if (thatValues == null || values == null) {
+ return false;
+ }
+
if (thatValues.length != values.length) {
return false;
}
for (int i = 0, n = values.length; i < n; i++) {
+ if (thatValues[i] == values[i]) {
+ continue;
+ }
+ if (thatValues[i] == null || values[i] == null) {
+ return false;
+ }
+
switch (schemas.get(i).getType()) {
case INT32:
- if (!Arrays.equals((int[]) thatValues[i], (int[]) values[i])) {
+ int[] thisIntValues = (int[]) values[i];
Review Comment:
need to judge that schema type
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org