public abstract class com.google.common.util.concurrent.RateLimiter
minor version: 0
major version: 59
flags: flags: (0x0421) ACC_PUBLIC, ACC_SUPER, ACC_ABSTRACT
this_class: com.google.common.util.concurrent.RateLimiter
super_class: java.lang.Object
{
private final com.google.common.util.concurrent.RateLimiter$SleepingStopwatch stopwatch;
descriptor: Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private volatile java.lang.Object mutexDoNotUseDirectly;
descriptor: Ljava/lang/Object;
flags: (0x0042) ACC_PRIVATE, ACC_VOLATILE
RuntimeVisibleTypeAnnotations:
FIELD
org.checkerframework.checker.nullness.qual.MonotonicNonNull()
public static com.google.common.util.concurrent.RateLimiter create(double);
descriptor: (D)Lcom/google/common/util/concurrent/RateLimiter;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=2, args_size=1
start local 0 0: dload 0
invokestatic com.google.common.util.concurrent.RateLimiter$SleepingStopwatch.createFromSystemTimer:()Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;
invokestatic com.google.common.util.concurrent.RateLimiter.create:(DLcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;)Lcom/google/common/util/concurrent/RateLimiter;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 permitsPerSecond D
MethodParameters:
Name Flags
permitsPerSecond
static com.google.common.util.concurrent.RateLimiter create(double, com.google.common.util.concurrent.RateLimiter$SleepingStopwatch);
descriptor: (DLcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;)Lcom/google/common/util/concurrent/RateLimiter;
flags: (0x0008) ACC_STATIC
Code:
stack=5, locals=4, args_size=2
start local 0 start local 2 0: new com.google.common.util.concurrent.SmoothRateLimiter$SmoothBursty
dup
aload 2
dconst_1
invokespecial com.google.common.util.concurrent.SmoothRateLimiter$SmoothBursty.<init>:(Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;D)V
astore 3
start local 3 1: aload 3
dload 0
invokevirtual com.google.common.util.concurrent.RateLimiter.setRate:(D)V
2: aload 3
areturn
end local 3 end local 2 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 permitsPerSecond D
0 3 2 stopwatch Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;
1 3 3 rateLimiter Lcom/google/common/util/concurrent/RateLimiter;
RuntimeInvisibleAnnotations:
com.google.common.annotations.VisibleForTesting()
RuntimeInvisibleTypeAnnotations:
METHOD_RETURN
com.google.common.annotations.VisibleForTesting()
MethodParameters:
Name Flags
permitsPerSecond
stopwatch
public static com.google.common.util.concurrent.RateLimiter create(double, long, java.util.concurrent.TimeUnit);
descriptor: (DJLjava/util/concurrent/TimeUnit;)Lcom/google/common/util/concurrent/RateLimiter;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=8, locals=5, args_size=3
start local 0 start local 2 start local 4 0: lload 2
lconst_0
lcmp
iflt 1
iconst_1
goto 2
StackMap locals:
StackMap stack:
1: iconst_0
StackMap locals:
StackMap stack: int
2: ldc "warmupPeriod must not be negative: %s"
lload 2
invokestatic com.google.common.base.Preconditions.checkArgument:(ZLjava/lang/String;J)V
3: dload 0
lload 2
aload 4
ldc 3.0
invokestatic com.google.common.util.concurrent.RateLimiter$SleepingStopwatch.createFromSystemTimer:()Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;
4: invokestatic com.google.common.util.concurrent.RateLimiter.create:(DJLjava/util/concurrent/TimeUnit;DLcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;)Lcom/google/common/util/concurrent/RateLimiter;
areturn
end local 4 end local 2 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 permitsPerSecond D
0 5 2 warmupPeriod J
0 5 4 unit Ljava/util/concurrent/TimeUnit;
MethodParameters:
Name Flags
permitsPerSecond
warmupPeriod
unit
static com.google.common.util.concurrent.RateLimiter create(double, long, java.util.concurrent.TimeUnit, double, com.google.common.util.concurrent.RateLimiter$SleepingStopwatch);
descriptor: (DJLjava/util/concurrent/TimeUnit;DLcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;)Lcom/google/common/util/concurrent/RateLimiter;
flags: (0x0008) ACC_STATIC
Code:
stack=8, locals=9, args_size=5
start local 0 start local 2 start local 4 start local 5 start local 7 0: new com.google.common.util.concurrent.SmoothRateLimiter$SmoothWarmingUp
dup
aload 7
lload 2
aload 4
dload 5
invokespecial com.google.common.util.concurrent.SmoothRateLimiter$SmoothWarmingUp.<init>:(Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;JLjava/util/concurrent/TimeUnit;D)V
astore 8
start local 8 1: aload 8
dload 0
invokevirtual com.google.common.util.concurrent.RateLimiter.setRate:(D)V
2: aload 8
areturn
end local 8 end local 7 end local 5 end local 4 end local 2 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 permitsPerSecond D
0 3 2 warmupPeriod J
0 3 4 unit Ljava/util/concurrent/TimeUnit;
0 3 5 coldFactor D
0 3 7 stopwatch Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;
1 3 8 rateLimiter Lcom/google/common/util/concurrent/RateLimiter;
RuntimeInvisibleAnnotations:
com.google.common.annotations.VisibleForTesting()
RuntimeInvisibleTypeAnnotations:
METHOD_RETURN
com.google.common.annotations.VisibleForTesting()
MethodParameters:
Name Flags
permitsPerSecond
warmupPeriod
unit
coldFactor
stopwatch
private java.lang.Object mutex();
descriptor: ()Ljava/lang/Object;
flags: (0x0002) ACC_PRIVATE
Code:
stack=3, locals=3, args_size=1
start local 0 0: aload 0
getfield com.google.common.util.concurrent.RateLimiter.mutexDoNotUseDirectly:Ljava/lang/Object;
astore 1
start local 1 1: aload 1
ifnonnull 10
2: aload 0
dup
astore 2
monitorenter
3: aload 0
getfield com.google.common.util.concurrent.RateLimiter.mutexDoNotUseDirectly:Ljava/lang/Object;
astore 1
4: aload 1
ifnonnull 6
5: aload 0
new java.lang.Object
dup
invokespecial java.lang.Object.<init>:()V
dup
astore 1
putfield com.google.common.util.concurrent.RateLimiter.mutexDoNotUseDirectly:Ljava/lang/Object;
6: StackMap locals: java.lang.Object com.google.common.util.concurrent.RateLimiter
StackMap stack:
aload 2
monitorexit
7: goto 10
StackMap locals:
StackMap stack: java.lang.Throwable
8: aload 2
monitorexit
9: athrow
10: StackMap locals:
StackMap stack:
aload 1
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 11 0 this Lcom/google/common/util/concurrent/RateLimiter;
1 11 1 mutex Ljava/lang/Object;
Exception table:
from to target type
3 7 8 any
8 9 8 any
void <init>(com.google.common.util.concurrent.RateLimiter$SleepingStopwatch);
descriptor: (Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;)V
flags: (0x0000)
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
aload 1
invokestatic com.google.common.base.Preconditions.checkNotNull:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast com.google.common.util.concurrent.RateLimiter$SleepingStopwatch
putfield com.google.common.util.concurrent.RateLimiter.stopwatch:Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;
2: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lcom/google/common/util/concurrent/RateLimiter;
0 3 1 stopwatch Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;
MethodParameters:
Name Flags
stopwatch
public final void setRate(double);
descriptor: (D)V
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Code:
stack=5, locals=4, args_size=2
start local 0 start local 1 0: dload 1
dconst_0
dcmpl
ifle 1
dload 1
invokestatic java.lang.Double.isNaN:(D)Z
ifne 1
iconst_1
goto 2
StackMap locals:
StackMap stack:
1: iconst_0
StackMap locals:
StackMap stack: int
2: ldc "rate must be positive"
3: invokestatic com.google.common.base.Preconditions.checkArgument:(ZLjava/lang/Object;)V
4: aload 0
invokevirtual com.google.common.util.concurrent.RateLimiter.mutex:()Ljava/lang/Object;
dup
astore 3
monitorenter
5: aload 0
dload 1
aload 0
getfield com.google.common.util.concurrent.RateLimiter.stopwatch:Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;
invokevirtual com.google.common.util.concurrent.RateLimiter$SleepingStopwatch.readMicros:()J
invokevirtual com.google.common.util.concurrent.RateLimiter.doSetRate:(DJ)V
6: aload 3
monitorexit
7: goto 10
StackMap locals: com.google.common.util.concurrent.RateLimiter double java.lang.Object
StackMap stack: java.lang.Throwable
8: aload 3
monitorexit
9: athrow
10: StackMap locals:
StackMap stack:
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 11 0 this Lcom/google/common/util/concurrent/RateLimiter;
0 11 1 permitsPerSecond D
Exception table:
from to target type
5 7 8 any
8 9 8 any
MethodParameters:
Name Flags
permitsPerSecond
abstract void doSetRate(double, long);
descriptor: (DJ)V
flags: (0x0400) ACC_ABSTRACT
MethodParameters:
Name Flags
permitsPerSecond
nowMicros
public final double getRate();
descriptor: ()D
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
Code:
stack=3, locals=2, args_size=1
start local 0 0: aload 0
invokevirtual com.google.common.util.concurrent.RateLimiter.mutex:()Ljava/lang/Object;
dup
astore 1
monitorenter
1: aload 0
invokevirtual com.google.common.util.concurrent.RateLimiter.doGetRate:()D
aload 1
monitorexit
2: dreturn
3: StackMap locals: com.google.common.util.concurrent.RateLimiter java.lang.Object
StackMap stack: java.lang.Throwable
aload 1
monitorexit
4: athrow
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lcom/google/common/util/concurrent/RateLimiter;
Exception table:
from to target type
1 2 3 any
3 4 3 any
abstract double doGetRate();
descriptor: ()D
flags: (0x0400) ACC_ABSTRACT
public double acquire();
descriptor: ()D
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
iconst_1
invokevirtual com.google.common.util.concurrent.RateLimiter.acquire:(I)D
dreturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/google/common/util/concurrent/RateLimiter;
RuntimeInvisibleAnnotations:
com.google.errorprone.annotations.CanIgnoreReturnValue()
public double acquire(int);
descriptor: (I)D
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=4, args_size=2
start local 0 start local 1 0: aload 0
iload 1
invokevirtual com.google.common.util.concurrent.RateLimiter.reserve:(I)J
lstore 2
start local 2 1: aload 0
getfield com.google.common.util.concurrent.RateLimiter.stopwatch:Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;
lload 2
invokevirtual com.google.common.util.concurrent.RateLimiter$SleepingStopwatch.sleepMicrosUninterruptibly:(J)V
2: dconst_1
lload 2
l2d
dmul
getstatic java.util.concurrent.TimeUnit.SECONDS:Ljava/util/concurrent/TimeUnit;
lconst_1
invokevirtual java.util.concurrent.TimeUnit.toMicros:(J)J
l2d
ddiv
dreturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lcom/google/common/util/concurrent/RateLimiter;
0 3 1 permits I
1 3 2 microsToWait J
RuntimeInvisibleAnnotations:
com.google.errorprone.annotations.CanIgnoreReturnValue()
MethodParameters:
Name Flags
permits
final long reserve(int);
descriptor: (I)J
flags: (0x0010) ACC_FINAL
Code:
stack=4, locals=3, args_size=2
start local 0 start local 1 0: iload 1
invokestatic com.google.common.util.concurrent.RateLimiter.checkPermits:(I)V
1: aload 0
invokevirtual com.google.common.util.concurrent.RateLimiter.mutex:()Ljava/lang/Object;
dup
astore 2
monitorenter
2: aload 0
iload 1
aload 0
getfield com.google.common.util.concurrent.RateLimiter.stopwatch:Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;
invokevirtual com.google.common.util.concurrent.RateLimiter$SleepingStopwatch.readMicros:()J
invokevirtual com.google.common.util.concurrent.RateLimiter.reserveAndGetWaitLength:(IJ)J
aload 2
monitorexit
3: lreturn
4: StackMap locals: com.google.common.util.concurrent.RateLimiter int java.lang.Object
StackMap stack: java.lang.Throwable
aload 2
monitorexit
5: athrow
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Lcom/google/common/util/concurrent/RateLimiter;
0 6 1 permits I
Exception table:
from to target type
2 3 4 any
4 5 4 any
MethodParameters:
Name Flags
permits
public boolean tryAcquire(long, java.util.concurrent.TimeUnit);
descriptor: (JLjava/util/concurrent/TimeUnit;)Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=4, args_size=3
start local 0 start local 1 start local 3 0: aload 0
iconst_1
lload 1
aload 3
invokevirtual com.google.common.util.concurrent.RateLimiter.tryAcquire:(IJLjava/util/concurrent/TimeUnit;)Z
ireturn
end local 3 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/google/common/util/concurrent/RateLimiter;
0 1 1 timeout J
0 1 3 unit Ljava/util/concurrent/TimeUnit;
MethodParameters:
Name Flags
timeout
unit
public boolean tryAcquire(int);
descriptor: (I)Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=2, args_size=2
start local 0 start local 1 0: aload 0
iload 1
lconst_0
getstatic java.util.concurrent.TimeUnit.MICROSECONDS:Ljava/util/concurrent/TimeUnit;
invokevirtual com.google.common.util.concurrent.RateLimiter.tryAcquire:(IJLjava/util/concurrent/TimeUnit;)Z
ireturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/google/common/util/concurrent/RateLimiter;
0 1 1 permits I
MethodParameters:
Name Flags
permits
public boolean tryAcquire();
descriptor: ()Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=1, args_size=1
start local 0 0: aload 0
iconst_1
lconst_0
getstatic java.util.concurrent.TimeUnit.MICROSECONDS:Ljava/util/concurrent/TimeUnit;
invokevirtual com.google.common.util.concurrent.RateLimiter.tryAcquire:(IJLjava/util/concurrent/TimeUnit;)Z
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/google/common/util/concurrent/RateLimiter;
public boolean tryAcquire(int, long, java.util.concurrent.TimeUnit);
descriptor: (IJLjava/util/concurrent/TimeUnit;)Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=12, args_size=4
start local 0 start local 1 start local 2 start local 4 0: aload 4
lload 2
invokevirtual java.util.concurrent.TimeUnit.toMicros:(J)J
lconst_0
invokestatic java.lang.Math.max:(JJ)J
lstore 5
start local 5 1: iload 1
invokestatic com.google.common.util.concurrent.RateLimiter.checkPermits:(I)V
2: aload 0
invokevirtual com.google.common.util.concurrent.RateLimiter.mutex:()Ljava/lang/Object;
dup
astore 9
monitorenter
3: aload 0
getfield com.google.common.util.concurrent.RateLimiter.stopwatch:Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;
invokevirtual com.google.common.util.concurrent.RateLimiter$SleepingStopwatch.readMicros:()J
lstore 10
start local 10 4: aload 0
lload 10
lload 5
invokevirtual com.google.common.util.concurrent.RateLimiter.canAcquire:(JJ)Z
ifne 7
5: aload 9
monitorexit
6: iconst_0
ireturn
7: StackMap locals: com.google.common.util.concurrent.RateLimiter int long java.util.concurrent.TimeUnit long top top java.lang.Object long
StackMap stack:
aload 0
iload 1
lload 10
invokevirtual com.google.common.util.concurrent.RateLimiter.reserveAndGetWaitLength:(IJ)J
lstore 7
end local 10 start local 7 8: aload 9
monitorexit
9: goto 12
end local 7 StackMap locals: com.google.common.util.concurrent.RateLimiter int long java.util.concurrent.TimeUnit long top top java.lang.Object
StackMap stack: java.lang.Throwable
10: aload 9
monitorexit
11: athrow
start local 7 12: StackMap locals: com.google.common.util.concurrent.RateLimiter int long java.util.concurrent.TimeUnit long long
StackMap stack:
aload 0
getfield com.google.common.util.concurrent.RateLimiter.stopwatch:Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;
lload 7
invokevirtual com.google.common.util.concurrent.RateLimiter$SleepingStopwatch.sleepMicrosUninterruptibly:(J)V
13: iconst_1
ireturn
end local 7 end local 5 end local 4 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 14 0 this Lcom/google/common/util/concurrent/RateLimiter;
0 14 1 permits I
0 14 2 timeout J
0 14 4 unit Ljava/util/concurrent/TimeUnit;
1 14 5 timeoutMicros J
8 10 7 microsToWait J
12 14 7 microsToWait J
4 8 10 nowMicros J
Exception table:
from to target type
3 6 10 any
7 9 10 any
10 11 10 any
MethodParameters:
Name Flags
permits
timeout
unit
private boolean canAcquire(long, long);
descriptor: (JJ)Z
flags: (0x0002) ACC_PRIVATE
Code:
stack=4, locals=5, args_size=3
start local 0 start local 1 start local 3 0: aload 0
lload 1
invokevirtual com.google.common.util.concurrent.RateLimiter.queryEarliestAvailable:(J)J
lload 3
lsub
lload 1
lcmp
ifgt 1
iconst_1
ireturn
StackMap locals:
StackMap stack:
1: iconst_0
ireturn
end local 3 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lcom/google/common/util/concurrent/RateLimiter;
0 2 1 nowMicros J
0 2 3 timeoutMicros J
MethodParameters:
Name Flags
nowMicros
timeoutMicros
final long reserveAndGetWaitLength(int, long);
descriptor: (IJ)J
flags: (0x0010) ACC_FINAL
Code:
stack=4, locals=6, args_size=3
start local 0 start local 1 start local 2 0: aload 0
iload 1
lload 2
invokevirtual com.google.common.util.concurrent.RateLimiter.reserveEarliestAvailable:(IJ)J
lstore 4
start local 4 1: lload 4
lload 2
lsub
lconst_0
invokestatic java.lang.Math.max:(JJ)J
lreturn
end local 4 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lcom/google/common/util/concurrent/RateLimiter;
0 2 1 permits I
0 2 2 nowMicros J
1 2 4 momentAvailable J
MethodParameters:
Name Flags
permits
nowMicros
abstract long queryEarliestAvailable(long);
descriptor: (J)J
flags: (0x0400) ACC_ABSTRACT
MethodParameters:
Name Flags
nowMicros
abstract long reserveEarliestAvailable(int, long);
descriptor: (IJ)J
flags: (0x0400) ACC_ABSTRACT
MethodParameters:
Name Flags
permits
nowMicros
public java.lang.String toString();
descriptor: ()Ljava/lang/String;
flags: (0x0001) ACC_PUBLIC
Code:
stack=7, locals=1, args_size=1
start local 0 0: getstatic java.util.Locale.ROOT:Ljava/util/Locale;
ldc "RateLimiter[stableRate=%3.1fqps]"
iconst_1
anewarray java.lang.Object
dup
iconst_0
aload 0
invokevirtual com.google.common.util.concurrent.RateLimiter.getRate:()D
invokestatic java.lang.Double.valueOf:(D)Ljava/lang/Double;
aastore
invokestatic java.lang.String.format:(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/google/common/util/concurrent/RateLimiter;
private static void checkPermits(int);
descriptor: (I)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: iload 0
ifle 1
iconst_1
goto 2
StackMap locals:
StackMap stack:
1: iconst_0
StackMap locals:
StackMap stack: int
2: ldc "Requested permits (%s) must be positive"
iload 0
invokestatic com.google.common.base.Preconditions.checkArgument:(ZLjava/lang/String;I)V
3: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 permits I
MethodParameters:
Name Flags
permits
}
SourceFile: "RateLimiter.java"
NestMembers:
com.google.common.util.concurrent.RateLimiter$SleepingStopwatch com.google.common.util.concurrent.RateLimiter$SleepingStopwatch$1
InnerClasses:
abstract SleepingStopwatch = com.google.common.util.concurrent.RateLimiter$SleepingStopwatch of com.google.common.util.concurrent.RateLimiter
final SmoothBursty = com.google.common.util.concurrent.SmoothRateLimiter$SmoothBursty of com.google.common.util.concurrent.SmoothRateLimiter
final SmoothWarmingUp = com.google.common.util.concurrent.SmoothRateLimiter$SmoothWarmingUp of com.google.common.util.concurrent.SmoothRateLimiter
RuntimeInvisibleAnnotations:
com.google.common.annotations.Beta()
com.google.common.annotations.GwtIncompatible()