Skip to content

Move legacy write operations into driver-legacy #1030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 11, 2022

Conversation

jyemin
Copy link
Collaborator

@jyemin jyemin commented Oct 31, 2022

JAVA-4795

  • Deleted Insert/Update/Delete Operation since they served no useful function
  • Moved BaseWriteOperation into driver-legacy and refactored it so it could server all three write types
  • Moved and consolidated the functional tests

@jyemin jyemin self-assigned this Oct 31, 2022
@jyemin jyemin requested a review from stIncMale October 31, 2022 18:32
Comment on lines 43 to 45
* Abstract base class for legacy write operations.
*/
public abstract class BaseWriteOperation implements AsyncWriteOperation<WriteConcernResult>, WriteOperation<WriteConcernResult> {
class LegacyMixedBulkWriteOperation implements WriteOperation<WriteConcernResult> {
Copy link
Member

@stIncMale stIncMale Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is no longer abstract, but the doc still says it is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

final boolean retryWrites, final List<? extends WriteRequest> writeRequests) {
this.writeRequests = notNull("writeRequests", writeRequests);
isTrueArgument("writeRequests not empty", !writeRequests.isEmpty());
this.type = writeRequests.get(0).getType();
Copy link
Member

@stIncMale stIncMale Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be nothing preventing writeRequests from containing requests of different types. We can change this by making the constructor private and exposing static methods that take lists of specific types of requests.

Copy link
Collaborator Author

@jyemin jyemin Nov 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@jyemin jyemin requested a review from stIncMale November 11, 2022 01:39
@jyemin
Copy link
Collaborator Author

jyemin commented Nov 11, 2022

Changes seem uncontroversial, so merging.

@jyemin jyemin merged commit e94ae72 into mongodb:master Nov 11, 2022
@jyemin jyemin deleted the j4795-legacy branch November 11, 2022 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants