Skip to content

Conversation

qingyang-hu
Copy link
Collaborator

@qingyang-hu qingyang-hu commented Sep 11, 2024

GODRIVER-2388
GODRIVER-3348
GODRIVER-3349
GODRIVER-3364

Summary

Improved Bulk Write API.

Background & Motivation

Refactor the (Operation).createWireMessage() to support the bulk write batching.

@mongodb-drivers-pr-bot mongodb-drivers-pr-bot bot added the review-priority-low Low Priority PR for Review: within 3 business days label Sep 11, 2024
Copy link
Contributor

mongodb-drivers-pr-bot bot commented Sep 11, 2024

API Change Report

./mongo

compatible changes

(*Client).BulkWrite: added
ClientBulkWriteException: added
ClientBulkWriteResult: added
ClientDeleteManyModel: added
ClientDeleteOneModel: added
ClientDeleteResult: added
ClientInsertOneModel: added
ClientInsertResult: added
ClientReplaceOneModel: added
ClientUpdateManyModel: added
ClientUpdateOneModel: added
ClientUpdateResult: added
ClientWriteModels: added

./mongo/options

compatible changes

ClientBulkWrite: added
ClientBulkWriteOptions: added
MergeClientBulkWriteOptions: added

./x/mongo/driver

incompatible changes

(*Batches).AdvanceBatch: removed
(*Batches).ClearBatch: removed
(*Batches).Valid: removed
Batches.Current: removed
##NewCursorResponse: changed from func(ResponseInfo) (CursorResponse, error) to func(./x/bsonx/bsoncore.Document, ResponseInfo) (CursorResponse, error)
Operation.Batches: changed from *Batches to interface{AdvanceBatches(n int); AppendBatchArray(dst []byte, maxCount int, maxDocSize int, totalSize int) (int, []byte, error); AppendBatchSequence(dst []byte, maxCount int, maxDocSize int, totalSize int) (int, []byte, error); IsOrdered() *bool; Size() int}
##Operation.ProcessResponseFn: changed from func(ResponseInfo) error to func(context.Context, ./x/bsonx/bsoncore.Document, ResponseInfo) error
ResponseInfo.ServerResponse: removed

compatible changes

(*Batches).AdvanceBatches: added
(*Batches).AppendBatchArray: added
(*Batches).AppendBatchSequence: added
(*Batches).IsOrdered: added
(*Batches).Size: added
ExtractCursorDocument: added
ResponseInfo.Error: added

./x/mongo/driver/session

incompatible changes

Client.RetryWrite: removed

./x/mongo/driver/wiremessage

incompatible changes

ReadCompressedCompressedMessage: removed

compatible changes

DocumentSequenceToArray: added

@qingyang-hu qingyang-hu force-pushed the godriver2388 branch 3 times, most recently from 234d7f4 to 8f81f65 Compare September 27, 2024 22:29
@qingyang-hu qingyang-hu force-pushed the godriver2388 branch 2 times, most recently from 8ea5dc5 to 4f738e2 Compare September 29, 2024 20:25
@qingyang-hu qingyang-hu force-pushed the godriver2388 branch 6 times, most recently from ba9f578 to d2d8a49 Compare October 12, 2024 05:16
@qingyang-hu qingyang-hu force-pushed the godriver2388 branch 7 times, most recently from 76a9981 to e3dcc91 Compare October 13, 2024 21:08
@qingyang-hu qingyang-hu force-pushed the godriver2388 branch 5 times, most recently from dec06b9 to ed94cf9 Compare October 16, 2024 20:59
assert.Equal(mt, cc.numCloseCalls, 0,
"expected 0 calls to Close, got %v", cc.numCloseCalls)
assert.Equal(mt, cc.numBypassAutoEncryptionCalls, 2,
assert.Equal(mt, cc.numBypassAutoEncryptionCalls, 1,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We only call it once after the operation.go refactoring.


// ClientBulkWriteException is the error type returned by ClientBulkWrite operations.
type ClientBulkWriteException struct {
TopLevelError *WriteError
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cannot use Error as a field name because of the conflict with the conventional method name.

@qingyang-hu qingyang-hu force-pushed the godriver2388 branch 3 times, most recently from f0cd171 to c80bb4f Compare October 22, 2024 17:48
@qingyang-hu qingyang-hu force-pushed the godriver2388 branch 2 times, most recently from bf90492 to 48838bf Compare October 24, 2024 05:37
@qingyang-hu qingyang-hu marked this pull request as ready for review October 24, 2024 14:17
@qingyang-hu qingyang-hu closed this Nov 5, 2024
@qingyang-hu qingyang-hu removed the review-priority-low Low Priority PR for Review: within 3 business days label Nov 5, 2024
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.

1 participant