You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/03/10 22:49:34 UTC

[GitHub] [lucene] vigyasharma commented on a change in pull request #738: LUCENE-10448: Avoid instant rate write bursts by writing bytes buffer in chunks

vigyasharma commented on a change in pull request #738:
URL: https://github.com/apache/lucene/pull/738#discussion_r824239962



##########
File path: lucene/core/src/java/org/apache/lucene/store/RateLimitedIndexOutput.java
##########
@@ -68,9 +68,14 @@ public void writeByte(byte b) throws IOException {
 
   @Override
   public void writeBytes(byte[] b, int offset, int length) throws IOException {
-    bytesSinceLastPause += length;
-    checkRate();
-    delegate.writeBytes(b, offset, length);
+    while (length > 0) {
+      int chunk = (int) Math.min(currentMinPauseCheckBytes + 1, length);

Review comment:
       I added an assert for this, along with some more tests.




-- 
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: issues-unsubscribe@lucene.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org