
com.groupbyinc.flux.common.google.common.util.concurrent.RateLimiter.class Maven / Gradle / Ivy
???? 2 ? Dcom/groupbyinc/flux/common/google/common/util/concurrent/RateLimiter java/lang/Object RateLimiter.java (Ljavax/annotation/concurrent/ThreadSafe; ;Lcom/groupbyinc/flux/common/google/common/annotations/Beta; Vcom/groupbyinc/flux/common/google/common/util/concurrent/RateLimiter$SleepingStopwatch SleepingStopwatch Wcom/groupbyinc/flux/common/google/common/util/concurrent/SmoothRateLimiter$SmoothBursty Jcom/groupbyinc/flux/common/google/common/util/concurrent/SmoothRateLimiter
SmoothBursty Zcom/groupbyinc/flux/common/google/common/util/concurrent/SmoothRateLimiter$SmoothWarmingUp SmoothWarmingUp stopwatch XLcom/groupbyinc/flux/common/google/common/util/concurrent/RateLimiter$SleepingStopwatch; mutexDoNotUseDirectly Ljava/lang/Object; create I(D)Lcom/groupbyinc/flux/common/google/common/util/concurrent/RateLimiter; createFromSystemTimer Z()Lcom/groupbyinc/flux/common/google/common/util/concurrent/RateLimiter$SleepingStopwatch;
?(Lcom/groupbyinc/flux/common/google/common/util/concurrent/RateLimiter$SleepingStopwatch;D)Lcom/groupbyinc/flux/common/google/common/util/concurrent/RateLimiter;
permitsPerSecond D HLcom/groupbyinc/flux/common/google/common/annotations/VisibleForTesting; \(Lcom/groupbyinc/flux/common/google/common/util/concurrent/RateLimiter$SleepingStopwatch;D)V # $
% setRate (D)V ' (
) rateLimiter FLcom/groupbyinc/flux/common/google/common/util/concurrent/RateLimiter; i(DJLjava/util/concurrent/TimeUnit;)Lcom/groupbyinc/flux/common/google/common/util/concurrent/RateLimiter; %warmupPeriod must not be negative: %s . java/lang/Long 0 valueOf (J)Ljava/lang/Long; 2 3
1 4 ;com/groupbyinc/flux/common/google/common/base/Preconditions 6
checkArgument )(ZLjava/lang/String;[Ljava/lang/Object;)V 8 9
7 : ?(Lcom/groupbyinc/flux/common/google/common/util/concurrent/RateLimiter$SleepingStopwatch;DJLjava/util/concurrent/TimeUnit;)Lcom/groupbyinc/flux/common/google/common/util/concurrent/RateLimiter; <
= warmupPeriod J unit Ljava/util/concurrent/TimeUnit; {(Lcom/groupbyinc/flux/common/google/common/util/concurrent/RateLimiter$SleepingStopwatch;JLjava/util/concurrent/TimeUnit;)V # C
D mutex ()Ljava/lang/Object; H ()V # J
K java/lang/Throwable M this [(Lcom/groupbyinc/flux/common/google/common/util/concurrent/RateLimiter$SleepingStopwatch;)V checkNotNull &(Ljava/lang/Object;)Ljava/lang/Object; Q R
7 S U java/lang/Double W isNaN (D)Z Y Z
X [ rate must be positive ] (ZLjava/lang/Object;)V 8 _
7 ` F G
b
readMicros ()J d e
f doSetRate (DJ)V h i
j getRate ()D doGetRate n m
o acquire (I)D q r
s reserve (I)J u v
w sleepMicrosUninterruptibly (J)V y z
{ java/util/concurrent/TimeUnit } SECONDS B ~ ? toMicros (J)J ? ?
~ ? permits I microsToWait checkPermits (I)I ? ?
? reserveAndGetWaitLength (IJ)J ? ?
?
tryAcquire #(JLjava/util/concurrent/TimeUnit;)Z $(IJLjava/util/concurrent/TimeUnit;)Z ? ?
? timeout (I)Z MICROSECONDS ? B ~ ? ()Z java/lang/Math ? max (JJ)J ? ?
? ?
canAcquire (JJ)Z ? ?
? nowMicros
timeoutMicros queryEarliestAvailable ? ?
? reserveEarliestAvailable ? ?
? momentAvailable toString ()Ljava/lang/String; RateLimiter[stableRate=%3.1fqps] ? l m
? (D)Ljava/lang/Double; 2 ?
X ? java/lang/String ? format 9(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; ? ?
? ? 'Requested permits (%s) must be positive ? java/lang/Integer ? (I)Ljava/lang/Integer; 2 ?
? ? Code LocalVariableTable LineNumberTable RuntimeInvisibleAnnotations
StackMapTable
SourceFile InnerClasses! B ? 2 ? &? ? ? ! ? ? ? W ? Y*? &N-'? *-? ? !
+ , ? ?
? ? ? " - ? s & ?? ? /? Y ? 5S? ;? & ? >? ? &