szetszwo commented on code in PR #6651:
URL: https://github.com/apache/ozone/pull/6651#discussion_r1593081961
##########
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:
Remove this unused method.
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/server/JsonUtils.java:
##########
@@ -103,14 +102,15 @@ public static JsonNode readTree(String content) throws
IOException {
return MAPPER.readTree(content);
}
- public static List<HashMap<String, Object>> readTreeAsListOfMaps(String json)
+ /**
+ * Reads JSON content from a Reader and deserializes it into an array of the
+ * specified type.
+ */
+ public static <T> T[] readArrayFromReader(Reader reader, Class<T[]>
valueType)
throws IOException {
- return MAPPER.readValue(json,
- new TypeReference<List<HashMap<String, Object>>>() {
- });
+ return MAPPER.readValue(reader, valueType);
}
Review Comment:
Don't be specific to array, i.e.
```java
/**
* Reads JSON content from a Reader and deserializes it the specified type.
*/
public static <T> T readFromReader(Reader reader, Class<T> valueType)
throws IOException {
return MAPPER.readValue(reader, valueType);
}
```
--
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]