You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@iotdb.apache.org by "Yuan Tian (Jira)" <ji...@apache.org> on 2021/09/23 03:20:00 UTC

[jira] [Created] (IOTDB-1726) Wrong hashCode() and equals() method in ChunkMetadata

Yuan Tian created IOTDB-1726:
--------------------------------

             Summary: Wrong hashCode() and equals() method in ChunkMetadata
                 Key: IOTDB-1726
                 URL: https://issues.apache.org/jira/browse/IOTDB-1726
             Project: Apache IoTDB
          Issue Type: Bug
          Components: Core/Engine
            Reporter: Yuan Tian


{code:java}
@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  ChunkMetadata that = (ChunkMetadata) o;
  return offsetOfChunkHeader == that.offsetOfChunkHeader
      && version == that.version
      && Objects.equals(measurementUid, that.measurementUid)
      && tsDataType == that.tsDataType
      && Objects.equals(deleteIntervalList, that.deleteIntervalList)
      && Objects.equals(statistics, that.statistics);
}

@Override
public int hashCode() {
  return Objects.hash(
      measurementUid, deleteIntervalList, tsDataType, statistics, version, offsetOfChunkHeader);
}
{code}
We can see that chunkmetadata use version to  differentiate, however, in different storage groups, different file's version may be same. That means root.sg1.d1.s1 and root.sg2.d1.s1 may share the same cache entry in ChunkCache



--
This message was sent by Atlassian Jira
(v8.3.4#803005)