Skip to content

Commit ab14dab

Browse files
committed
CSHARP-915: changed MongoServerInstance.MaxWireBatchSize to MaxBatchCount. Using MongoServerInstance.MaxBatchCount in MongoCollection.
1 parent f5d8b0b commit ab14dab

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

MongoDB.Driver/Communication/MongoServerInstance.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -303,18 +303,18 @@ public int MaxWireDocumentSize
303303
}
304304

305305
/// <summary>
306-
/// Gets the maximum size of the wire batch.
306+
/// Gets the maximum batch count for write operations.
307307
/// </summary>
308308
/// <value>
309-
/// The maximum size of the wire batch.
309+
/// The maximum batch count.
310310
/// </value>
311-
public int MaxWireBatchSize
311+
public int MaxBatchCount
312312
{
313313
get
314314
{
315315
lock (_serverInstanceLock)
316316
{
317-
return _serverInfo.MaxWireBatchSize;
317+
return _serverInfo.MaxBatchCount;
318318
}
319319
}
320320
}
@@ -720,7 +720,7 @@ private void LookupServerInformation(MongoConnection connection)
720720
IsSecondary = false,
721721
MaxDocumentSize = currentServerInfo.MaxDocumentSize,
722722
MaxMessageLength = currentServerInfo.MaxMessageLength,
723-
MaxWireBatchSize = currentServerInfo.MaxWireBatchSize,
723+
MaxBatchCount = currentServerInfo.MaxBatchCount,
724724
ReplicaSetInformation = currentServerInfo.ReplicaSetInformation
725725
};
726726

@@ -878,7 +878,7 @@ private class ServerInformation
878878

879879
public int MaxWireDocumentSize { get { return MaxDocumentSize + 16 * 1024; } }
880880

881-
public int MaxWireBatchSize { get; set; }
881+
public int MaxBatchCount { get; set; }
882882

883883
public ReplicaSetInformation ReplicaSetInformation { get; set; }
884884

@@ -924,7 +924,7 @@ public bool IsDifferentFrom(ServerInformation other)
924924
return true;
925925
}
926926

927-
if (MaxWireBatchSize != other.MaxWireBatchSize)
927+
if (MaxBatchCount != other.MaxBatchCount)
928928
{
929929
return true;
930930
}

MongoDB.Driver/MongoCollection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,12 @@ public virtual BulkWriteResult BulkWrite(BulkWriteArgs args)
195195
{
196196
var assignId = args.AssignId ?? (_settings.AssignIdOnInsert ? (Action<InsertRequest>)AssignId : null);
197197
var checkElementNames = args.CheckElementNames ?? true;
198-
var maxBatchCount = args.MaxBatchCount ?? 1000;
198+
var maxBatchCount = args.MaxBatchCount ?? connection.ServerInstance.MaxBatchCount;
199199
var maxBatchLength = Math.Min(args.MaxBatchLength ?? int.MaxValue, connection.ServerInstance.MaxDocumentSize);
200200
var maxDocumentSize = connection.ServerInstance.MaxDocumentSize;
201201
var maxWireDocumentSize = connection.ServerInstance.MaxWireDocumentSize;
202202
var writeConcern = args.WriteConcern ?? _settings.WriteConcern;
203-
203+
204204
var operation = new BulkMixedWriteOperation(
205205
assignId,
206206
checkElementNames,

0 commit comments

Comments
 (0)