public class org.apache.dubbo.remoting.etcd.jetcd.RetryLoops extends java.lang.Object
{
private final long startTimeMs;
private boolean isDone;
private int retriedCount;
private org.apache.dubbo.common.logger.Logger logger;
public void <init>()
{
org.apache.dubbo.remoting.etcd.jetcd.RetryLoops v;
long v;
org.apache.dubbo.common.logger.Logger v;
v := @this: org.apache.dubbo.remoting.etcd.jetcd.RetryLoops;
specialinvoke v.<java.lang.Object: void <init>()>();
v = staticinvoke <java.lang.System: long currentTimeMillis()>();
v.<org.apache.dubbo.remoting.etcd.jetcd.RetryLoops: long startTimeMs> = v;
v.<org.apache.dubbo.remoting.etcd.jetcd.RetryLoops: boolean isDone> = 0;
v.<org.apache.dubbo.remoting.etcd.jetcd.RetryLoops: int retriedCount> = 0;
v = staticinvoke <org.apache.dubbo.common.logger.LoggerFactory: org.apache.dubbo.common.logger.Logger getLogger(java.lang.Class)>(class "Lorg/apache/dubbo/remoting/etcd/jetcd/RetryLoops;");
v.<org.apache.dubbo.remoting.etcd.jetcd.RetryLoops: org.apache.dubbo.common.logger.Logger logger> = v;
return;
}
public static java.lang.Object invokeWithRetry(java.util.concurrent.Callable, org.apache.dubbo.remoting.etcd.RetryPolicy) throws java.lang.Exception
{
org.apache.dubbo.remoting.etcd.jetcd.RetryLoops v;
java.lang.Object v;
java.util.concurrent.Callable v;
org.apache.dubbo.remoting.etcd.RetryPolicy v;
java.lang.Exception v;
boolean v;
v := @parameter: java.util.concurrent.Callable;
v := @parameter: org.apache.dubbo.remoting.etcd.RetryPolicy;
v = null;
v = new org.apache.dubbo.remoting.etcd.jetcd.RetryLoops;
specialinvoke v.<org.apache.dubbo.remoting.etcd.jetcd.RetryLoops: void <init>()>();
label:
v = virtualinvoke v.<org.apache.dubbo.remoting.etcd.jetcd.RetryLoops: boolean shouldContinue()>();
if v == 0 goto label;
label:
v = interfaceinvoke v.<java.util.concurrent.Callable: java.lang.Object call()>();
virtualinvoke v.<org.apache.dubbo.remoting.etcd.jetcd.RetryLoops: void complete()>();
label:
goto label;
label:
v := @caughtexception;
virtualinvoke v.<org.apache.dubbo.remoting.etcd.jetcd.RetryLoops: void fireException(java.lang.Exception,org.apache.dubbo.remoting.etcd.RetryPolicy)>(v, v);
goto label;
label:
return v;
catch java.lang.Exception from label to label with label;
}
public void fireException(java.lang.Exception, org.apache.dubbo.remoting.etcd.RetryPolicy) throws java.lang.Exception
{
org.apache.dubbo.remoting.etcd.jetcd.RetryLoops v;
long v, v, v;
java.lang.Exception v;
java.lang.Thread v;
int v, v;
org.apache.dubbo.remoting.etcd.RetryPolicy v;
boolean v, v, v, v;
v := @this: org.apache.dubbo.remoting.etcd.jetcd.RetryLoops;
v := @parameter: java.lang.Exception;
v := @parameter: org.apache.dubbo.remoting.etcd.RetryPolicy;
v = v instanceof java.lang.InterruptedException;
if v == 0 goto label;
v = staticinvoke <java.lang.Thread: java.lang.Thread currentThread()>();
virtualinvoke v.<java.lang.Thread: void interrupt()>();
label:
v = 1;
v = specialinvoke v.<org.apache.dubbo.remoting.etcd.jetcd.RetryLoops: boolean isRetryException(java.lang.Throwable)>(v);
if v == 0 goto label;
v = v.<org.apache.dubbo.remoting.etcd.jetcd.RetryLoops: int retriedCount>;
v = v + 1;
v.<org.apache.dubbo.remoting.etcd.jetcd.RetryLoops: int retriedCount> = v;
v = staticinvoke <java.lang.System: long currentTimeMillis()>();
v = v.<org.apache.dubbo.remoting.etcd.jetcd.RetryLoops: long startTimeMs>;
v = v - v;
v = interfaceinvoke v.<org.apache.dubbo.remoting.etcd.RetryPolicy: boolean shouldRetry(int,long,boolean)>(v, v, 1);
if v == 0 goto label;
v = 0;
label:
if v == 0 goto label;
throw v;
label:
return;
}
private boolean isRetryException(java.lang.Throwable)
{
java.lang.Throwable v;
org.apache.dubbo.remoting.etcd.jetcd.RetryLoops v;
io.grpc.Status v;
boolean v;
v := @this: org.apache.dubbo.remoting.etcd.jetcd.RetryLoops;
v := @parameter: java.lang.Throwable;
v = staticinvoke <io.grpc.Status: io.grpc.Status fromThrowable(java.lang.Throwable)>(v);
v = staticinvoke <org.apache.dubbo.remoting.etcd.option.OptionUtil: boolean isRecoverable(io.grpc.Status)>(v);
if v == 0 goto label;
return 1;
label:
return 0;
}
public boolean shouldContinue()
{
org.apache.dubbo.remoting.etcd.jetcd.RetryLoops v;
boolean v, v;
v := @this: org.apache.dubbo.remoting.etcd.jetcd.RetryLoops;
v = v.<org.apache.dubbo.remoting.etcd.jetcd.RetryLoops: boolean isDone>;
if v != 0 goto label;
v = 1;
goto label;
label:
v = 0;
label:
return v;
}
public void complete()
{
org.apache.dubbo.remoting.etcd.jetcd.RetryLoops v;
v := @this: org.apache.dubbo.remoting.etcd.jetcd.RetryLoops;
v.<org.apache.dubbo.remoting.etcd.jetcd.RetryLoops: boolean isDone> = 1;
return;
}
}