abstract class com.mongodb.internal.connection.BaseCluster implements com.mongodb.connection.Cluster
minor version: 0
major version: 59
flags: flags: (0x0420) ACC_SUPER, ACC_ABSTRACT
this_class: com.mongodb.internal.connection.BaseCluster
super_class: java.lang.Object
{
private static final com.mongodb.diagnostics.logging.Logger LOGGER;
descriptor: Lcom/mongodb/diagnostics/logging/Logger;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private final java.util.concurrent.atomic.AtomicReference<java.util.concurrent.CountDownLatch> phase;
descriptor: Ljava/util/concurrent/atomic/AtomicReference;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Signature: Ljava/util/concurrent/atomic/AtomicReference<Ljava/util/concurrent/CountDownLatch;>;
private final com.mongodb.internal.connection.ClusterableServerFactory serverFactory;
descriptor: Lcom/mongodb/internal/connection/ClusterableServerFactory;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final java.lang.ThreadLocal<java.util.Random> random;
descriptor: Ljava/lang/ThreadLocal;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Signature: Ljava/lang/ThreadLocal<Ljava/util/Random;>;
private final com.mongodb.connection.ClusterId clusterId;
descriptor: Lcom/mongodb/connection/ClusterId;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final com.mongodb.connection.ClusterSettings settings;
descriptor: Lcom/mongodb/connection/ClusterSettings;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final com.mongodb.event.ClusterListener clusterListener;
descriptor: Lcom/mongodb/event/ClusterListener;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final java.util.Deque<com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest> waitQueue;
descriptor: Ljava/util/Deque;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Signature: Ljava/util/Deque<Lcom/mongodb/internal/connection/BaseCluster$ServerSelectionRequest;>;
private final java.util.concurrent.atomic.AtomicInteger waitQueueSize;
descriptor: Ljava/util/concurrent/atomic/AtomicInteger;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final com.mongodb.internal.connection.ClusterClock clusterClock;
descriptor: Lcom/mongodb/internal/connection/ClusterClock;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private java.lang.Thread waitQueueHandler;
descriptor: Ljava/lang/Thread;
flags: (0x0002) ACC_PRIVATE
private volatile boolean isClosed;
descriptor: Z
flags: (0x0042) ACC_PRIVATE, ACC_VOLATILE
private volatile com.mongodb.connection.ClusterDescription description;
descriptor: Lcom/mongodb/connection/ClusterDescription;
flags: (0x0042) ACC_PRIVATE, ACC_VOLATILE
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: ldc "cluster"
invokestatic com.mongodb.diagnostics.logging.Loggers.getLogger:(Ljava/lang/String;)Lcom/mongodb/diagnostics/logging/Logger;
putstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
return
LocalVariableTable:
Start End Slot Name Signature
void <init>(com.mongodb.connection.ClusterId, com.mongodb.connection.ClusterSettings, com.mongodb.internal.connection.ClusterableServerFactory);
descriptor: (Lcom/mongodb/connection/ClusterId;Lcom/mongodb/connection/ClusterSettings;Lcom/mongodb/internal/connection/ClusterableServerFactory;)V
flags: (0x0000)
Code:
stack=8, locals=4, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
new java.util.concurrent.atomic.AtomicReference
dup
new java.util.concurrent.CountDownLatch
dup
iconst_1
invokespecial java.util.concurrent.CountDownLatch.<init>:(I)V
invokespecial java.util.concurrent.atomic.AtomicReference.<init>:(Ljava/lang/Object;)V
putfield com.mongodb.internal.connection.BaseCluster.phase:Ljava/util/concurrent/atomic/AtomicReference;
2: aload 0
new java.lang.ThreadLocal
dup
invokespecial java.lang.ThreadLocal.<init>:()V
putfield com.mongodb.internal.connection.BaseCluster.random:Ljava/lang/ThreadLocal;
3: aload 0
new com.mongodb.internal.connection.ConcurrentLinkedDeque
dup
invokespecial com.mongodb.internal.connection.ConcurrentLinkedDeque.<init>:()V
putfield com.mongodb.internal.connection.BaseCluster.waitQueue:Ljava/util/Deque;
4: aload 0
new java.util.concurrent.atomic.AtomicInteger
dup
iconst_0
invokespecial java.util.concurrent.atomic.AtomicInteger.<init>:(I)V
putfield com.mongodb.internal.connection.BaseCluster.waitQueueSize:Ljava/util/concurrent/atomic/AtomicInteger;
5: aload 0
new com.mongodb.internal.connection.ClusterClock
dup
invokespecial com.mongodb.internal.connection.ClusterClock.<init>:()V
putfield com.mongodb.internal.connection.BaseCluster.clusterClock:Lcom/mongodb/internal/connection/ClusterClock;
6: aload 0
ldc "clusterId"
aload 1
invokestatic com.mongodb.assertions.Assertions.notNull:(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
checkcast com.mongodb.connection.ClusterId
putfield com.mongodb.internal.connection.BaseCluster.clusterId:Lcom/mongodb/connection/ClusterId;
7: aload 0
ldc "settings"
aload 2
invokestatic com.mongodb.assertions.Assertions.notNull:(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
checkcast com.mongodb.connection.ClusterSettings
putfield com.mongodb.internal.connection.BaseCluster.settings:Lcom/mongodb/connection/ClusterSettings;
8: aload 0
ldc "serverFactory"
aload 3
invokestatic com.mongodb.assertions.Assertions.notNull:(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
checkcast com.mongodb.internal.connection.ClusterableServerFactory
putfield com.mongodb.internal.connection.BaseCluster.serverFactory:Lcom/mongodb/internal/connection/ClusterableServerFactory;
9: aload 0
aload 2
invokestatic com.mongodb.internal.event.EventListenerHelper.getClusterListener:(Lcom/mongodb/connection/ClusterSettings;)Lcom/mongodb/event/ClusterListener;
putfield com.mongodb.internal.connection.BaseCluster.clusterListener:Lcom/mongodb/event/ClusterListener;
10: aload 0
getfield com.mongodb.internal.connection.BaseCluster.clusterListener:Lcom/mongodb/event/ClusterListener;
new com.mongodb.event.ClusterOpeningEvent
dup
aload 1
invokespecial com.mongodb.event.ClusterOpeningEvent.<init>:(Lcom/mongodb/connection/ClusterId;)V
invokeinterface com.mongodb.event.ClusterListener.clusterOpening:(Lcom/mongodb/event/ClusterOpeningEvent;)V
11: aload 0
new com.mongodb.connection.ClusterDescription
dup
aload 2
invokevirtual com.mongodb.connection.ClusterSettings.getMode:()Lcom/mongodb/connection/ClusterConnectionMode;
getstatic com.mongodb.connection.ClusterType.UNKNOWN:Lcom/mongodb/connection/ClusterType;
invokestatic java.util.Collections.emptyList:()Ljava/util/List;
12: aload 2
aload 3
invokeinterface com.mongodb.internal.connection.ClusterableServerFactory.getSettings:()Lcom/mongodb/connection/ServerSettings;
invokespecial com.mongodb.connection.ClusterDescription.<init>:(Lcom/mongodb/connection/ClusterConnectionMode;Lcom/mongodb/connection/ClusterType;Ljava/util/List;Lcom/mongodb/connection/ClusterSettings;Lcom/mongodb/connection/ServerSettings;)V
13: putfield com.mongodb.internal.connection.BaseCluster.description:Lcom/mongodb/connection/ClusterDescription;
14: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 15 0 this Lcom/mongodb/internal/connection/BaseCluster;
0 15 1 clusterId Lcom/mongodb/connection/ClusterId;
0 15 2 settings Lcom/mongodb/connection/ClusterSettings;
0 15 3 serverFactory Lcom/mongodb/internal/connection/ClusterableServerFactory;
MethodParameters:
Name Flags
clusterId final
settings final
serverFactory final
public org.bson.BsonTimestamp getClusterTime();
descriptor: ()Lorg/bson/BsonTimestamp;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.BaseCluster.clusterClock:Lcom/mongodb/internal/connection/ClusterClock;
invokevirtual com.mongodb.internal.connection.ClusterClock.getClusterTime:()Lorg/bson/BsonTimestamp;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/mongodb/internal/connection/BaseCluster;
public com.mongodb.connection.Server selectServer(com.mongodb.selector.ServerSelector);
descriptor: (Lcom/mongodb/selector/ServerSelector;)Lcom/mongodb/connection/Server;
flags: (0x0001) ACC_PUBLIC
Code:
stack=7, locals=13, args_size=2
start local 0 start local 1 0: ldc "open"
aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.isClosed:()Z
ifeq 1
iconst_0
goto 2
StackMap locals:
StackMap stack: java.lang.String
1: iconst_1
StackMap locals: com.mongodb.internal.connection.BaseCluster com.mongodb.selector.ServerSelector
StackMap stack: java.lang.String int
2: invokestatic com.mongodb.assertions.Assertions.isTrue:(Ljava/lang/String;Z)V
3: aload 0
getfield com.mongodb.internal.connection.BaseCluster.phase:Ljava/util/concurrent/atomic/AtomicReference;
invokevirtual java.util.concurrent.atomic.AtomicReference.get:()Ljava/lang/Object;
checkcast java.util.concurrent.CountDownLatch
astore 2
start local 2 4: aload 0
getfield com.mongodb.internal.connection.BaseCluster.description:Lcom/mongodb/connection/ClusterDescription;
astore 3
start local 3 5: aload 0
aload 1
invokevirtual com.mongodb.internal.connection.BaseCluster.getCompositeServerSelector:(Lcom/mongodb/selector/ServerSelector;)Lcom/mongodb/selector/ServerSelector;
astore 4
start local 4 6: aload 0
aload 4
aload 3
invokevirtual com.mongodb.internal.connection.BaseCluster.selectRandomServer:(Lcom/mongodb/selector/ServerSelector;Lcom/mongodb/connection/ClusterDescription;)Lcom/mongodb/connection/Server;
astore 5
start local 5 7: iconst_0
istore 6
start local 6 8: invokestatic java.lang.System.nanoTime:()J
lstore 7
start local 7 9: lload 7
lstore 9
start local 9 10: aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.getMaxWaitTimeNanos:()J
lstore 11
start local 11 11: StackMap locals: com.mongodb.internal.connection.BaseCluster com.mongodb.selector.ServerSelector java.util.concurrent.CountDownLatch com.mongodb.connection.ClusterDescription com.mongodb.selector.ServerSelector com.mongodb.connection.Server int long long long
StackMap stack:
aload 0
aload 3
invokevirtual com.mongodb.internal.connection.BaseCluster.throwIfIncompatible:(Lcom/mongodb/connection/ClusterDescription;)V
12: aload 5
ifnull 15
13: aload 5
14: areturn
15: StackMap locals:
StackMap stack:
lload 9
lload 7
lsub
lload 11
lcmp
ifle 17
16: aload 0
aload 1
aload 3
invokevirtual com.mongodb.internal.connection.BaseCluster.createTimeoutException:(Lcom/mongodb/selector/ServerSelector;Lcom/mongodb/connection/ClusterDescription;)Lcom/mongodb/MongoTimeoutException;
athrow
17: StackMap locals:
StackMap stack:
iload 6
ifne 20
18: aload 0
aload 1
aload 3
invokevirtual com.mongodb.internal.connection.BaseCluster.logServerSelectionFailure:(Lcom/mongodb/selector/ServerSelector;Lcom/mongodb/connection/ClusterDescription;)V
19: iconst_1
istore 6
20: StackMap locals:
StackMap stack:
aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.connect:()V
21: aload 2
lload 11
lload 9
lload 7
lsub
lsub
aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.getMinWaitTimeNanos:()J
invokestatic java.lang.Math.min:(JJ)J
getstatic java.util.concurrent.TimeUnit.NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invokevirtual java.util.concurrent.CountDownLatch.await:(JLjava/util/concurrent/TimeUnit;)Z
pop
22: invokestatic java.lang.System.nanoTime:()J
lstore 9
23: aload 0
getfield com.mongodb.internal.connection.BaseCluster.phase:Ljava/util/concurrent/atomic/AtomicReference;
invokevirtual java.util.concurrent.atomic.AtomicReference.get:()Ljava/lang/Object;
checkcast java.util.concurrent.CountDownLatch
astore 2
24: aload 0
getfield com.mongodb.internal.connection.BaseCluster.description:Lcom/mongodb/connection/ClusterDescription;
astore 3
25: aload 0
aload 4
aload 3
invokevirtual com.mongodb.internal.connection.BaseCluster.selectRandomServer:(Lcom/mongodb/selector/ServerSelector;Lcom/mongodb/connection/ClusterDescription;)Lcom/mongodb/connection/Server;
astore 5
26: goto 11
end local 11 end local 9 end local 7 end local 6 end local 5 end local 4 end local 3 end local 2 27: StackMap locals: com.mongodb.internal.connection.BaseCluster com.mongodb.selector.ServerSelector
StackMap stack: java.lang.InterruptedException
astore 2
start local 2 28: new com.mongodb.MongoInterruptedException
dup
ldc "Interrupted while waiting for a server that matches %s"
iconst_1
anewarray java.lang.Object
dup
iconst_0
aload 1
aastore
invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
aload 2
invokespecial com.mongodb.MongoInterruptedException.<init>:(Ljava/lang/String;Ljava/lang/Exception;)V
athrow
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 29 0 this Lcom/mongodb/internal/connection/BaseCluster;
0 29 1 serverSelector Lcom/mongodb/selector/ServerSelector;
4 27 2 currentPhase Ljava/util/concurrent/CountDownLatch;
5 27 3 curDescription Lcom/mongodb/connection/ClusterDescription;
6 27 4 compositeServerSelector Lcom/mongodb/selector/ServerSelector;
7 27 5 server Lcom/mongodb/connection/Server;
8 27 6 selectionFailureLogged Z
9 27 7 startTimeNanos J
10 27 9 curTimeNanos J
11 27 11 maxWaitTimeNanos J
28 29 2 e Ljava/lang/InterruptedException;
Exception table:
from to target type
3 14 27 Class java.lang.InterruptedException
15 27 27 Class java.lang.InterruptedException
MethodParameters:
Name Flags
serverSelector final
public void selectServerAsync(com.mongodb.selector.ServerSelector, com.mongodb.async.SingleResultCallback<com.mongodb.connection.Server>);
descriptor: (Lcom/mongodb/selector/ServerSelector;Lcom/mongodb/async/SingleResultCallback;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=7, locals=6, args_size=3
start local 0 start local 1 start local 2 0: ldc "open"
aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.isClosed:()Z
ifeq 1
iconst_0
goto 2
StackMap locals:
StackMap stack: java.lang.String
1: iconst_1
StackMap locals: com.mongodb.internal.connection.BaseCluster com.mongodb.selector.ServerSelector com.mongodb.async.SingleResultCallback
StackMap stack: java.lang.String int
2: invokestatic com.mongodb.assertions.Assertions.isTrue:(Ljava/lang/String;Z)V
3: getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
invokeinterface com.mongodb.diagnostics.logging.Logger.isTraceEnabled:()Z
ifeq 5
4: getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
ldc "Asynchronously selecting server with selector %s"
iconst_1
anewarray java.lang.Object
dup
iconst_0
aload 1
aastore
invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokeinterface com.mongodb.diagnostics.logging.Logger.trace:(Ljava/lang/String;)V
5: StackMap locals:
StackMap stack:
new com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest
dup
aload 1
aload 0
aload 1
invokevirtual com.mongodb.internal.connection.BaseCluster.getCompositeServerSelector:(Lcom/mongodb/selector/ServerSelector;)Lcom/mongodb/selector/ServerSelector;
6: aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.getMaxWaitTimeNanos:()J
aload 2
7: invokespecial com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest.<init>:(Lcom/mongodb/selector/ServerSelector;Lcom/mongodb/selector/ServerSelector;JLcom/mongodb/async/SingleResultCallback;)V
astore 3
start local 3 8: aload 0
getfield com.mongodb.internal.connection.BaseCluster.phase:Ljava/util/concurrent/atomic/AtomicReference;
invokevirtual java.util.concurrent.atomic.AtomicReference.get:()Ljava/lang/Object;
checkcast java.util.concurrent.CountDownLatch
astore 4
start local 4 9: aload 0
getfield com.mongodb.internal.connection.BaseCluster.description:Lcom/mongodb/connection/ClusterDescription;
astore 5
start local 5 10: aload 0
aload 3
aload 4
aload 5
invokevirtual com.mongodb.internal.connection.BaseCluster.handleServerSelectionRequest:(Lcom/mongodb/internal/connection/BaseCluster$ServerSelectionRequest;Ljava/util/concurrent/CountDownLatch;Lcom/mongodb/connection/ClusterDescription;)Z
ifne 12
11: aload 0
aload 3
invokevirtual com.mongodb.internal.connection.BaseCluster.notifyWaitQueueHandler:(Lcom/mongodb/internal/connection/BaseCluster$ServerSelectionRequest;)V
12: StackMap locals: com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest java.util.concurrent.CountDownLatch com.mongodb.connection.ClusterDescription
StackMap stack:
return
end local 5 end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 13 0 this Lcom/mongodb/internal/connection/BaseCluster;
0 13 1 serverSelector Lcom/mongodb/selector/ServerSelector;
0 13 2 callback Lcom/mongodb/async/SingleResultCallback<Lcom/mongodb/connection/Server;>;
8 13 3 request Lcom/mongodb/internal/connection/BaseCluster$ServerSelectionRequest;
9 13 4 currentPhase Ljava/util/concurrent/CountDownLatch;
10 13 5 currentDescription Lcom/mongodb/connection/ClusterDescription;
Signature: (Lcom/mongodb/selector/ServerSelector;Lcom/mongodb/async/SingleResultCallback<Lcom/mongodb/connection/Server;>;)V
MethodParameters:
Name Flags
serverSelector final
callback final
public com.mongodb.connection.ClusterDescription getDescription();
descriptor: ()Lcom/mongodb/connection/ClusterDescription;
flags: (0x0001) ACC_PUBLIC
Code:
stack=8, locals=10, args_size=1
start local 0 0: ldc "open"
aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.isClosed:()Z
ifeq 1
iconst_0
goto 2
StackMap locals:
StackMap stack: java.lang.String
1: iconst_1
StackMap locals: com.mongodb.internal.connection.BaseCluster
StackMap stack: java.lang.String int
2: invokestatic com.mongodb.assertions.Assertions.isTrue:(Ljava/lang/String;Z)V
3: aload 0
getfield com.mongodb.internal.connection.BaseCluster.phase:Ljava/util/concurrent/atomic/AtomicReference;
invokevirtual java.util.concurrent.atomic.AtomicReference.get:()Ljava/lang/Object;
checkcast java.util.concurrent.CountDownLatch
astore 1
start local 1 4: aload 0
getfield com.mongodb.internal.connection.BaseCluster.description:Lcom/mongodb/connection/ClusterDescription;
astore 2
start local 2 5: iconst_0
istore 3
start local 3 6: invokestatic java.lang.System.nanoTime:()J
lstore 4
start local 4 7: lload 4
lstore 6
start local 6 8: aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.getMaxWaitTimeNanos:()J
lstore 8
start local 8 9: goto 29
10: StackMap locals: com.mongodb.internal.connection.BaseCluster java.util.concurrent.CountDownLatch com.mongodb.connection.ClusterDescription int long long long
StackMap stack:
lload 6
lload 4
lsub
lload 8
lcmp
ifle 15
11: new com.mongodb.MongoTimeoutException
dup
ldc "Timed out after %d ms while waiting to connect. Client view of cluster state is %s"
iconst_2
anewarray java.lang.Object
dup
iconst_0
12: aload 0
getfield com.mongodb.internal.connection.BaseCluster.settings:Lcom/mongodb/connection/ClusterSettings;
getstatic java.util.concurrent.TimeUnit.MILLISECONDS:Ljava/util/concurrent/TimeUnit;
invokevirtual com.mongodb.connection.ClusterSettings.getServerSelectionTimeout:(Ljava/util/concurrent/TimeUnit;)J
invokestatic java.lang.Long.valueOf:(J)Ljava/lang/Long;
aastore
dup
iconst_1
13: aload 2
invokevirtual com.mongodb.connection.ClusterDescription.getShortDescription:()Ljava/lang/String;
aastore
14: invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokespecial com.mongodb.MongoTimeoutException.<init>:(Ljava/lang/String;)V
athrow
15: StackMap locals:
StackMap stack:
iload 3
ifne 24
16: getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
invokeinterface com.mongodb.diagnostics.logging.Logger.isInfoEnabled:()Z
ifeq 23
17: aload 0
getfield com.mongodb.internal.connection.BaseCluster.settings:Lcom/mongodb/connection/ClusterSettings;
getstatic java.util.concurrent.TimeUnit.MILLISECONDS:Ljava/util/concurrent/TimeUnit;
invokevirtual com.mongodb.connection.ClusterSettings.getServerSelectionTimeout:(Ljava/util/concurrent/TimeUnit;)J
lconst_0
lcmp
ifge 20
18: getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
ldc "Cluster description not yet available. Waiting indefinitely."
invokeinterface com.mongodb.diagnostics.logging.Logger.info:(Ljava/lang/String;)V
19: goto 23
20: StackMap locals:
StackMap stack:
getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
ldc "Cluster description not yet available. Waiting for %d ms before timing out"
iconst_1
anewarray java.lang.Object
dup
iconst_0
21: aload 0
getfield com.mongodb.internal.connection.BaseCluster.settings:Lcom/mongodb/connection/ClusterSettings;
getstatic java.util.concurrent.TimeUnit.MILLISECONDS:Ljava/util/concurrent/TimeUnit;
invokevirtual com.mongodb.connection.ClusterSettings.getServerSelectionTimeout:(Ljava/util/concurrent/TimeUnit;)J
invokestatic java.lang.Long.valueOf:(J)Ljava/lang/Long;
aastore
22: invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokeinterface com.mongodb.diagnostics.logging.Logger.info:(Ljava/lang/String;)V
23: StackMap locals:
StackMap stack:
iconst_1
istore 3
24: StackMap locals:
StackMap stack:
aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.connect:()V
25: aload 1
lload 8
lload 6
lload 4
lsub
lsub
aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.getMinWaitTimeNanos:()J
invokestatic java.lang.Math.min:(JJ)J
getstatic java.util.concurrent.TimeUnit.NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invokevirtual java.util.concurrent.CountDownLatch.await:(JLjava/util/concurrent/TimeUnit;)Z
pop
26: invokestatic java.lang.System.nanoTime:()J
lstore 6
27: aload 0
getfield com.mongodb.internal.connection.BaseCluster.phase:Ljava/util/concurrent/atomic/AtomicReference;
invokevirtual java.util.concurrent.atomic.AtomicReference.get:()Ljava/lang/Object;
checkcast java.util.concurrent.CountDownLatch
astore 1
28: aload 0
getfield com.mongodb.internal.connection.BaseCluster.description:Lcom/mongodb/connection/ClusterDescription;
astore 2
29: StackMap locals:
StackMap stack:
aload 2
invokevirtual com.mongodb.connection.ClusterDescription.getType:()Lcom/mongodb/connection/ClusterType;
getstatic com.mongodb.connection.ClusterType.UNKNOWN:Lcom/mongodb/connection/ClusterType;
if_acmpeq 10
30: aload 2
31: areturn
end local 8 end local 6 end local 4 end local 3 end local 2 end local 1 32: StackMap locals: com.mongodb.internal.connection.BaseCluster
StackMap stack: java.lang.InterruptedException
astore 1
start local 1 33: new com.mongodb.MongoInterruptedException
dup
ldc "Interrupted while waiting to connect"
aload 1
invokespecial com.mongodb.MongoInterruptedException.<init>:(Ljava/lang/String;Ljava/lang/Exception;)V
athrow
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 34 0 this Lcom/mongodb/internal/connection/BaseCluster;
4 32 1 currentPhase Ljava/util/concurrent/CountDownLatch;
5 32 2 curDescription Lcom/mongodb/connection/ClusterDescription;
6 32 3 selectionFailureLogged Z
7 32 4 startTimeNanos J
8 32 6 curTimeNanos J
9 32 8 maxWaitTimeNanos J
33 34 1 e Ljava/lang/InterruptedException;
Exception table:
from to target type
3 31 32 Class java.lang.InterruptedException
protected com.mongodb.connection.ClusterId getClusterId();
descriptor: ()Lcom/mongodb/connection/ClusterId;
flags: (0x0004) ACC_PROTECTED
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.BaseCluster.clusterId:Lcom/mongodb/connection/ClusterId;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/mongodb/internal/connection/BaseCluster;
public com.mongodb.connection.ClusterSettings getSettings();
descriptor: ()Lcom/mongodb/connection/ClusterSettings;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.BaseCluster.settings:Lcom/mongodb/connection/ClusterSettings;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/mongodb/internal/connection/BaseCluster;
public com.mongodb.internal.connection.ClusterableServerFactory getServerFactory();
descriptor: ()Lcom/mongodb/internal/connection/ClusterableServerFactory;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.BaseCluster.serverFactory:Lcom/mongodb/internal/connection/ClusterableServerFactory;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/mongodb/internal/connection/BaseCluster;
protected abstract void connect();
descriptor: ()V
flags: (0x0404) ACC_PROTECTED, ACC_ABSTRACT
public void close();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
start local 0 0: aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.isClosed:()Z
ifne 5
1: aload 0
iconst_1
putfield com.mongodb.internal.connection.BaseCluster.isClosed:Z
2: aload 0
getfield com.mongodb.internal.connection.BaseCluster.phase:Ljava/util/concurrent/atomic/AtomicReference;
invokevirtual java.util.concurrent.atomic.AtomicReference.get:()Ljava/lang/Object;
checkcast java.util.concurrent.CountDownLatch
invokevirtual java.util.concurrent.CountDownLatch.countDown:()V
3: aload 0
getfield com.mongodb.internal.connection.BaseCluster.clusterListener:Lcom/mongodb/event/ClusterListener;
new com.mongodb.event.ClusterClosedEvent
dup
aload 0
getfield com.mongodb.internal.connection.BaseCluster.clusterId:Lcom/mongodb/connection/ClusterId;
invokespecial com.mongodb.event.ClusterClosedEvent.<init>:(Lcom/mongodb/connection/ClusterId;)V
invokeinterface com.mongodb.event.ClusterListener.clusterClosed:(Lcom/mongodb/event/ClusterClosedEvent;)V
4: aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.stopWaitQueueHandler:()V
5: StackMap locals:
StackMap stack:
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Lcom/mongodb/internal/connection/BaseCluster;
public boolean isClosed();
descriptor: ()Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.BaseCluster.isClosed:Z
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/mongodb/internal/connection/BaseCluster;
protected abstract com.mongodb.internal.connection.ClusterableServer getServer(com.mongodb.ServerAddress);
descriptor: (Lcom/mongodb/ServerAddress;)Lcom/mongodb/internal/connection/ClusterableServer;
flags: (0x0404) ACC_PROTECTED, ACC_ABSTRACT
MethodParameters:
Name Flags
serverAddress
protected synchronized void updateDescription(com.mongodb.connection.ClusterDescription);
descriptor: (Lcom/mongodb/connection/ClusterDescription;)V
flags: (0x0024) ACC_PROTECTED, ACC_SYNCHRONIZED
Code:
stack=6, locals=2, args_size=2
start local 0 start local 1 0: getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
invokeinterface com.mongodb.diagnostics.logging.Logger.isDebugEnabled:()Z
ifeq 2
1: getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
ldc "Updating cluster description to %s"
iconst_1
anewarray java.lang.Object
dup
iconst_0
aload 1
invokevirtual com.mongodb.connection.ClusterDescription.getShortDescription:()Ljava/lang/String;
aastore
invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokeinterface com.mongodb.diagnostics.logging.Logger.debug:(Ljava/lang/String;)V
2: StackMap locals:
StackMap stack:
aload 0
aload 1
putfield com.mongodb.internal.connection.BaseCluster.description:Lcom/mongodb/connection/ClusterDescription;
3: aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.updatePhase:()V
4: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lcom/mongodb/internal/connection/BaseCluster;
0 5 1 newDescription Lcom/mongodb/connection/ClusterDescription;
MethodParameters:
Name Flags
newDescription final
protected void fireChangeEvent(com.mongodb.event.ClusterDescriptionChangedEvent);
descriptor: (Lcom/mongodb/event/ClusterDescriptionChangedEvent;)V
flags: (0x0004) ACC_PROTECTED
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 0
getfield com.mongodb.internal.connection.BaseCluster.clusterListener:Lcom/mongodb/event/ClusterListener;
aload 1
invokeinterface com.mongodb.event.ClusterListener.clusterDescriptionChanged:(Lcom/mongodb/event/ClusterDescriptionChangedEvent;)V
1: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lcom/mongodb/internal/connection/BaseCluster;
0 2 1 event Lcom/mongodb/event/ClusterDescriptionChangedEvent;
MethodParameters:
Name Flags
event final
public com.mongodb.connection.ClusterDescription getCurrentDescription();
descriptor: ()Lcom/mongodb/connection/ClusterDescription;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.BaseCluster.description:Lcom/mongodb/connection/ClusterDescription;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/mongodb/internal/connection/BaseCluster;
private synchronized void updatePhase();
descriptor: ()V
flags: (0x0022) ACC_PRIVATE, ACC_SYNCHRONIZED
Code:
stack=4, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.BaseCluster.phase:Ljava/util/concurrent/atomic/AtomicReference;
new java.util.concurrent.CountDownLatch
dup
iconst_1
invokespecial java.util.concurrent.CountDownLatch.<init>:(I)V
invokevirtual java.util.concurrent.atomic.AtomicReference.getAndSet:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast java.util.concurrent.CountDownLatch
invokevirtual java.util.concurrent.CountDownLatch.countDown:()V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lcom/mongodb/internal/connection/BaseCluster;
private long getMaxWaitTimeNanos();
descriptor: ()J
flags: (0x0002) ACC_PRIVATE
Code:
stack=4, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.BaseCluster.settings:Lcom/mongodb/connection/ClusterSettings;
getstatic java.util.concurrent.TimeUnit.NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invokevirtual com.mongodb.connection.ClusterSettings.getServerSelectionTimeout:(Ljava/util/concurrent/TimeUnit;)J
lconst_0
lcmp
ifge 2
1: ldc 9223372036854775807
lreturn
2: StackMap locals:
StackMap stack:
aload 0
getfield com.mongodb.internal.connection.BaseCluster.settings:Lcom/mongodb/connection/ClusterSettings;
getstatic java.util.concurrent.TimeUnit.NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invokevirtual com.mongodb.connection.ClusterSettings.getServerSelectionTimeout:(Ljava/util/concurrent/TimeUnit;)J
lreturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lcom/mongodb/internal/connection/BaseCluster;
private long getMinWaitTimeNanos();
descriptor: ()J
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.BaseCluster.serverFactory:Lcom/mongodb/internal/connection/ClusterableServerFactory;
invokeinterface com.mongodb.internal.connection.ClusterableServerFactory.getSettings:()Lcom/mongodb/connection/ServerSettings;
getstatic java.util.concurrent.TimeUnit.NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invokevirtual com.mongodb.connection.ServerSettings.getMinHeartbeatFrequency:(Ljava/util/concurrent/TimeUnit;)J
lreturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/mongodb/internal/connection/BaseCluster;
private boolean handleServerSelectionRequest(com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest, java.util.concurrent.CountDownLatch, com.mongodb.connection.ClusterDescription);
descriptor: (Lcom/mongodb/internal/connection/BaseCluster$ServerSelectionRequest;Ljava/util/concurrent/CountDownLatch;Lcom/mongodb/connection/ClusterDescription;)Z
flags: (0x0002) ACC_PRIVATE
Code:
stack=6, locals=6, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 2
aload 1
getfield com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest.phase:Ljava/util/concurrent/CountDownLatch;
if_acmpeq 16
1: aload 1
getfield com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest.phase:Ljava/util/concurrent/CountDownLatch;
astore 4
start local 4 2: aload 1
aload 2
putfield com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest.phase:Ljava/util/concurrent/CountDownLatch;
3: aload 3
invokevirtual com.mongodb.connection.ClusterDescription.isCompatibleWithDriver:()Z
ifne 8
4: getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
invokeinterface com.mongodb.diagnostics.logging.Logger.isTraceEnabled:()Z
ifeq 6
5: getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
ldc "Asynchronously failed server selection due to driver incompatibility with server"
invokeinterface com.mongodb.diagnostics.logging.Logger.trace:(Ljava/lang/String;)V
6: StackMap locals: java.util.concurrent.CountDownLatch
StackMap stack:
aload 1
aconst_null
aload 0
aload 3
invokevirtual com.mongodb.internal.connection.BaseCluster.createIncompatibleException:(Lcom/mongodb/connection/ClusterDescription;)Lcom/mongodb/MongoIncompatibleDriverException;
invokevirtual com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest.onResult:(Lcom/mongodb/connection/Server;Ljava/lang/Throwable;)V
7: iconst_1
ireturn
8: StackMap locals:
StackMap stack:
aload 0
aload 1
getfield com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest.compositeSelector:Lcom/mongodb/selector/ServerSelector;
aload 3
invokevirtual com.mongodb.internal.connection.BaseCluster.selectRandomServer:(Lcom/mongodb/selector/ServerSelector;Lcom/mongodb/connection/ClusterDescription;)Lcom/mongodb/connection/Server;
astore 5
start local 5 9: aload 5
ifnull 14
10: getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
invokeinterface com.mongodb.diagnostics.logging.Logger.isTraceEnabled:()Z
ifeq 12
11: getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
ldc "Asynchronously selected server %s"
iconst_1
anewarray java.lang.Object
dup
iconst_0
aload 5
invokeinterface com.mongodb.connection.Server.getDescription:()Lcom/mongodb/connection/ServerDescription;
invokevirtual com.mongodb.connection.ServerDescription.getAddress:()Lcom/mongodb/ServerAddress;
aastore
invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokeinterface com.mongodb.diagnostics.logging.Logger.trace:(Ljava/lang/String;)V
12: StackMap locals: com.mongodb.connection.Server
StackMap stack:
aload 1
aload 5
aconst_null
invokevirtual com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest.onResult:(Lcom/mongodb/connection/Server;Ljava/lang/Throwable;)V
13: iconst_1
ireturn
14: StackMap locals:
StackMap stack:
aload 4
ifnonnull 16
15: aload 0
aload 1
getfield com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest.originalSelector:Lcom/mongodb/selector/ServerSelector;
aload 3
invokevirtual com.mongodb.internal.connection.BaseCluster.logServerSelectionFailure:(Lcom/mongodb/selector/ServerSelector;Lcom/mongodb/connection/ClusterDescription;)V
end local 5 end local 4 16: StackMap locals:
StackMap stack:
aload 1
invokevirtual com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest.timedOut:()Z
ifeq 21
17: getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
invokeinterface com.mongodb.diagnostics.logging.Logger.isTraceEnabled:()Z
ifeq 19
18: getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
ldc "Asynchronously failed server selection after timeout"
invokeinterface com.mongodb.diagnostics.logging.Logger.trace:(Ljava/lang/String;)V
19: StackMap locals:
StackMap stack:
aload 1
aconst_null
aload 0
aload 1
getfield com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest.originalSelector:Lcom/mongodb/selector/ServerSelector;
aload 3
invokevirtual com.mongodb.internal.connection.BaseCluster.createTimeoutException:(Lcom/mongodb/selector/ServerSelector;Lcom/mongodb/connection/ClusterDescription;)Lcom/mongodb/MongoTimeoutException;
invokevirtual com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest.onResult:(Lcom/mongodb/connection/Server;Ljava/lang/Throwable;)V
20: iconst_1
ireturn
21: StackMap locals:
StackMap stack:
iconst_0
ireturn
22: StackMap locals:
StackMap stack: java.lang.Exception
astore 4
start local 4 23: aload 1
aconst_null
aload 4
invokevirtual com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest.onResult:(Lcom/mongodb/connection/Server;Ljava/lang/Throwable;)V
24: iconst_1
ireturn
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 25 0 this Lcom/mongodb/internal/connection/BaseCluster;
0 25 1 request Lcom/mongodb/internal/connection/BaseCluster$ServerSelectionRequest;
0 25 2 currentPhase Ljava/util/concurrent/CountDownLatch;
0 25 3 description Lcom/mongodb/connection/ClusterDescription;
2 16 4 prevPhase Ljava/util/concurrent/CountDownLatch;
9 16 5 server Lcom/mongodb/connection/Server;
23 25 4 e Ljava/lang/Exception;
Exception table:
from to target type
0 7 22 Class java.lang.Exception
8 13 22 Class java.lang.Exception
14 20 22 Class java.lang.Exception
MethodParameters:
Name Flags
request final
currentPhase final
description final
private void logServerSelectionFailure(com.mongodb.selector.ServerSelector, com.mongodb.connection.ClusterDescription);
descriptor: (Lcom/mongodb/selector/ServerSelector;Lcom/mongodb/connection/ClusterDescription;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=7, locals=3, args_size=3
start local 0 start local 1 start local 2 0: getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
invokeinterface com.mongodb.diagnostics.logging.Logger.isInfoEnabled:()Z
ifeq 9
1: aload 0
getfield com.mongodb.internal.connection.BaseCluster.settings:Lcom/mongodb/connection/ClusterSettings;
getstatic java.util.concurrent.TimeUnit.MILLISECONDS:Ljava/util/concurrent/TimeUnit;
invokevirtual com.mongodb.connection.ClusterSettings.getServerSelectionTimeout:(Ljava/util/concurrent/TimeUnit;)J
lconst_0
lcmp
ifge 6
2: getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
ldc "No server chosen by %s from cluster description %s. Waiting indefinitely."
iconst_2
anewarray java.lang.Object
dup
iconst_0
3: aload 1
aastore
dup
iconst_1
aload 2
aastore
4: invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokeinterface com.mongodb.diagnostics.logging.Logger.info:(Ljava/lang/String;)V
5: goto 9
6: StackMap locals:
StackMap stack:
getstatic com.mongodb.internal.connection.BaseCluster.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
ldc "No server chosen by %s from cluster description %s. Waiting for %d ms before timing out"
iconst_3
anewarray java.lang.Object
dup
iconst_0
7: aload 1
aastore
dup
iconst_1
aload 2
aastore
dup
iconst_2
aload 0
getfield com.mongodb.internal.connection.BaseCluster.settings:Lcom/mongodb/connection/ClusterSettings;
getstatic java.util.concurrent.TimeUnit.MILLISECONDS:Ljava/util/concurrent/TimeUnit;
invokevirtual com.mongodb.connection.ClusterSettings.getServerSelectionTimeout:(Ljava/util/concurrent/TimeUnit;)J
invokestatic java.lang.Long.valueOf:(J)Ljava/lang/Long;
aastore
8: invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokeinterface com.mongodb.diagnostics.logging.Logger.info:(Ljava/lang/String;)V
9: StackMap locals:
StackMap stack:
return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 10 0 this Lcom/mongodb/internal/connection/BaseCluster;
0 10 1 serverSelector Lcom/mongodb/selector/ServerSelector;
0 10 2 curDescription Lcom/mongodb/connection/ClusterDescription;
MethodParameters:
Name Flags
serverSelector final
curDescription final
private com.mongodb.connection.Server selectRandomServer(com.mongodb.selector.ServerSelector, com.mongodb.connection.ClusterDescription);
descriptor: (Lcom/mongodb/selector/ServerSelector;Lcom/mongodb/connection/ClusterDescription;)Lcom/mongodb/connection/Server;
flags: (0x0002) ACC_PRIVATE
Code:
stack=4, locals=4, args_size=3
start local 0 start local 1 start local 2 0: aload 1
aload 2
invokeinterface com.mongodb.selector.ServerSelector.select:(Lcom/mongodb/connection/ClusterDescription;)Ljava/util/List;
astore 3
start local 3 1: aload 3
invokeinterface java.util.List.isEmpty:()Z
ifne 3
2: aload 0
new java.util.ArrayList
dup
aload 3
invokespecial java.util.ArrayList.<init>:(Ljava/util/Collection;)V
invokevirtual com.mongodb.internal.connection.BaseCluster.getRandomServer:(Ljava/util/List;)Lcom/mongodb/internal/connection/ClusterableServer;
areturn
3: StackMap locals: java.util.List
StackMap stack:
aconst_null
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 this Lcom/mongodb/internal/connection/BaseCluster;
0 4 1 serverSelector Lcom/mongodb/selector/ServerSelector;
0 4 2 clusterDescription Lcom/mongodb/connection/ClusterDescription;
1 4 3 serverDescriptions Ljava/util/List<Lcom/mongodb/connection/ServerDescription;>;
MethodParameters:
Name Flags
serverSelector final
clusterDescription final
private com.mongodb.selector.ServerSelector getCompositeServerSelector(com.mongodb.selector.ServerSelector);
descriptor: (Lcom/mongodb/selector/ServerSelector;)Lcom/mongodb/selector/ServerSelector;
flags: (0x0002) ACC_PRIVATE
Code:
stack=6, locals=2, args_size=2
start local 0 start local 1 0: aload 0
getfield com.mongodb.internal.connection.BaseCluster.settings:Lcom/mongodb/connection/ClusterSettings;
invokevirtual com.mongodb.connection.ClusterSettings.getServerSelector:()Lcom/mongodb/selector/ServerSelector;
ifnonnull 2
1: aload 1
areturn
2: StackMap locals:
StackMap stack:
new com.mongodb.selector.CompositeServerSelector
dup
iconst_2
anewarray com.mongodb.selector.ServerSelector
dup
iconst_0
aload 1
aastore
dup
iconst_1
aload 0
getfield com.mongodb.internal.connection.BaseCluster.settings:Lcom/mongodb/connection/ClusterSettings;
invokevirtual com.mongodb.connection.ClusterSettings.getServerSelector:()Lcom/mongodb/selector/ServerSelector;
aastore
invokestatic java.util.Arrays.asList:([Ljava/lang/Object;)Ljava/util/List;
invokespecial com.mongodb.selector.CompositeServerSelector.<init>:(Ljava/util/List;)V
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lcom/mongodb/internal/connection/BaseCluster;
0 3 1 serverSelector Lcom/mongodb/selector/ServerSelector;
MethodParameters:
Name Flags
serverSelector final
private com.mongodb.internal.connection.ClusterableServer getRandomServer(java.util.List<com.mongodb.connection.ServerDescription>);
descriptor: (Ljava/util/List;)Lcom/mongodb/internal/connection/ClusterableServer;
flags: (0x0002) ACC_PRIVATE
Code:
stack=3, locals=4, args_size=2
start local 0 start local 1 0: goto 6
1: StackMap locals:
StackMap stack:
aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.getRandom:()Ljava/util/Random;
aload 1
invokeinterface java.util.List.size:()I
invokevirtual java.util.Random.nextInt:(I)I
istore 2
start local 2 2: aload 0
aload 1
iload 2
invokeinterface java.util.List.get:(I)Ljava/lang/Object;
checkcast com.mongodb.connection.ServerDescription
invokevirtual com.mongodb.connection.ServerDescription.getAddress:()Lcom/mongodb/ServerAddress;
invokevirtual com.mongodb.internal.connection.BaseCluster.getServer:(Lcom/mongodb/ServerAddress;)Lcom/mongodb/internal/connection/ClusterableServer;
astore 3
start local 3 3: aload 3
ifnull 5
4: aload 3
areturn
5: StackMap locals: int com.mongodb.internal.connection.ClusterableServer
StackMap stack:
aload 1
iload 2
invokeinterface java.util.List.remove:(I)Ljava/lang/Object;
pop
end local 3 end local 2 6: StackMap locals:
StackMap stack:
aload 1
invokeinterface java.util.List.isEmpty:()Z
ifeq 1
7: aconst_null
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 this Lcom/mongodb/internal/connection/BaseCluster;
0 8 1 serverDescriptions Ljava/util/List<Lcom/mongodb/connection/ServerDescription;>;
2 6 2 serverPos I
3 6 3 server Lcom/mongodb/internal/connection/ClusterableServer;
Signature: (Ljava/util/List<Lcom/mongodb/connection/ServerDescription;>;)Lcom/mongodb/internal/connection/ClusterableServer;
MethodParameters:
Name Flags
serverDescriptions final
private java.util.Random getRandom();
descriptor: ()Ljava/util/Random;
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=2, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.BaseCluster.random:Ljava/lang/ThreadLocal;
invokevirtual java.lang.ThreadLocal.get:()Ljava/lang/Object;
checkcast java.util.Random
astore 1
start local 1 1: aload 1
ifnonnull 4
2: new java.util.Random
dup
invokespecial java.util.Random.<init>:()V
astore 1
3: aload 0
getfield com.mongodb.internal.connection.BaseCluster.random:Ljava/lang/ThreadLocal;
aload 1
invokevirtual java.lang.ThreadLocal.set:(Ljava/lang/Object;)V
4: StackMap locals: java.util.Random
StackMap stack:
aload 1
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lcom/mongodb/internal/connection/BaseCluster;
1 5 1 result Ljava/util/Random;
protected com.mongodb.internal.connection.ClusterableServer createServer(com.mongodb.ServerAddress, com.mongodb.event.ServerListener);
descriptor: (Lcom/mongodb/ServerAddress;Lcom/mongodb/event/ServerListener;)Lcom/mongodb/internal/connection/ClusterableServer;
flags: (0x0004) ACC_PROTECTED
Code:
stack=4, locals=3, args_size=3
start local 0 start local 1 start local 2 0: aload 0
getfield com.mongodb.internal.connection.BaseCluster.serverFactory:Lcom/mongodb/internal/connection/ClusterableServerFactory;
aload 1
aload 0
getfield com.mongodb.internal.connection.BaseCluster.serverFactory:Lcom/mongodb/internal/connection/ClusterableServerFactory;
invokeinterface com.mongodb.internal.connection.ClusterableServerFactory.getSettings:()Lcom/mongodb/connection/ServerSettings;
aload 2
invokestatic com.mongodb.internal.event.EventListenerHelper.createServerListener:(Lcom/mongodb/connection/ServerSettings;Lcom/mongodb/event/ServerListener;)Lcom/mongodb/event/ServerListener;
aload 0
getfield com.mongodb.internal.connection.BaseCluster.clusterClock:Lcom/mongodb/internal/connection/ClusterClock;
invokeinterface com.mongodb.internal.connection.ClusterableServerFactory.create:(Lcom/mongodb/ServerAddress;Lcom/mongodb/event/ServerListener;Lcom/mongodb/internal/connection/ClusterClock;)Lcom/mongodb/internal/connection/ClusterableServer;
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/mongodb/internal/connection/BaseCluster;
0 1 1 serverAddress Lcom/mongodb/ServerAddress;
0 1 2 serverListener Lcom/mongodb/event/ServerListener;
MethodParameters:
Name Flags
serverAddress final
serverListener final
private void throwIfIncompatible(com.mongodb.connection.ClusterDescription);
descriptor: (Lcom/mongodb/connection/ClusterDescription;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 1
invokevirtual com.mongodb.connection.ClusterDescription.isCompatibleWithDriver:()Z
ifne 2
1: aload 0
aload 1
invokevirtual com.mongodb.internal.connection.BaseCluster.createIncompatibleException:(Lcom/mongodb/connection/ClusterDescription;)Lcom/mongodb/MongoIncompatibleDriverException;
athrow
2: StackMap locals:
StackMap stack:
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lcom/mongodb/internal/connection/BaseCluster;
0 3 1 curDescription Lcom/mongodb/connection/ClusterDescription;
MethodParameters:
Name Flags
curDescription final
private com.mongodb.MongoIncompatibleDriverException createIncompatibleException(com.mongodb.connection.ClusterDescription);
descriptor: (Lcom/mongodb/connection/ClusterDescription;)Lcom/mongodb/MongoIncompatibleDriverException;
flags: (0x0002) ACC_PRIVATE
Code:
stack=5, locals=4, args_size=2
start local 0 start local 1 0: aload 1
invokevirtual com.mongodb.connection.ClusterDescription.findServerIncompatiblyOlderThanDriver:()Lcom/mongodb/connection/ServerDescription;
astore 3
start local 3 1: aload 3
ifnull 7
2: ldc "Server at %s reports wire version %d, but this version of the driver requires at least %d (MongoDB %s)."
iconst_4
anewarray java.lang.Object
dup
iconst_0
3: aload 3
invokevirtual com.mongodb.connection.ServerDescription.getAddress:()Lcom/mongodb/ServerAddress;
aastore
dup
iconst_1
aload 3
invokevirtual com.mongodb.connection.ServerDescription.getMaxWireVersion:()I
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
dup
iconst_2
4: iconst_2
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
dup
iconst_3
ldc "2.6"
aastore
5: invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
astore 2
start local 2 6: goto 11
end local 2 7: StackMap locals: com.mongodb.internal.connection.BaseCluster com.mongodb.connection.ClusterDescription top com.mongodb.connection.ServerDescription
StackMap stack:
aload 1
invokevirtual com.mongodb.connection.ClusterDescription.findServerIncompatiblyNewerThanDriver:()Lcom/mongodb/connection/ServerDescription;
astore 3
8: ldc "Server at %s requires wire version %d, but this version of the driver only supports up to %d."
iconst_3
anewarray java.lang.Object
dup
iconst_0
9: aload 3
invokevirtual com.mongodb.connection.ServerDescription.getAddress:()Lcom/mongodb/ServerAddress;
aastore
dup
iconst_1
aload 3
invokevirtual com.mongodb.connection.ServerDescription.getMinWireVersion:()I
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
dup
iconst_2
bipush 8
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
10: invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
astore 2
start local 2 11: StackMap locals: com.mongodb.internal.connection.BaseCluster com.mongodb.connection.ClusterDescription java.lang.String com.mongodb.connection.ServerDescription
StackMap stack:
new com.mongodb.MongoIncompatibleDriverException
dup
aload 2
aload 1
invokespecial com.mongodb.MongoIncompatibleDriverException.<init>:(Ljava/lang/String;Lcom/mongodb/connection/ClusterDescription;)V
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 12 0 this Lcom/mongodb/internal/connection/BaseCluster;
0 12 1 curDescription Lcom/mongodb/connection/ClusterDescription;
6 7 2 message Ljava/lang/String;
11 12 2 message Ljava/lang/String;
1 12 3 incompatibleServer Lcom/mongodb/connection/ServerDescription;
MethodParameters:
Name Flags
curDescription final
private com.mongodb.MongoTimeoutException createTimeoutException(com.mongodb.selector.ServerSelector, com.mongodb.connection.ClusterDescription);
descriptor: (Lcom/mongodb/selector/ServerSelector;Lcom/mongodb/connection/ClusterDescription;)Lcom/mongodb/MongoTimeoutException;
flags: (0x0002) ACC_PRIVATE
Code:
stack=8, locals=3, args_size=3
start local 0 start local 1 start local 2 0: new com.mongodb.MongoTimeoutException
dup
ldc "Timed out after %d ms while waiting for a server that matches %s. Client view of cluster state is %s"
iconst_3
anewarray java.lang.Object
dup
iconst_0
1: aload 0
getfield com.mongodb.internal.connection.BaseCluster.settings:Lcom/mongodb/connection/ClusterSettings;
getstatic java.util.concurrent.TimeUnit.MILLISECONDS:Ljava/util/concurrent/TimeUnit;
invokevirtual com.mongodb.connection.ClusterSettings.getServerSelectionTimeout:(Ljava/util/concurrent/TimeUnit;)J
invokestatic java.lang.Long.valueOf:(J)Ljava/lang/Long;
aastore
dup
iconst_1
aload 1
aastore
dup
iconst_2
2: aload 2
invokevirtual com.mongodb.connection.ClusterDescription.getShortDescription:()Ljava/lang/String;
aastore
3: invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokespecial com.mongodb.MongoTimeoutException.<init>:(Ljava/lang/String;)V
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 this Lcom/mongodb/internal/connection/BaseCluster;
0 4 1 serverSelector Lcom/mongodb/selector/ServerSelector;
0 4 2 curDescription Lcom/mongodb/connection/ClusterDescription;
MethodParameters:
Name Flags
serverSelector final
curDescription final
private com.mongodb.MongoWaitQueueFullException createWaitQueueFullException();
descriptor: ()Lcom/mongodb/MongoWaitQueueFullException;
flags: (0x0002) ACC_PRIVATE
Code:
stack=7, locals=1, args_size=1
start local 0 0: new com.mongodb.MongoWaitQueueFullException
dup
ldc "Too many operations are already waiting for a server. Max number of operations (maxWaitQueueSize) of %d has been exceeded."
iconst_1
anewarray java.lang.Object
dup
iconst_0
1: aload 0
getfield com.mongodb.internal.connection.BaseCluster.settings:Lcom/mongodb/connection/ClusterSettings;
invokevirtual com.mongodb.connection.ClusterSettings.getMaxWaitQueueSize:()I
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
2: invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokespecial com.mongodb.MongoWaitQueueFullException.<init>:(Ljava/lang/String;)V
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lcom/mongodb/internal/connection/BaseCluster;
private synchronized void notifyWaitQueueHandler(com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest);
descriptor: (Lcom/mongodb/internal/connection/BaseCluster$ServerSelectionRequest;)V
flags: (0x0022) ACC_PRIVATE, ACC_SYNCHRONIZED
Code:
stack=7, locals=2, args_size=2
start local 0 start local 1 0: aload 0
getfield com.mongodb.internal.connection.BaseCluster.isClosed:Z
ifeq 2
1: return
2: StackMap locals:
StackMap stack:
aload 0
getfield com.mongodb.internal.connection.BaseCluster.waitQueueSize:Ljava/util/concurrent/atomic/AtomicInteger;
invokevirtual java.util.concurrent.atomic.AtomicInteger.incrementAndGet:()I
aload 0
getfield com.mongodb.internal.connection.BaseCluster.settings:Lcom/mongodb/connection/ClusterSettings;
invokevirtual com.mongodb.connection.ClusterSettings.getMaxWaitQueueSize:()I
if_icmple 6
3: aload 0
getfield com.mongodb.internal.connection.BaseCluster.waitQueueSize:Ljava/util/concurrent/atomic/AtomicInteger;
invokevirtual java.util.concurrent.atomic.AtomicInteger.decrementAndGet:()I
pop
4: aload 1
aconst_null
aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.createWaitQueueFullException:()Lcom/mongodb/MongoWaitQueueFullException;
invokevirtual com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest.onResult:(Lcom/mongodb/connection/Server;Ljava/lang/Throwable;)V
5: goto 13
6: StackMap locals:
StackMap stack:
aload 0
getfield com.mongodb.internal.connection.BaseCluster.waitQueue:Ljava/util/Deque;
aload 1
invokeinterface java.util.Deque.add:(Ljava/lang/Object;)Z
pop
7: aload 0
getfield com.mongodb.internal.connection.BaseCluster.waitQueueHandler:Ljava/lang/Thread;
ifnonnull 12
8: aload 0
new java.lang.Thread
dup
new com.mongodb.internal.connection.BaseCluster$WaitQueueHandler
dup
aload 0
invokespecial com.mongodb.internal.connection.BaseCluster$WaitQueueHandler.<init>:(Lcom/mongodb/internal/connection/BaseCluster;)V
new java.lang.StringBuilder
dup
ldc "cluster-"
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 0
getfield com.mongodb.internal.connection.BaseCluster.clusterId:Lcom/mongodb/connection/ClusterId;
invokevirtual com.mongodb.connection.ClusterId.getValue:()Ljava/lang/String;
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.lang.Thread.<init>:(Ljava/lang/Runnable;Ljava/lang/String;)V
putfield com.mongodb.internal.connection.BaseCluster.waitQueueHandler:Ljava/lang/Thread;
9: aload 0
getfield com.mongodb.internal.connection.BaseCluster.waitQueueHandler:Ljava/lang/Thread;
iconst_1
invokevirtual java.lang.Thread.setDaemon:(Z)V
10: aload 0
getfield com.mongodb.internal.connection.BaseCluster.waitQueueHandler:Ljava/lang/Thread;
invokevirtual java.lang.Thread.start:()V
11: goto 13
12: StackMap locals:
StackMap stack:
aload 0
invokevirtual com.mongodb.internal.connection.BaseCluster.updatePhase:()V
13: StackMap locals:
StackMap stack:
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 14 0 this Lcom/mongodb/internal/connection/BaseCluster;
0 14 1 request Lcom/mongodb/internal/connection/BaseCluster$ServerSelectionRequest;
MethodParameters:
Name Flags
request final
private synchronized void stopWaitQueueHandler();
descriptor: ()V
flags: (0x0022) ACC_PRIVATE, ACC_SYNCHRONIZED
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.BaseCluster.waitQueueHandler:Ljava/lang/Thread;
ifnull 2
1: aload 0
getfield com.mongodb.internal.connection.BaseCluster.waitQueueHandler:Ljava/lang/Thread;
invokevirtual java.lang.Thread.interrupt:()V
2: StackMap locals:
StackMap stack:
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lcom/mongodb/internal/connection/BaseCluster;
}
SourceFile: "BaseCluster.java"
NestMembers:
com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest com.mongodb.internal.connection.BaseCluster$WaitQueueHandler
InnerClasses:
private final ServerSelectionRequest = com.mongodb.internal.connection.BaseCluster$ServerSelectionRequest of com.mongodb.internal.connection.BaseCluster
private final WaitQueueHandler = com.mongodb.internal.connection.BaseCluster$WaitQueueHandler of com.mongodb.internal.connection.BaseCluster