You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/04/19 03:09:55 UTC
[GitHub] [iotdb] xinzhongtianxia commented on a diff in pull request #5581: [IOTDB-2803][new cluster][mpp] refine show plan node ser/deserialize
xinzhongtianxia commented on code in PR #5581:
URL: https://github.com/apache/iotdb/pull/5581#discussion_r852556708
##########
server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/metedata/read/DevicesSchemaScanNode.java:
##########
@@ -66,22 +62,8 @@ public PlanNode clone() {
}
@Override
- public int allowedChildCount() {
- return NO_CHILD_ALLOWED;
- }
-
- @Override
- public List<String> getOutputColumnNames() {
- if (hasSgCol) {
- return Arrays.asList(COLUMN_DEVICES, COLUMN_STORAGE_GROUP, COLUMN_IS_ALIGNED);
- }
- return Arrays.asList(COLUMN_DEVICES, COLUMN_IS_ALIGNED);
- }
-
- @Override
- public void serialize(ByteBuffer byteBuffer) {
+ protected void serializeAttributes(ByteBuffer byteBuffer) {
PlanNodeType.DEVICES_SCHEMA_SCAN.serialize(byteBuffer);
- ReadWriteIOUtils.write(getPlanNodeId().getId(), byteBuffer);
ReadWriteIOUtils.write(path.getFullPath(), byteBuffer);
ReadWriteIOUtils.write(limit, byteBuffer);
ReadWriteIOUtils.write(offset, byteBuffer);
Review Comment:
1. If the parent class maintains the serialization work of its own attributes, then it should also take over the deserialization work so that sub-classes need no care about the ser and deser order of attributes in parent class.
If so, when doing deserialization, the parent should return an instance contains all deserialized attributes, but the parent is an `abstract` class, we cannot just simply use `new xxx`.
2. If some sub-classes do not want to serialize all attributes in parent, it will always need to implements its own serialize function as needed.
--
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