@@ -121,7 +121,7 @@ public ServerTuple selectServer(final ServerSelector serverSelector, final Opera
121
121
try {
122
122
CountDownLatch currentPhase = phase .get ();
123
123
ClusterDescription curDescription = description ;
124
- logServerSelectionStarted (operationContext , serverSelector , curDescription );
124
+ logServerSelectionStarted (clusterId , operationContext , serverSelector , curDescription );
125
125
ServerSelector compositeServerSelector = getCompositeServerSelector (serverSelector );
126
126
ServerTuple serverTuple = selectServer (compositeServerSelector , curDescription );
127
127
@@ -137,7 +137,8 @@ public ServerTuple selectServer(final ServerSelector serverSelector, final Opera
137
137
}
138
138
139
139
if (serverTuple != null ) {
140
- logServerSelectionSucceeded (operationContext , serverTuple .getServerDescription ().getAddress (), serverSelector , curDescription );
140
+ logServerSelectionSucceeded (
141
+ clusterId , operationContext , serverTuple .getServerDescription ().getAddress (), serverSelector , curDescription );
141
142
return serverTuple ;
142
143
}
143
144
@@ -148,7 +149,7 @@ public ServerTuple selectServer(final ServerSelector serverSelector, final Opera
148
149
}
149
150
150
151
if (!selectionWaitingLogged ) {
151
- logServerSelectionWaiting (operationContext , remainingTimeNanos , serverSelector , curDescription );
152
+ logServerSelectionWaiting (clusterId , operationContext , remainingTimeNanos , serverSelector , curDescription );
152
153
selectionWaitingLogged = true ;
153
154
}
154
155
@@ -178,7 +179,7 @@ public void selectServerAsync(final ServerSelector serverSelector, final Operati
178
179
CountDownLatch currentPhase = phase .get ();
179
180
ClusterDescription currentDescription = description ;
180
181
181
- logServerSelectionStarted (operationContext , serverSelector , currentDescription );
182
+ logServerSelectionStarted (clusterId , operationContext , serverSelector , currentDescription );
182
183
ServerSelectionRequest request = new ServerSelectionRequest (operationContext , serverSelector , getCompositeServerSelector (serverSelector ),
183
184
getMaxWaitTimeNanos (), callback );
184
185
@@ -277,13 +278,14 @@ private boolean handleServerSelectionRequest(final ServerSelectionRequest reques
277
278
278
279
ServerTuple serverTuple = selectServer (request .compositeSelector , description );
279
280
if (serverTuple != null ) {
280
- logServerSelectionSucceeded (
281
- request .operationContext , serverTuple . getServerDescription (). getAddress (), request . originalSelector , description );
281
+ logServerSelectionSucceeded (clusterId , request . operationContext , serverTuple . getServerDescription (). getAddress (),
282
+ request .originalSelector , description );
282
283
request .onResult (serverTuple , null );
283
284
return true ;
284
285
}
285
286
if (prevPhase == null ) {
286
- logServerSelectionWaiting (request .operationContext , request .getRemainingTime (), request .originalSelector , description );
287
+ logServerSelectionWaiting (
288
+ clusterId , request .operationContext , request .getRemainingTime (), request .originalSelector , description );
287
289
}
288
290
}
289
291
@@ -360,7 +362,7 @@ private MongoIncompatibleDriverException createAndLogIncompatibleException(
360
362
final ServerSelector serverSelector ,
361
363
final ClusterDescription clusterDescription ) {
362
364
MongoIncompatibleDriverException exception = createIncompatibleException (clusterDescription );
363
- logServerSelectionFailed (operationContext , exception , serverSelector , clusterDescription );
365
+ logServerSelectionFailed (clusterId , operationContext , exception , serverSelector , clusterDescription );
364
366
return exception ;
365
367
}
366
368
@@ -390,7 +392,7 @@ private MongoException createAndLogTimeoutException(
390
392
MongoTimeoutException exception = new MongoTimeoutException (format (
391
393
"Timed out while waiting for a server that matches %s. Client view of cluster state is %s" ,
392
394
serverSelector , clusterDescription .getShortDescription ()));
393
- logServerSelectionFailed (operationContext , exception , serverSelector , clusterDescription );
395
+ logServerSelectionFailed (clusterId , operationContext , exception , serverSelector , clusterDescription );
394
396
return exception ;
395
397
}
396
398
@@ -498,7 +500,8 @@ public void run() {
498
500
}
499
501
}
500
502
501
- private void logServerSelectionStarted (
503
+ static void logServerSelectionStarted (
504
+ final ClusterId clusterId ,
502
505
final OperationContext operationContext ,
503
506
final ServerSelector serverSelector ,
504
507
final ClusterDescription clusterDescription ) {
@@ -514,7 +517,8 @@ private void logServerSelectionStarted(
514
517
}
515
518
}
516
519
517
- private void logServerSelectionWaiting (
520
+ private static void logServerSelectionWaiting (
521
+ final ClusterId clusterId ,
518
522
final OperationContext operationContext ,
519
523
@ Nullable
520
524
final Long remainingTimeNanos ,
@@ -534,7 +538,8 @@ private void logServerSelectionWaiting(
534
538
}
535
539
}
536
540
537
- private void logServerSelectionFailed (
541
+ private static void logServerSelectionFailed (
542
+ final ClusterId clusterId ,
538
543
final OperationContext operationContext ,
539
544
final MongoException failure ,
540
545
final ServerSelector serverSelector ,
@@ -558,7 +563,8 @@ private void logServerSelectionFailed(
558
563
}
559
564
}
560
565
561
- private void logServerSelectionSucceeded (
566
+ static void logServerSelectionSucceeded (
567
+ final ClusterId clusterId ,
562
568
final OperationContext operationContext ,
563
569
final ServerAddress serverAddress ,
564
570
final ServerSelector serverSelector ,
0 commit comments