Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e95ca0b
Direct retries to another mongos if one is available
stIncMale Apr 14, 2024
d1c1ed2
Implement specification prose tests
stIncMale Apr 17, 2024
0875e5d
Fix a typo
stIncMale Apr 17, 2024
6fe3db1
Expect `MongoServerException` instead of just `RuntimeException`
stIncMale Apr 18, 2024
7cba88b
Fix `ServerDeprioritization.onAttemptFailure`
stIncMale Apr 30, 2024
da6d111
Merge branch 'master' into JAVA-4254
stIncMale Apr 30, 2024
e4ffab4
Replace BiFunction with BinaryOperator
stIncMale Apr 30, 2024
29ebd76
Update driver-core/src/main/com/mongodb/internal/connection/Operation…
stIncMale May 2, 2024
6574e24
Trivial code improvements
stIncMale May 2, 2024
171d67e
Update the docs of the internal API for retries to reflect support of…
stIncMale May 3, 2024
4d883c1
Merge branch 'master' into JAVA-4254
stIncMale May 3, 2024
d25010d
Refactor the way `BaseCluster.selectServer` deals with the race condi…
stIncMale May 6, 2024
cc8021e
Refactor the server selection logic that is implemented not as a `Ser…
stIncMale May 7, 2024
b3430bd
Implement `DeprioritizingSelector` strictly according to the spec req…
stIncMale May 7, 2024
16df106
Merge branch 'master' into JAVA-4254
stIncMale May 7, 2024
04880c7
Do minor touches
stIncMale May 7, 2024
c1e9e4e
Update the documentation of `ClusterSettings.getServerSelector`
stIncMale May 7, 2024
246353f
Address review concerns
stIncMale May 8, 2024
69b78ff
Implement the proposed code simplification
stIncMale May 8, 2024
cbb1938
Link from `BaseClusterTest` back to `BaseClusterSpecification`
stIncMale May 8, 2024
05f6679
Simplify `MinimumOperationCountServerSelector.select`
stIncMale May 23, 2024
d55c44f
Extract `raceConditionPreFiltering` into a separate method and remove…
stIncMale May 24, 2024
7debec0
Merge branch 'master' into JAVA-4254
stIncMale May 24, 2024
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace BiFunction with BinaryOperator
  • Loading branch information
stIncMale committed Apr 30, 2024
commit e4ffab42ff04e943bd2b9fcdf2689ec3d499b7ad
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

import java.util.Collections;
import java.util.List;
import java.util.function.BiFunction;
import java.util.function.BinaryOperator;

import static com.mongodb.assertions.Assertions.assertNotNull;
import static com.mongodb.internal.async.ErrorHandlingResultCallback.errorHandlingCallback;
Expand Down Expand Up @@ -286,7 +286,7 @@ static <D, T> void createReadCommandAndExecuteAsync(

static <R> AsyncCallbackSupplier<R> decorateReadWithRetriesAsync(final RetryState retryState, final OperationContext operationContext,
final AsyncCallbackSupplier<R> asyncReadFunction) {
BiFunction<Throwable, Throwable, Throwable> onAttemptFailure =
BinaryOperator<Throwable> onAttemptFailure =
(@Nullable Throwable previouslyChosenException, Throwable mostRecentAttemptException) ->
CommandOperationHelper.onRetryableReadAttemptFailure(
operationContext, previouslyChosenException, mostRecentAttemptException);
Expand All @@ -299,7 +299,7 @@ static <R> AsyncCallbackSupplier<R> decorateReadWithRetriesAsync(final RetryStat

static <R> AsyncCallbackSupplier<R> decorateWriteWithRetriesAsync(final RetryState retryState, final OperationContext operationContext,
final AsyncCallbackSupplier<R> asyncWriteFunction) {
BiFunction<Throwable, Throwable, Throwable> onAttemptFailure =
BinaryOperator<Throwable> onAttemptFailure =
(@Nullable Throwable previouslyChosenException, Throwable mostRecentAttemptException) ->
CommandOperationHelper.onRetryableWriteAttemptFailure(
operationContext, previouslyChosenException, mostRecentAttemptException);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.function.BiFunction;
import java.util.function.BinaryOperator;
import java.util.function.Supplier;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -141,7 +141,7 @@ public Boolean getRetryWrites() {

private <R> Supplier<R> decorateWriteWithRetries(final RetryState retryState, final OperationContext operationContext,
final Supplier<R> writeFunction) {
BiFunction<Throwable, Throwable, Throwable> onAttemptFailure =
BinaryOperator<Throwable> onAttemptFailure =
(@Nullable Throwable previouslyChosenException, Throwable mostRecentAttemptException) ->
CommandOperationHelper.onRetryableWriteAttemptFailure(
operationContext, previouslyChosenException, mostRecentAttemptException);
Expand All @@ -154,7 +154,7 @@ private <R> Supplier<R> decorateWriteWithRetries(final RetryState retryState, fi

private <R> AsyncCallbackSupplier<R> decorateWriteWithRetries(final RetryState retryState, final OperationContext operationContext,
final AsyncCallbackSupplier<R> writeFunction) {
BiFunction<Throwable, Throwable, Throwable> onAttemptFailure =
BinaryOperator<Throwable> onAttemptFailure =
(@Nullable Throwable previouslyChosenException, Throwable mostRecentAttemptException) ->
CommandOperationHelper.onRetryableWriteAttemptFailure(
operationContext, previouslyChosenException, mostRecentAttemptException);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.bson.codecs.Decoder;

import java.util.function.BiFunction;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.function.Supplier;

Expand Down Expand Up @@ -274,7 +275,7 @@ static <D, T> T createReadCommandAndExecute(

static <R> Supplier<R> decorateWriteWithRetries(final RetryState retryState,
final OperationContext operationContext, final Supplier<R> writeFunction) {
BiFunction<Throwable, Throwable, Throwable> onAttemptFailure =
BinaryOperator<Throwable> onAttemptFailure =
(@Nullable Throwable previouslyChosenException, Throwable mostRecentAttemptException) ->
CommandOperationHelper.onRetryableWriteAttemptFailure(
operationContext, previouslyChosenException, mostRecentAttemptException);
Expand All @@ -287,7 +288,7 @@ static <R> Supplier<R> decorateWriteWithRetries(final RetryState retryState,

static <R> Supplier<R> decorateReadWithRetries(final RetryState retryState, final OperationContext operationContext,
final Supplier<R> readFunction) {
BiFunction<Throwable, Throwable, Throwable> onAttemptFailure =
BinaryOperator<Throwable> onAttemptFailure =
(@Nullable Throwable previouslyChosenException, Throwable mostRecentAttemptException) ->
CommandOperationHelper.onRetryableReadAttemptFailure(
operationContext, previouslyChosenException, mostRecentAttemptException);
Expand Down