adoroszlai commented on code in PR #6651:
URL: https://github.com/apache/ozone/pull/6651#discussion_r1593827750
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/scm/container/common/helpers/DeletedBlocksTransactionInfoWrapper.java:
##########
@@ -39,6 +39,13 @@ public DeletedBlocksTransactionInfoWrapper(long txID, long
containerID,
this.count = count;
}
+ DeletedBlocksTransactionInfoWrapper() {
Review Comment:
The no-args constructor can be avoided by using Jackson annotations:
```
@JsonCreator
public DeletedBlocksTransactionInfoWrapper(
@JsonProperty("txID") long txID,
@JsonProperty("containerID") long containerID,
@JsonProperty("localIdList") List<Long> localIdList,
@JsonProperty("count") int count
```
The one with annotations might be faster at runtime, as properties can be
set without reflection. It also allows JSON property names to be kept constant
even if member variable is renamed for some reason.
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/scm/container/common/helpers/DeletedBlocksTransactionInfoWrapper.java:
##########
@@ -39,6 +39,13 @@ public DeletedBlocksTransactionInfoWrapper(long txID, long
containerID,
this.count = count;
}
+ DeletedBlocksTransactionInfoWrapper() {
Review Comment:
The no-args constructor can be avoided by using Jackson annotations:
```java
@JsonCreator
public DeletedBlocksTransactionInfoWrapper(
@JsonProperty("txID") long txID,
@JsonProperty("containerID") long containerID,
@JsonProperty("localIdList") List<Long> localIdList,
@JsonProperty("count") int count
```
The one with annotations might be faster at runtime, as properties can be
set without reflection. It also allows JSON property names to be kept constant
even if member variable is renamed for some reason.
--
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]