Re: [PR] SLING-12204: ResourceResolver: refactor PagedQueryIterator for re-use [sling-org-apache-sling-resourceresolver]

2023-12-20 Thread via GitHub


reschke merged PR #108:
URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/108


-- 
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: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] SLING-12204: ResourceResolver: refactor PagedQueryIterator for re-use [sling-org-apache-sling-resourceresolver]

2023-12-20 Thread via GitHub


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


##
src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java:
##
@@ -1288,50 +1288,66 @@ private Iterator queryAllVanityPaths(String 
query) {
 return it;
 }
 
+/**
+ * Utility class for running paged queries.
+ */
 private class PagedQueryIterator implements Iterator {
 
 private ResourceResolver resolver;
+private String subject;
+private String propertyName;
 private String query;
-private String lastPath = "";
+private String lastValue = "";
 private Iterator it;
 private int count = 0;
 private int page = 0;
-private int pageSize = Integer.getInteger("sling.vanityPath.pageSize", 
2000);
+private int pageSize;
 private Resource next = null;
+private String[] defaultValue = new String[0];
 
-public PagedQueryIterator(ResourceResolver resolver, String query) {
+/**
+ * @param subject name of the query

Review Comment:
   ```suggestion
* @param subject name of the query, will be used only for logging
   ```



-- 
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: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] SLING-12204: ResourceResolver: refactor PagedQueryIterator for re-use [sling-org-apache-sling-resourceresolver]

2023-12-20 Thread via GitHub


sonarcloud[bot] commented on PR #108:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/108#issuecomment-1864650057

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-resourceresolver=108)
 **Quality Gate passed**  
   Kudos, no new issues were introduced!
   
   [0 New 
issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=108=false=true)
  
   [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-resourceresolver=108=false=true)
  
   [82.1% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=108=new_coverage=list)
  
   [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=108=new_duplicated_lines_density=list)
  
 
   [See analysis details on 
SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-resourceresolver=108)
   
   


-- 
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: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] SLING-12204: ResourceResolver: refactor PagedQueryIterator for re-use [sling-org-apache-sling-resourceresolver]

2023-12-20 Thread via GitHub


sonarcloud[bot] commented on PR #108:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/108#issuecomment-1864623081

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-resourceresolver=108)
 **Quality Gate passed**  
   Kudos, no new issues were introduced!
   
   [0 New 
issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=108=false=true)
  
   [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-resourceresolver=108=false=true)
  
   [82.1% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=108=new_coverage=list)
  
   [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=108=new_duplicated_lines_density=list)
  
 
   [See analysis details on 
SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-resourceresolver=108)
   
   


-- 
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: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] SLING-12204: ResourceResolver: refactor PagedQueryIterator for re-use [sling-org-apache-sling-resourceresolver]

2023-12-20 Thread via GitHub


reschke commented on code in PR #108:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/108#discussion_r1432823196


##
src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java:
##
@@ -1288,50 +1288,60 @@ private Iterator queryAllVanityPaths(String 
query) {
 return it;
 }
 
+/**
+ * Utility class for running paged queries.
+ */
 private class PagedQueryIterator implements Iterator {

Review Comment:
   Maybe once we need it outside MapEntries. Wanted to miminize the diff for 
now.



-- 
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: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] SLING-12204: ResourceResolver: refactor PagedQueryIterator for re-use [sling-org-apache-sling-resourceresolver]

2023-12-20 Thread via GitHub


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


##
src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java:
##
@@ -1288,50 +1288,60 @@ private Iterator queryAllVanityPaths(String 
query) {
 return it;
 }
 
+/**
+ * Utility class for running paged queries.
+ */
 private class PagedQueryIterator implements Iterator {
 
 private ResourceResolver resolver;
+private String name;
+private String propertyName;
 private String query;
-private String lastPath = "";
+private String lastValue = "";
 private Iterator it;
 private int count = 0;
 private int page = 0;
-private int pageSize = Integer.getInteger("sling.vanityPath.pageSize", 
2000);
+private int pageSize;
 private Resource next = null;
+private String[] defaultValue = new String[0];
 
-public PagedQueryIterator(ResourceResolver resolver, String query) {
+public PagedQueryIterator(String name, String propertyName, 
ResourceResolver resolver, String query, int pageSize) {

Review Comment:
   ```name``` is quite generic. If we don't come up with a better name :-) we 
should at least document its purpose here.



##
src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java:
##
@@ -1288,50 +1288,60 @@ private Iterator queryAllVanityPaths(String 
query) {
 return it;
 }
 
+/**
+ * Utility class for running paged queries.
+ */
 private class PagedQueryIterator implements Iterator {

Review Comment:
   would it make sense to make it a full class now (instead of an inner class)? 



-- 
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: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] SLING-12204: ResourceResolver: refactor PagedQueryIterator for re-use [sling-org-apache-sling-resourceresolver]

2023-12-20 Thread via GitHub


sonarcloud[bot] commented on PR #108:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/108#issuecomment-1864598484

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-resourceresolver=108)
 **Quality Gate passed**  
   The SonarCloud Quality Gate passed, but some issues were introduced.
   
   [1 New 
issue](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=108=false=true)
  
   [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-resourceresolver=108=false=true)
  
   [85.2% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=108=new_coverage=list)
  
   [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=108=new_duplicated_lines_density=list)
  
 
   [See analysis details on 
SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-resourceresolver=108)
   
   


-- 
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: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] SLING-12204: ResourceResolver: refactor PagedQueryIterator for re-use [sling-org-apache-sling-resourceresolver]

2023-12-20 Thread via GitHub


reschke opened a new pull request, #108:
URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/108

   (no comment)


-- 
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: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org