diff options
author | Ryan LeCompte <lecompte@gmail.com> | 2013-01-12 09:57:29 -0800 |
---|---|---|
committer | Ryan LeCompte <lecompte@gmail.com> | 2013-01-12 09:57:29 -0800 |
commit | addff2c466d4b76043e612d4d28ab9de7f003298 (patch) | |
tree | 28c7abbd44490bfcdae12eed4b5ea472c2947d04 /core | |
parent | ea20ae661888d871f70d5ed322cfe924c5a31dba (diff) | |
download | spark-addff2c466d4b76043e612d4d28ab9de7f003298.tar.gz spark-addff2c466d4b76043e612d4d28ab9de7f003298.tar.bz2 spark-addff2c466d4b76043e612d4d28ab9de7f003298.zip |
add comment
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/spark/util/RateLimitedOutputStream.scala | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/src/main/scala/spark/util/RateLimitedOutputStream.scala b/core/src/main/scala/spark/util/RateLimitedOutputStream.scala index 16db7549b2..ed3d2b66bb 100644 --- a/core/src/main/scala/spark/util/RateLimitedOutputStream.scala +++ b/core/src/main/scala/spark/util/RateLimitedOutputStream.scala @@ -44,6 +44,7 @@ class RateLimitedOutputStream(out: OutputStream, bytesPerSec: Int) extends Outpu return } else { // Calculate how much time we should sleep to bring ourselves to the desired rate. + // Based on throttler in Kafka (https://github.com/kafka-dev/kafka/blob/master/core/src/main/scala/kafka/utils/Throttler.scala) val sleepTime = MILLISECONDS.convert((bytesWrittenSinceSync / bytesPerSec - elapsedSecs), SECONDS) if (sleepTime > 0) Thread.sleep(sleepTime) } |