wzhallright commented on a change in pull request #2202:
URL: https://github.com/apache/ozone/pull/2202#discussion_r636724620
##########
File path:
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/HddsServerUtil.java
##########
@@ -325,6 +327,16 @@ public static int getScmRpcRetryCount(ConfigurationSource
conf) {
OZONE_SCM_HEARTBEAT_RPC_RETRY_COUNT_DEFAULT);
}
+ /**
+ * Get the max limit when get all available reports.
+ * @param conf
+ * @return max limit
+ */
+ public static int getReportMaxLimit(ConfigurationSource conf) {
+ return conf.getInt(HDDS_DATANODE_REPORT_MAX_LIMIT,
+ HDDS_DATANODE_REPORT_MAX_LIMIT_DEFAULT);
+ }
+
Review comment:
Thanks @adoroszlai for review.
`public List<GeneratedMessage> getReports(InetSocketAddress endpoint,
int maxLimit) {
if (maxLimit < 0) {
throw new IllegalArgumentException("Illegal maxLimit value: " +
maxLimit);
}
List<GeneratedMessage> reports = getNonIncrementalReports();
if (maxLimit <= reports.size()) {
return reports.subList(0, maxLimit);
} else {
reports.addAll(getIncrementalReports(endpoint,
maxLimit - reports.size()));
return reports;
}
}`
1) In this code, the max reports size of getNonIncrementalReports() return
is 3, if the maxLimit is Integer.MAX_VALUE, so `maxLimit < 0` and `maxLimit <=
reports.size()` is meaningless.
I think the maxLimit need to become configurable.
2)I will add it to ozone-default.xml instead of TestOzoneConfigurationFields.
3)Move getReportMaxLimit to StateContext.java.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]