public class org.apache.zookeeper.test.QuorumUtil extends java.lang.Object
{
private static final org.slf4j.Logger LOG;
private static final java.util.Set CONNECTED_STATES;
private final java.util.Map peersView;
private final java.util.Map peers;
public final int N;
public final int ALL;
private java.lang.String hostPort;
private int tickTime;
private int initLimit;
private int syncLimit;
private int connectToLearnerMasterLimit;
private int electionAlg;
private boolean localSessionEnabled;
public boolean disableJMXTest;
public void <init>(int, int) throws java.lang.RuntimeException
{
org.apache.zookeeper.server.quorum.QuorumPeer v, v;
java.lang.Integer v, v, v, v;
org.apache.zookeeper.test.QuorumUtil$PeerStruct v;
java.lang.Long v;
org.apache.zookeeper.server.quorum.QuorumPeer$LearnerType v;
java.util.Map v, v, v, v;
java.net.InetSocketAddress v, v, v;
java.lang.Exception v;
org.apache.zookeeper.server.quorum.QuorumPeer$QuorumServer v;
java.util.HashMap v, v;
int v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v;
java.lang.String v, v, v;
org.slf4j.Logger v;
java.lang.RuntimeException v;
java.io.File v, v, v;
java.lang.Object v;
org.apache.zookeeper.test.QuorumUtil v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v := @parameter: int;
v := @parameter: int;
specialinvoke v.<java.lang.Object: void <init>()>();
v = new java.util.HashMap;
specialinvoke v.<java.util.HashMap: void <init>()>();
v.<org.apache.zookeeper.test.QuorumUtil: java.util.Map peersView> = v;
v = new java.util.HashMap;
specialinvoke v.<java.util.HashMap: void <init>()>();
v.<org.apache.zookeeper.test.QuorumUtil: java.util.Map peers> = v;
v.<org.apache.zookeeper.test.QuorumUtil: boolean disableJMXTest> = 0;
label:
staticinvoke <org.apache.zookeeper.test.ClientBase: void setupTestEnv()>();
staticinvoke <org.apache.zookeeper.test.JMXEnv: void setUp()>();
v.<org.apache.zookeeper.test.QuorumUtil: int N> = v;
v = v.<org.apache.zookeeper.test.QuorumUtil: int N>;
v = 2 * v;
v = v + 1;
v.<org.apache.zookeeper.test.QuorumUtil: int ALL> = v;
v.<org.apache.zookeeper.test.QuorumUtil: int tickTime> = 2000;
v.<org.apache.zookeeper.test.QuorumUtil: int initLimit> = 3;
v.<org.apache.zookeeper.test.QuorumUtil: int syncLimit> = v;
v.<org.apache.zookeeper.test.QuorumUtil: int connectToLearnerMasterLimit> = 3;
v.<org.apache.zookeeper.test.QuorumUtil: int electionAlg> = 3;
v.<org.apache.zookeeper.test.QuorumUtil: java.lang.String hostPort> = "";
v = 1;
label:
v = v.<org.apache.zookeeper.test.QuorumUtil: int ALL>;
if v > v goto label;
v = new org.apache.zookeeper.test.QuorumUtil$PeerStruct;
specialinvoke v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: void <init>()>();
v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int id> = v;
v = staticinvoke <org.apache.zookeeper.test.ClientBase: java.io.File createTmpDir()>();
v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: java.io.File dataDir> = v;
v = staticinvoke <org.apache.zookeeper.PortAssignment: int unique()>();
v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort> = v;
v = v.<org.apache.zookeeper.test.QuorumUtil: java.util.Map peers>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
interfaceinvoke v.<java.util.Map: java.lang.Object put(java.lang.Object,java.lang.Object)>(v, v);
v = v.<org.apache.zookeeper.test.QuorumUtil: java.util.Map peersView>;
v = staticinvoke <java.lang.Long: java.lang.Long valueOf(long)>(v);
v = new org.apache.zookeeper.server.quorum.QuorumPeer$QuorumServer;
v = new java.net.InetSocketAddress;
v = staticinvoke <org.apache.zookeeper.PortAssignment: int unique()>();
specialinvoke v.<java.net.InetSocketAddress: void <init>(java.lang.String,int)>("127.0.0.1", v);
v = new java.net.InetSocketAddress;
v = staticinvoke <org.apache.zookeeper.PortAssignment: int unique()>();
specialinvoke v.<java.net.InetSocketAddress: void <init>(java.lang.String,int)>("127.0.0.1", v);
v = new java.net.InetSocketAddress;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort>;
specialinvoke v.<java.net.InetSocketAddress: void <init>(java.lang.String,int)>("127.0.0.1", v);
v = <org.apache.zookeeper.server.quorum.QuorumPeer$LearnerType: org.apache.zookeeper.server.quorum.QuorumPeer$LearnerType PARTICIPANT>;
specialinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer$QuorumServer: void <init>(long,java.net.InetSocketAddress,java.net.InetSocketAddress,java.net.InetSocketAddress,org.apache.zookeeper.server.quorum.QuorumPeer$LearnerType)>(v, v, v, v, v);
interfaceinvoke v.<java.util.Map: java.lang.Object put(java.lang.Object,java.lang.Object)>(v, v);
v = v.<org.apache.zookeeper.test.QuorumUtil: java.lang.String hostPort>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort>;
v = v.<org.apache.zookeeper.test.QuorumUtil: int ALL>;
if v != v goto label;
v = "";
goto label;
label:
v = ",";
label:
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String,int,java.lang.String)>(v, v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("\u.0.0.1:\u0001\u0001");
v.<org.apache.zookeeper.test.QuorumUtil: java.lang.String hostPort> = v;
v = v + 1;
goto label;
label:
v = 1;
label:
v = v.<org.apache.zookeeper.test.QuorumUtil: int ALL>;
if v > v goto label;
v = v.<org.apache.zookeeper.test.QuorumUtil: java.util.Map peers>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v = interfaceinvoke v.<java.util.Map: java.lang.Object get(java.lang.Object)>(v);
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object,java.lang.Object)>("Creating QuorumPeer {}; public port {}", v, v);
v = new org.apache.zookeeper.server.quorum.QuorumPeer;
v = v.<org.apache.zookeeper.test.QuorumUtil: java.util.Map peersView>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: java.io.File dataDir>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: java.io.File dataDir>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort>;
v = v.<org.apache.zookeeper.test.QuorumUtil: int electionAlg>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int id>;
v = v.<org.apache.zookeeper.test.QuorumUtil: int tickTime>;
v = v.<org.apache.zookeeper.test.QuorumUtil: int initLimit>;
v = v.<org.apache.zookeeper.test.QuorumUtil: int connectToLearnerMasterLimit>;
specialinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: void <init>(java.util.Map,java.io.File,java.io.File,int,int,long,int,int,int,int)>(v, v, v, v, v, v, v, v, v, v);
v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer> = v;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer>;
v = virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: int getClientPort()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(int,int)>(v, v);
v = v + 1;
goto label;
label:
v := @caughtexception;
v = new java.lang.RuntimeException;
specialinvoke v.<java.lang.RuntimeException: void <init>(java.lang.Throwable)>(v);
throw v;
label:
return;
catch java.lang.Exception from label to label with label;
}
public void <init>(int) throws java.lang.RuntimeException
{
int v;
org.apache.zookeeper.test.QuorumUtil v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v := @parameter: int;
specialinvoke v.<org.apache.zookeeper.test.QuorumUtil: void <init>(int,int)>(v, 3);
return;
}
public org.apache.zookeeper.test.QuorumUtil$PeerStruct getPeer(int)
{
java.util.Map v;
int v;
java.lang.Object v;
org.apache.zookeeper.test.QuorumUtil v;
java.lang.Integer v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v := @parameter: int;
v = v.<org.apache.zookeeper.test.QuorumUtil: java.util.Map peers>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v = interfaceinvoke v.<java.util.Map: java.lang.Object get(java.lang.Object)>(v);
return v;
}
public void enableLocalSession(boolean)
{
org.apache.zookeeper.test.QuorumUtil v;
boolean v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v := @parameter: boolean;
v.<org.apache.zookeeper.test.QuorumUtil: boolean localSessionEnabled> = v;
return;
}
public void startAll() throws java.io.IOException
{
java.lang.Integer v;
boolean v, v;
java.lang.Object[] v;
java.lang.String[] v, v;
int v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v;
java.lang.String v, v, v, v, v, v, v;
java.util.LinkedHashSet v;
org.slf4j.Logger v, v, v, v, v;
java.io.IOException v;
java.lang.InterruptedException v;
org.apache.zookeeper.test.QuorumUtil v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: void shutdownAll()>();
v = 1;
label:
v = v.<org.apache.zookeeper.test.QuorumUtil: int ALL>;
if v > v goto label;
virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: void start(int)>(v);
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object)>("Started QuorumPeer {}", v);
v = v + 1;
goto label;
label:
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
v = v.<org.apache.zookeeper.test.QuorumUtil: java.lang.String hostPort>;
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object)>("Checking ports {}", v);
v = v.<org.apache.zookeeper.test.QuorumUtil: java.lang.String hostPort>;
v = virtualinvoke v.<java.lang.String: java.lang.String[] split(java.lang.String)>(",");
v = lengthof v;
v = 0;
label:
if v >= v goto label;
v = v[v];
v = <org.apache.zookeeper.test.ClientBase: int CONNECTION_TIMEOUT>;
v = staticinvoke <org.apache.zookeeper.test.ClientBase: boolean waitForServerUp(java.lang.String,long)>(v, v);
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("waiting for server \u up");
staticinvoke <org.junit.jupiter.api.Assertions: void assertTrue(boolean,java.lang.String)>(v, v);
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object)>("{} is accepting client connections", v);
v = v + 1;
goto label;
label:
v = v.<org.apache.zookeeper.test.QuorumUtil: boolean disableJMXTest>;
if v == 0 goto label;
return;
label:
staticinvoke <org.apache.zookeeper.test.JMXEnv: void dump()>();
v = new java.util.LinkedHashSet;
specialinvoke v.<java.util.LinkedHashSet: void <init>()>();
v = 1;
label:
v = v.<org.apache.zookeeper.test.QuorumUtil: int ALL>;
if v > v goto label;
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>("InMemoryDataTree");
v = v + 1;
goto label;
label:
v = 1;
label:
v = v.<org.apache.zookeeper.test.QuorumUtil: int ALL>;
if v > v goto label;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (int,int)>(v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("name0=ReplicatedServer_id\u,name1=replica.\u,name2=");
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>(v);
v = v + 1;
goto label;
label:
v = 1;
label:
v = v.<org.apache.zookeeper.test.QuorumUtil: int ALL>;
if v > v goto label;
v = 1;
label:
v = v.<org.apache.zookeeper.test.QuorumUtil: int ALL>;
if v > v goto label;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (int,int)>(v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("name0=ReplicatedServer_id\u,name1=replica.\u0001");
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>(v);
v = v + 1;
goto label;
label:
v = v + 1;
goto label;
label:
v = 1;
label:
v = v.<org.apache.zookeeper.test.QuorumUtil: int ALL>;
if v > v goto label;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (int)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("name0=ReplicatedServer_id\u0001");
interfaceinvoke v.<java.util.Set: boolean add(java.lang.Object)>(v);
v = v + 1;
goto label;
label:
v = interfaceinvoke v.<java.util.Set: int size()>();
v = newarray (java.lang.String)[v];
v = interfaceinvoke v.<java.util.Set: java.lang.Object[] toArray(java.lang.Object[])>(v);
staticinvoke <org.apache.zookeeper.test.JMXEnv: java.util.Set ensureAll(java.lang.String[])>(v);
label:
goto label;
label:
v := @caughtexception;
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
interfaceinvoke v.<org.slf4j.Logger: void warn(java.lang.String,java.lang.Throwable)>("IOException during JMXEnv operation", v);
goto label;
label:
v := @caughtexception;
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
interfaceinvoke v.<org.slf4j.Logger: void warn(java.lang.String,java.lang.Throwable)>("InterruptedException during JMXEnv operation", v);
label:
return;
catch java.io.IOException from label to label with label;
catch java.lang.InterruptedException from label to label with label;
}
public void startQuorum() throws java.io.IOException
{
org.apache.zookeeper.test.QuorumUtil$PeerStruct v;
int v, v, v, v, v, v, v, v;
java.lang.String v;
org.apache.zookeeper.test.QuorumUtil v;
boolean v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: void shutdownAll()>();
v = 1;
label:
v = v.<org.apache.zookeeper.test.QuorumUtil: int N>;
v = v + 1;
if v > v goto label;
virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: void start(int)>(v);
v = v + 1;
goto label;
label:
v = 1;
label:
v = v.<org.apache.zookeeper.test.QuorumUtil: int N>;
v = v + 1;
if v > v goto label;
v = virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: org.apache.zookeeper.test.QuorumUtil$PeerStruct getPeer(int)>(v);
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (int)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("127.0.0.1:\u0001");
v = <org.apache.zookeeper.test.ClientBase: int CONNECTION_TIMEOUT>;
v = staticinvoke <org.apache.zookeeper.test.ClientBase: boolean waitForServerUp(java.lang.String,long)>(v, v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertTrue(boolean,java.lang.String)>(v, "Waiting for server up");
v = v + 1;
goto label;
label:
return;
}
public void start(int) throws java.io.IOException
{
org.apache.zookeeper.server.quorum.QuorumPeer v, v, v, v;
java.lang.Integer v, v;
org.apache.zookeeper.test.QuorumUtil$PeerStruct v;
java.util.Map v;
int v, v, v, v, v, v, v, v, v, v, v, v;
boolean v;
org.slf4j.Logger v;
java.io.File v, v;
org.apache.zookeeper.test.QuorumUtil v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v := @parameter: int;
v = virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: org.apache.zookeeper.test.QuorumUtil$PeerStruct getPeer(int)>(v);
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int id>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object,java.lang.Object)>("Creating QuorumPeer {}; public port {}", v, v);
v = new org.apache.zookeeper.server.quorum.QuorumPeer;
v = v.<org.apache.zookeeper.test.QuorumUtil: java.util.Map peersView>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: java.io.File dataDir>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: java.io.File dataDir>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort>;
v = v.<org.apache.zookeeper.test.QuorumUtil: int electionAlg>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int id>;
v = v.<org.apache.zookeeper.test.QuorumUtil: int tickTime>;
v = v.<org.apache.zookeeper.test.QuorumUtil: int initLimit>;
v = v.<org.apache.zookeeper.test.QuorumUtil: int syncLimit>;
v = v.<org.apache.zookeeper.test.QuorumUtil: int connectToLearnerMasterLimit>;
specialinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: void <init>(java.util.Map,java.io.File,java.io.File,int,int,long,int,int,int,int)>(v, v, v, v, v, v, v, v, v, v);
v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer> = v;
v = v.<org.apache.zookeeper.test.QuorumUtil: boolean localSessionEnabled>;
if v == 0 goto label;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer>;
virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: void enableLocalSessions(boolean)>(1);
label:
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer>;
v = virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: int getClientPort()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(int,int)>(v, v);
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer>;
virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: void start()>();
return;
}
public void restart(int) throws java.io.IOException
{
org.apache.zookeeper.test.QuorumUtil$PeerStruct v;
int v, v, v;
java.lang.String v;
org.apache.zookeeper.test.QuorumUtil v;
boolean v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v := @parameter: int;
virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: void start(int)>(v);
v = virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: org.apache.zookeeper.test.QuorumUtil$PeerStruct getPeer(int)>(v);
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (int)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("127.0.0.1:\u0001");
v = <org.apache.zookeeper.test.ClientBase: int CONNECTION_TIMEOUT>;
v = staticinvoke <org.apache.zookeeper.test.ClientBase: boolean waitForServerUp(java.lang.String,long)>(v, v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertTrue(boolean,java.lang.String)>(v, "Waiting for server up");
return;
}
public void startThenShutdown(int) throws java.io.IOException
{
org.apache.zookeeper.server.quorum.QuorumPeer v, v, v, v;
java.lang.Integer v, v;
org.apache.zookeeper.test.QuorumUtil$PeerStruct v, v;
java.util.Map v;
int v, v, v, v, v, v, v, v, v, v, v, v, v, v;
java.lang.String v;
boolean v, v;
org.slf4j.Logger v;
java.io.File v, v;
org.apache.zookeeper.test.QuorumUtil v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v := @parameter: int;
v = virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: org.apache.zookeeper.test.QuorumUtil$PeerStruct getPeer(int)>(v);
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int id>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object,java.lang.Object)>("Creating QuorumPeer {}; public port {}", v, v);
v = new org.apache.zookeeper.server.quorum.QuorumPeer;
v = v.<org.apache.zookeeper.test.QuorumUtil: java.util.Map peersView>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: java.io.File dataDir>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: java.io.File dataDir>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort>;
v = v.<org.apache.zookeeper.test.QuorumUtil: int electionAlg>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int id>;
v = v.<org.apache.zookeeper.test.QuorumUtil: int tickTime>;
v = v.<org.apache.zookeeper.test.QuorumUtil: int initLimit>;
v = v.<org.apache.zookeeper.test.QuorumUtil: int syncLimit>;
v = v.<org.apache.zookeeper.test.QuorumUtil: int connectToLearnerMasterLimit>;
specialinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: void <init>(java.util.Map,java.io.File,java.io.File,int,int,long,int,int,int,int)>(v, v, v, v, v, v, v, v, v, v);
v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer> = v;
v = v.<org.apache.zookeeper.test.QuorumUtil: boolean localSessionEnabled>;
if v == 0 goto label;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer>;
virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: void enableLocalSessions(boolean)>(1);
label:
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort>;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer>;
v = virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: int getClientPort()>();
staticinvoke <org.junit.jupiter.api.Assertions: void assertEquals(int,int)>(v, v);
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer>;
virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: void start()>();
v = virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: org.apache.zookeeper.test.QuorumUtil$PeerStruct getPeer(int)>(v);
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (int)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("127.0.0.1:\u0001");
v = <org.apache.zookeeper.test.ClientBase: int CONNECTION_TIMEOUT>;
v = staticinvoke <org.apache.zookeeper.test.ClientBase: boolean waitForServerUp(java.lang.String,long)>(v, v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertTrue(boolean,java.lang.String)>(v, "Waiting for server up");
virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: void shutdown(int)>(v);
return;
}
public void shutdownAll()
{
org.slf4j.Logger v;
java.lang.String[] v;
int v, v, v, v, v;
java.lang.String v, v;
org.apache.zookeeper.test.QuorumUtil v;
boolean v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v = 1;
label:
v = v.<org.apache.zookeeper.test.QuorumUtil: int ALL>;
if v > v goto label;
virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: void shutdown(int)>(v);
v = v + 1;
goto label;
label:
v = v.<org.apache.zookeeper.test.QuorumUtil: java.lang.String hostPort>;
v = virtualinvoke v.<java.lang.String: java.lang.String[] split(java.lang.String)>(",");
v = lengthof v;
v = 0;
label:
if v >= v goto label;
v = v[v];
v = <org.apache.zookeeper.test.ClientBase: int CONNECTION_TIMEOUT>;
v = staticinvoke <org.apache.zookeeper.test.ClientBase: boolean waitForServerDown(java.lang.String,long)>(v, v);
staticinvoke <org.junit.jupiter.api.Assertions: void assertTrue(boolean,java.lang.String)>(v, "Waiting for server down");
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object)>("{} is no longer accepting client connections", v);
v = v + 1;
goto label;
label:
return;
}
public void shutdown(int)
{
org.apache.zookeeper.server.quorum.QuorumPeer v;
java.lang.Object[] v;
java.lang.Integer v, v, v, v, v;
org.apache.zookeeper.test.QuorumUtil$PeerStruct v;
int v;
java.lang.String v, v, v, v, v, v, v;
boolean v;
org.slf4j.Logger v, v, v, v, v;
java.lang.InterruptedException v;
org.apache.zookeeper.test.QuorumUtil v;
org.apache.zookeeper.server.quorum.Election v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v := @parameter: int;
v = virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: org.apache.zookeeper.test.QuorumUtil$PeerStruct getPeer(int)>(v);
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer>;
label:
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
v = virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: java.lang.String getName()>();
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object,java.lang.Object)>("Shutting down quorum peer {} with id {}", v, v);
virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: void shutdown()>();
v = virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: org.apache.zookeeper.server.quorum.Election getElectionAlg()>();
if v == null goto label;
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
v = virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: java.lang.String getName()>();
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object,java.lang.Object)>("Shutting down leader election {} with id {}", v, v);
interfaceinvoke v.<org.apache.zookeeper.server.quorum.Election: void shutdown()>();
goto label;
label:
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
v = virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: java.lang.String getName()>();
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object,java.lang.Object)>("No election available to shutdown {} with id {}", v, v);
label:
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
v = virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: java.lang.String getName()>();
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object,java.lang.Object)>("Waiting for {} with id {} to exit thread", v, v);
virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: void join(long)>(30000L);
v = virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: boolean isAlive()>();
if v == 0 goto label;
v = virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: java.lang.String getName()>();
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String,int)>(v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("QP failed to shutdown in 30 seconds: \u \u0001");
staticinvoke <org.junit.jupiter.api.Assertions: java.lang.Object fail(java.lang.String)>(v);
label:
goto label;
label:
v := @caughtexception;
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
v = newarray (java.lang.Object)[3];
v = virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: java.lang.String getName()>();
v[0] = v;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v[1] = v;
v[2] = v;
interfaceinvoke v.<org.slf4j.Logger: void debug(java.lang.String,java.lang.Object[])>("QP interrupted: {} {}", v);
label:
return;
catch java.lang.InterruptedException from label to label with label;
}
public java.lang.String getConnString()
{
java.lang.String v;
org.apache.zookeeper.test.QuorumUtil v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v = v.<org.apache.zookeeper.test.QuorumUtil: java.lang.String hostPort>;
return v;
}
public java.lang.String getConnectString(org.apache.zookeeper.server.quorum.QuorumPeer)
{
org.apache.zookeeper.server.quorum.QuorumPeer v;
int v;
java.lang.String v;
org.apache.zookeeper.test.QuorumUtil v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v := @parameter: org.apache.zookeeper.server.quorum.QuorumPeer;
v = virtualinvoke v.<org.apache.zookeeper.server.quorum.QuorumPeer: int getClientPort()>();
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (int)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("127.0.0.1:\u0001");
return v;
}
public boolean allPeersAreConnected()
{
java.util.function.Predicate v;
java.util.Collection v;
java.util.function.Function v;
java.util.stream.Stream v, v;
java.util.Map v;
org.apache.zookeeper.test.QuorumUtil v;
boolean v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v = v.<org.apache.zookeeper.test.QuorumUtil: java.util.Map peers>;
v = interfaceinvoke v.<java.util.Map: java.util.Collection values()>();
v = interfaceinvoke v.<java.util.Collection: java.util.stream.Stream stream()>();
v = staticinvoke <org.apache.zookeeper.test.QuorumUtil$lambda_allPeersAreConnected_0__298: java.util.function.Function bootstrap$()>();
v = interfaceinvoke v.<java.util.stream.Stream: java.util.stream.Stream map(java.util.function.Function)>(v);
v = staticinvoke <org.apache.zookeeper.test.QuorumUtil$lambda_allPeersAreConnected_1__299: java.util.function.Predicate bootstrap$()>();
v = interfaceinvoke v.<java.util.stream.Stream: boolean allMatch(java.util.function.Predicate)>(v);
return v;
}
public org.apache.zookeeper.server.quorum.QuorumPeer getLeaderQuorumPeer()
{
org.apache.zookeeper.server.quorum.QuorumPeer v, v;
java.util.Iterator v;
java.util.Collection v;
java.lang.RuntimeException v;
org.apache.zookeeper.server.quorum.Leader v;
java.util.Map v;
java.lang.Object v;
org.apache.zookeeper.test.QuorumUtil v;
boolean v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v = v.<org.apache.zookeeper.test.QuorumUtil: java.util.Map peers>;
v = interfaceinvoke v.<java.util.Map: java.util.Collection values()>();
v = interfaceinvoke v.<java.util.Collection: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer>;
v = v.<org.apache.zookeeper.server.quorum.QuorumPeer: org.apache.zookeeper.server.quorum.Leader leader>;
if v == null goto label;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer>;
return v;
label:
v = new java.lang.RuntimeException;
specialinvoke v.<java.lang.RuntimeException: void <init>(java.lang.String)>("Unable to find a leader peer");
throw v;
}
public java.util.List getFollowerQuorumPeers()
{
org.apache.zookeeper.server.quorum.QuorumPeer v, v;
java.util.Iterator v;
java.util.Collection v;
java.util.ArrayList v;
java.util.List v;
org.apache.zookeeper.server.quorum.Leader v;
java.util.Map v;
int v, v;
java.lang.Object v;
org.apache.zookeeper.test.QuorumUtil v;
boolean v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v = new java.util.ArrayList;
v = v.<org.apache.zookeeper.test.QuorumUtil: int ALL>;
v = v - 1;
specialinvoke v.<java.util.ArrayList: void <init>(int)>(v);
v = v.<org.apache.zookeeper.test.QuorumUtil: java.util.Map peers>;
v = interfaceinvoke v.<java.util.Map: java.util.Collection values()>();
v = interfaceinvoke v.<java.util.Collection: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer>;
v = v.<org.apache.zookeeper.server.quorum.QuorumPeer: org.apache.zookeeper.server.quorum.Leader leader>;
if v != null goto label;
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer>;
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
goto label;
label:
v = staticinvoke <java.util.Collections: java.util.List unmodifiableList(java.util.List)>(v);
return v;
}
public void tearDown() throws java.lang.Exception
{
org.slf4j.Logger v, v;
java.lang.Long v;
long v;
org.apache.zookeeper.test.QuorumUtil v;
org.apache.zookeeper.server.util.OSMXBean v;
boolean v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String)>("TearDown started");
v = new org.apache.zookeeper.server.util.OSMXBean;
specialinvoke v.<org.apache.zookeeper.server.util.OSMXBean: void <init>()>();
v = virtualinvoke v.<org.apache.zookeeper.server.util.OSMXBean: boolean getUnix()>();
if v == 0 goto label;
v = <org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG>;
v = virtualinvoke v.<org.apache.zookeeper.server.util.OSMXBean: long getOpenFileDescriptorCount()>();
v = staticinvoke <java.lang.Long: java.lang.Long valueOf(long)>(v);
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object)>("fdcount after test is: {}", v);
label:
virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: void shutdownAll()>();
staticinvoke <org.apache.zookeeper.test.JMXEnv: void tearDown()>();
return;
}
public int getLeaderServer()
{
org.apache.zookeeper.server.quorum.QuorumPeer v;
org.apache.zookeeper.test.QuorumUtil$PeerStruct v;
org.apache.zookeeper.server.quorum.Leader v;
int v, v, v;
org.apache.zookeeper.test.QuorumUtil v;
boolean v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v = 0;
v = 1;
label:
v = v.<org.apache.zookeeper.test.QuorumUtil: int ALL>;
if v > v goto label;
v = virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: org.apache.zookeeper.test.QuorumUtil$PeerStruct getPeer(int)>(v);
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer>;
v = v.<org.apache.zookeeper.server.quorum.QuorumPeer: org.apache.zookeeper.server.quorum.Leader leader>;
if v == null goto label;
v = v;
goto label;
label:
v = v + 1;
goto label;
label:
if v <= 0 goto label;
v = 1;
goto label;
label:
v = 0;
label:
staticinvoke <org.junit.jupiter.api.Assertions: void assertTrue(boolean,java.lang.String)>(v, "Leader server not found.");
return v;
}
public boolean leaderExists()
{
org.apache.zookeeper.server.quorum.QuorumPeer v;
org.apache.zookeeper.test.QuorumUtil$PeerStruct v;
org.apache.zookeeper.server.quorum.Leader v;
int v, v;
org.apache.zookeeper.test.QuorumUtil v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v = 1;
label:
v = v.<org.apache.zookeeper.test.QuorumUtil: int ALL>;
if v > v goto label;
v = virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: org.apache.zookeeper.test.QuorumUtil$PeerStruct getPeer(int)>(v);
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: org.apache.zookeeper.server.quorum.QuorumPeer peer>;
v = v.<org.apache.zookeeper.server.quorum.QuorumPeer: org.apache.zookeeper.server.quorum.Leader leader>;
if v == null goto label;
return 1;
label:
v = v + 1;
goto label;
label:
return 0;
}
public java.lang.String getConnectionStringForServer(int)
{
org.apache.zookeeper.test.QuorumUtil$PeerStruct v;
int v, v;
java.lang.String v;
org.apache.zookeeper.test.QuorumUtil v;
v := @this: org.apache.zookeeper.test.QuorumUtil;
v := @parameter: int;
v = virtualinvoke v.<org.apache.zookeeper.test.QuorumUtil: org.apache.zookeeper.test.QuorumUtil$PeerStruct getPeer(int)>(v);
v = v.<org.apache.zookeeper.test.QuorumUtil$PeerStruct: int clientPort>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (int)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("127.0.0.1:\u0001");
return v;
}
static void <clinit>()
{
java.util.List v;
org.slf4j.Logger v;
org.apache.zookeeper.server.quorum.QuorumPeer$ServerState v, v, v;
org.apache.zookeeper.server.quorum.QuorumPeer$ServerState[] v;
java.util.TreeSet v;
v = staticinvoke <org.slf4j.LoggerFactory: org.slf4j.Logger getLogger(java.lang.Class)>(class "Lorg/apache/zookeeper/test/QuorumUtil;");
<org.apache.zookeeper.test.QuorumUtil: org.slf4j.Logger LOG> = v;
v = new java.util.TreeSet;
v = newarray (org.apache.zookeeper.server.quorum.QuorumPeer$ServerState)[3];
v = <org.apache.zookeeper.server.quorum.QuorumPeer$ServerState: org.apache.zookeeper.server.quorum.QuorumPeer$ServerState LEADING>;
v[0] = v;
v = <org.apache.zookeeper.server.quorum.QuorumPeer$ServerState: org.apache.zookeeper.server.quorum.QuorumPeer$ServerState FOLLOWING>;
v[1] = v;
v = <org.apache.zookeeper.server.quorum.QuorumPeer$ServerState: org.apache.zookeeper.server.quorum.QuorumPeer$ServerState OBSERVING>;
v[2] = v;
v = staticinvoke <java.util.Arrays: java.util.List asList(java.lang.Object[])>(v);
specialinvoke v.<java.util.TreeSet: void <init>(java.util.Collection)>(v);
<org.apache.zookeeper.test.QuorumUtil: java.util.Set CONNECTED_STATES> = v;
return;
}
}