gortiz commented on code in PR #13303:
URL: https://github.com/apache/pinot/pull/13303#discussion_r1738757553
##########
pinot-common/src/main/java/org/apache/pinot/common/datablock/MetadataBlock.java:
##########
@@ -147,41 +71,24 @@ public MetadataBlockType getType() {
* The returned list may contain nulls, which would mean that no stats were
available for that stage.
*/
@Nullable
- public List<ByteBuffer> getStatsByStage() {
+ @Override
+ public List<DataBuffer> getStatsByStage() {
return _statsByStage;
}
@Override
- public int getDataBlockVersionType() {
- return VERSION + (Type.METADATA.ordinal() <<
DataBlockUtils.VERSION_TYPE_SHIFT);
+ public Type getDataBlockType() {
+ return Type.METADATA;
}
@Override
protected int getOffsetInFixedBuffer(int rowId, int colId) {
- throw new UnsupportedOperationException("Metadata block uses JSON encoding
for field access");
- }
-
- @Override
- protected int positionOffsetInVariableBufferAndGetLength(int rowId, int
colId) {
- throw new UnsupportedOperationException("Metadata block uses JSON encoding
for field access");
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof MetadataBlock)) {
- return false;
- }
- MetadataBlock that = (MetadataBlock) o;
- return Objects.equals(_statsByStage, that._statsByStage)
- && _errCodeToExceptionMap.equals(that._errCodeToExceptionMap);
+ throw new UnsupportedOperationException("Not supported in metadata block");
}
@Override
- public int hashCode() {
- return Objects.hash(_statsByStage, _errCodeToExceptionMap);
Review Comment:
There was a discussion on whether DataBlocks should be compared with equal
or not. We ended up deciding that we should not (and instead we have
DataBlockEquals class that implements the same logic).
Given equals should not be used, we don't need to implement hashcode and we
can use the native one.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]