Skip to content

Commit 8f1fbbb

Browse files
committed
Update visibility.
1 parent a911780 commit 8f1fbbb

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

driver-core/src/main/com/mongodb/internal/connection/BaseCluster.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
import static com.mongodb.connection.ServerDescription.MIN_DRIVER_WIRE_VERSION;
6969
import static com.mongodb.internal.Locks.withInterruptibleLock;
7070
import static com.mongodb.internal.VisibleForTesting.AccessModifier.PRIVATE;
71-
import static com.mongodb.internal.VisibleForTesting.AccessModifier.PROTECTED;
7271
import static com.mongodb.internal.connection.EventHelper.wouldDescriptionsGenerateEquivalentEvents;
7372
import static com.mongodb.internal.event.EventListenerHelper.singleClusterListener;
7473
import static com.mongodb.internal.logging.LogMessage.Component.SERVER_SELECTION;
@@ -95,8 +94,7 @@
9594
import static java.util.concurrent.TimeUnit.NANOSECONDS;
9695
import static java.util.stream.Collectors.toList;
9796

98-
@VisibleForTesting(otherwise = PROTECTED)
99-
public abstract class BaseCluster implements Cluster {
97+
abstract class BaseCluster implements Cluster {
10098
private static final Logger LOGGER = Loggers.getLogger("cluster");
10199
private static final StructuredLogger STRUCTURED_LOGGER = new StructuredLogger("cluster");
102100

driver-core/src/main/com/mongodb/internal/connection/OperationContext.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,7 @@ ServerSelector apply(final ServerSelector wrappedSelector) {
241241
return new DeprioritizingSelector(wrappedSelector);
242242
}
243243

244-
@VisibleForTesting(otherwise = PACKAGE)
245-
public void updateCandidate(final ServerAddress serverAddress, final ClusterType clusterType) {
244+
void updateCandidate(final ServerAddress serverAddress, final ClusterType clusterType) {
246245
this.candidate = serverAddress;
247246
this.clusterType = clusterType;
248247
}
@@ -253,7 +252,7 @@ public void onAttemptFailure(final Throwable failure) {
253252
return;
254253
}
255254

256-
boolean isSystemOverloadedError = failure instanceof MongoException
255+
boolean isSystemOverloadedError = failure instanceof MongoException
257256
&& ((MongoException) failure).hasErrorLabel(SYSTEM_OVERLOADED_ERROR_LABEL);
258257
if (clusterType == ClusterType.SHARDED || isSystemOverloadedError) {
259258
deprioritized.add(candidate);

driver-core/src/main/com/mongodb/internal/operation/AsyncChangeStreamBatchCursor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ final class AsyncChangeStreamBatchCursor<T> implements AsyncAggregateResponseBat
7373
this.wrapped = new AtomicReference<>(assertNotNull(wrapped));
7474
this.binding = binding;
7575
binding.retain();
76-
this.initialOperationContext = operationContext.withOverride(TimeoutContext::withMaxTimeAsMaxAwaitTimeOverride);
76+
this.initialOperationContext = operationContext
77+
.withOverride(TimeoutContext::withMaxTimeAsMaxAwaitTimeOverride)
78+
.withNewServerDeprioritization();
7779
this.resumeToken = resumeToken;
7880
this.maxWireVersion = maxWireVersion;
7981
isClosed = new AtomicBoolean();

driver-sync/src/test/functional/com/mongodb/client/AbstractRetryableReadsProseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public abstract class AbstractRetryableReadsProseTest {
5353

5454
private static final String COLLECTION_NAME = "test";
5555

56-
protected abstract MongoClient createClient(final MongoClientSettings settings);
56+
protected abstract MongoClient createClient(MongoClientSettings settings);
5757

5858
@AfterEach
5959
void afterEach() {

0 commit comments

Comments
 (0)