add comment for no pauses in writeBytes (#1014)

This commit is contained in:
Vigya Sharma 2022-07-11 02:12:00 -07:00 committed by GitHub
parent dd4e8b82d7
commit c06b98262c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -70,6 +70,10 @@ public final class RateLimitedIndexOutput extends IndexOutput {
public void writeBytes(byte[] b, int offset, int length) throws IOException {
bytesSinceLastPause += length;
checkRate();
// The bytes array slice is written without pauses.
// This can cause instant write rate to breach rate limit if there have
// been no writes for enough time to keep the average write rate within limit.
// See https://issues.apache.org/jira/browse/LUCENE-10448
delegate.writeBytes(b, offset, length);
}