You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by "cschneider (via GitHub)" <gi...@apache.org> on 2024/01/03 14:38:01 UTC
[PR] SLING-12218 - Limit queue size [sling-org-apache-sling-distribution-journal]
cschneider opened a new pull request, #132:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/132
(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: commits-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12218 - Limit queue size [sling-org-apache-sling-distribution-journal]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #132:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/132#issuecomment-1877044438
## [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132) **Quality Gate passed**
Kudos, no new issues were introduced!
[0 New issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132&resolved=false&inNewCodePeriod=true)
[0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132&resolved=false&inNewCodePeriod=true)
[85.7% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132&metric=new_coverage&view=list)
[0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132)
--
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: commits-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12218 - Limit queue size [sling-org-apache-sling-distribution-journal]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #132:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/132#issuecomment-1875540294
## [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132) **Quality Gate passed**
Kudos, no new issues were introduced!
[0 New issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132&resolved=false&inNewCodePeriod=true)
[0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132&resolved=false&inNewCodePeriod=true)
[90.9% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132&metric=new_coverage&view=list)
[0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132)
--
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: commits-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12218 - Limit queue size [sling-org-apache-sling-distribution-journal]
Posted by "danilobanjac (via GitHub)" <gi...@apache.org>.
danilobanjac commented on code in PR #132:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/132#discussion_r1441541665
##########
src/main/java/org/apache/sling/distribution/journal/queue/impl/PubQueueProviderImpl.java:
##########
@@ -201,6 +202,26 @@ public OffsetQueue<DistributionQueueItem> getOffsetQueue(String pubAgentName, lo
throw new RuntimeException(e);
}
}
+
+
+ public int getMaxQueueSize(String pubAgentName) {
+ Optional<Long> minOffset = getMinOffset(pubAgentName);
+ if (minOffset.isPresent()) {
+ return getOffsetQueue(pubAgentName, minOffset.get()).getMinOffsetQueue(minOffset.get()).getSize();
+ } else {
+ return 0;
+ }
Review Comment:
This is only if you want, optional has helper methods to perform basic conditional check.
##########
src/main/java/org/apache/sling/distribution/journal/queue/impl/PubQueueProviderImpl.java:
##########
@@ -201,6 +202,26 @@ public OffsetQueue<DistributionQueueItem> getOffsetQueue(String pubAgentName, lo
throw new RuntimeException(e);
}
}
+
+
+ public int getMaxQueueSize(String pubAgentName) {
+ Optional<Long> minOffset = getMinOffset(pubAgentName);
+ if (minOffset.isPresent()) {
+ return getOffsetQueue(pubAgentName, minOffset.get()).getMinOffsetQueue(minOffset.get()).getSize();
+ } else {
+ return 0;
+ }
Review Comment:
```suggestion
return minOffset.map(offset -> getOffsetQueue(pubAgentName, offset).getMinOffsetQueue(offset).getSize())
.orElse(0);
```
--
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: commits-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12218 - Limit queue size [sling-org-apache-sling-distribution-journal]
Posted by "cschneider (via GitHub)" <gi...@apache.org>.
cschneider commented on PR #132:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/132#issuecomment-1877109264
@danilobanjac I have added the logic to delay processing when we are near the queue size limit.
For now I implemented a very simple delay though.
--
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: commits-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12218 - Limit queue size [sling-org-apache-sling-distribution-journal]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #132:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/132#issuecomment-1877012546
## [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132) **Quality Gate failed**
Failed conditions
[70.6% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132&metric=new_coverage&view=list) (required ≥ 80%)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132)
--
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: commits-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12218 - Limit queue size [sling-org-apache-sling-distribution-journal]
Posted by "cschneider (via GitHub)" <gi...@apache.org>.
cschneider merged PR #132:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/132
--
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: commits-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-12218 - Limit queue size [sling-org-apache-sling-distribution-journal]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #132:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/132#issuecomment-1875486226
## [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132) **Quality Gate failed**
Failed conditions
[68.2% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132&metric=new_coverage&view=list) (required ≥ 80%)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-distribution-journal&pullRequest=132)
--
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: commits-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org