@@ -61,10 +61,10 @@ object UnboundedControllerMutationQuota extends ControllerMutationQuota {
61
61
*/
62
62
abstract class AbstractControllerMutationQuota (private val time : Time ) extends ControllerMutationQuota {
63
63
protected var lastThrottleTimeMs = 0L
64
- protected var lastRecordedTimeMs = 0L
64
+ private var lastRecordedTimeMs = 0L
65
65
66
66
protected def updateThrottleTime (e : QuotaViolationException , timeMs : Long ): Unit = {
67
- lastThrottleTimeMs = ControllerMutationQuotaManager .throttleTimeMs(e, timeMs )
67
+ lastThrottleTimeMs = ControllerMutationQuotaManager .throttleTimeMs(e)
68
68
lastRecordedTimeMs = timeMs
69
69
}
70
70
@@ -142,7 +142,7 @@ object ControllerMutationQuotaManager {
142
142
* Basically, if a value < 0 is observed, the time required to bring it to zero is
143
143
* -value / refill rate (quota bound) * 1000.
144
144
*/
145
- def throttleTimeMs (e : QuotaViolationException , timeMs : Long ): Long = {
145
+ def throttleTimeMs (e : QuotaViolationException ): Long = {
146
146
e.metric().measurable() match {
147
147
case _ : TokenBucket =>
148
148
Math .round(- e.value() / e.bound() * 1000 )
@@ -216,7 +216,7 @@ class ControllerMutationQuotaManager(private val config: ClientQuotaManagerConfi
216
216
0
217
217
} catch {
218
218
case e : QuotaViolationException =>
219
- val throttleTimeMs = ControllerMutationQuotaManager .throttleTimeMs(e, timeMs ).toInt
219
+ val throttleTimeMs = ControllerMutationQuotaManager .throttleTimeMs(e).toInt
220
220
debug(s " Quota violated for sensor ( ${quotaSensor.name}). Delay time: ( $throttleTimeMs) " )
221
221
throttleTimeMs
222
222
}
0 commit comments