joerghoh commented on code in PR #119:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/119#discussion_r1682747044


##########
src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java:
##########
@@ -1389,6 +1419,16 @@ public Resource next() throws NoSuchElementException {
             next = null;
             return result;
         }
+
+        public String getStatistics() {
+            String result = String.format(" (max. page size: %d, number of 
pages: %d)", largestPage, page);
+            if (largestKeyCount > pageSize * 10) {
+                result += String.format(" - WARNING: largest number of aliases 
with the same 'first' selector exceeds expectations (value '%s' appears %d 
times)",

Review Comment:
   That should be a dedicated WARN message.



##########
src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java:
##########
@@ -1389,6 +1419,16 @@ public Resource next() throws NoSuchElementException {
             next = null;
             return result;
         }
+
+        public String getStatistics() {
+            String result = String.format(" (max. page size: %d, number of 
pages: %d)", largestPage, page);
+            if (largestKeyCount > pageSize * 10) {

Review Comment:
   I would convert ``pageSize * 10`` into a constant and define it at the 
classlevel. It can still be calculated based on the 2 magic numbers ``2000`` 
with which the ``PagedQueryIterator`` is constructed on (maybe convert them 
into constants as well).



-- 
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]

Reply via email to