sarvekshayr commented on code in PR #7181:
URL: https://github.com/apache/ozone/pull/7181#discussion_r1760950755
##########
hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/container/ListSubcommand.java:
##########
@@ -105,12 +119,39 @@ public void execute(ScmClient scmClient) throws
IOException {
ReplicationType.fromProto(type),
replication, new OzoneConfiguration());
}
- List<ContainerInfo> containerList =
- scmClient.listContainer(startId, count, state, type, repConfig);
+
+ int maxCountAllowed = parent.getParent().getOzoneConf()
+ .getInt(ScmConfigKeys.HDDS_CONTAINER_LIST_MAX_COUNT,
+ ScmConfigKeys.HDDS_CONTAINER_LIST_MAX_COUNT_DEFAULT);
+ if (all) {
+ System.out.printf("Attempting to list all containers." +
+ " The total number of container might exceed" +
+ " the cluster's current limit of %s. The results will be capped at
the" +
+ " maximum allowed count.%n",
ScmConfigKeys.HDDS_CONTAINER_LIST_MAX_COUNT_DEFAULT);
Review Comment:
Yes, since these messages warn the user that not all data is being shown due
to a restriction; it should be printed to `System.err`.
--
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]