@@ -82,7 +82,7 @@ protected override void Dispose(bool disposing)
82
82
{
83
83
if ( disposing )
84
84
{
85
- _clusterEventsLogger . LogAndPublish ( new ClusterClosingEvent ( ClusterId ) ) ;
85
+ _clusterEventLogger . LogAndPublish ( new ClusterClosingEvent ( ClusterId ) ) ;
86
86
87
87
stopwatch = Stopwatch . StartNew ( ) ;
88
88
_monitorServersCancellationTokenSource . Cancel ( ) ;
@@ -103,7 +103,7 @@ protected override void Dispose(bool disposing)
103
103
104
104
if ( stopwatch != null )
105
105
{
106
- _clusterEventsLogger . LogAndPublish ( new ClusterClosedEvent ( ClusterId , stopwatch . Elapsed ) ) ;
106
+ _clusterEventLogger . LogAndPublish ( new ClusterClosedEvent ( ClusterId , stopwatch . Elapsed ) ) ;
107
107
}
108
108
}
109
109
@@ -112,7 +112,7 @@ public override void Initialize()
112
112
base . Initialize ( ) ;
113
113
if ( _state . TryChange ( State . Initial , State . Open ) )
114
114
{
115
- _clusterEventsLogger . LogAndPublish ( new ClusterOpeningEvent ( ClusterId , Settings ) ) ;
115
+ _clusterEventLogger . LogAndPublish ( new ClusterOpeningEvent ( ClusterId , Settings ) ) ;
116
116
117
117
var stopwatch = Stopwatch . StartNew ( ) ;
118
118
@@ -145,7 +145,7 @@ public override void Initialize()
145
145
server . Initialize ( ) ;
146
146
}
147
147
148
- _clusterEventsLogger . LogAndPublish ( new ClusterOpenedEvent ( ClusterId , Settings , stopwatch . Elapsed ) ) ;
148
+ _clusterEventLogger . LogAndPublish ( new ClusterOpenedEvent ( ClusterId , Settings , stopwatch . Elapsed ) ) ;
149
149
150
150
if ( Settings . Scheme == ConnectionStringScheme . MongoDBPlusSrv )
151
151
{
@@ -236,7 +236,7 @@ private void ServerDescriptionChangedHandler(object sender, ServerDescriptionCha
236
236
catch ( Exception unexpectedException )
237
237
{
238
238
// if we catch an exception here it's because of a bug in the driver
239
- _clusterEventsLogger . LogAndPublish ( new SdamInformationEvent (
239
+ _clusterEventLogger . LogAndPublish ( new SdamInformationEvent (
240
240
"Unexpected exception in MultiServerCluster.ServerDescriptionChangedHandler: {0}" ,
241
241
unexpectedException ) ,
242
242
unexpectedException ) ;
@@ -362,7 +362,7 @@ private ClusterDescription ProcessReplicaSetChange(ClusterDescription clusterDes
362
362
var server = _servers . SingleOrDefault ( x => EndPointHelper . Equals ( args . NewServerDescription . EndPoint , x . EndPoint ) ) ;
363
363
server . Invalidate ( "ReportedPrimaryIsStale" , args . NewServerDescription . TopologyVersion ) ;
364
364
365
- _clusterEventsLogger . LogAndPublish ( new SdamInformationEvent (
365
+ _clusterEventLogger . LogAndPublish ( new SdamInformationEvent (
366
366
@"Invalidating server: Setting ServerType to ""Unknown"" for {0} because it " +
367
367
@"claimed to be the replica set primary for replica set ""{1}"" but sent a " +
368
368
@"(setVersion, electionId) tuple of ({2}, {3}) that was less than than the " +
@@ -384,7 +384,7 @@ private ClusterDescription ProcessReplicaSetChange(ClusterDescription clusterDes
384
384
{
385
385
if ( _maxElectionInfo == null )
386
386
{
387
- _clusterEventsLogger . LogAndPublish ( new SdamInformationEvent (
387
+ _clusterEventLogger . LogAndPublish ( new SdamInformationEvent (
388
388
@"Initializing (maxSetVersion, maxElectionId): Saving tuple " +
389
389
@"(setVersion, electionId) of ({0}, {1}) as (maxSetVersion, maxElectionId) for " +
390
390
@"replica set ""{2}"" because replica set primary {3} sent ({0}, {1}), the first " +
@@ -404,7 +404,7 @@ private ClusterDescription ProcessReplicaSetChange(ClusterDescription clusterDes
404
404
if ( _maxElectionInfo . SetVersion < args . NewServerDescription . ReplicaSetConfig . Version . Value )
405
405
{
406
406
var electionId = args . NewServerDescription . ElectionId ?? _maxElectionInfo . ElectionId ;
407
- _clusterEventsLogger . LogAndPublish ( new SdamInformationEvent (
407
+ _clusterEventLogger . LogAndPublish ( new SdamInformationEvent (
408
408
@"Updating stale setVersion: Updating the current " +
409
409
@"(maxSetVersion, maxElectionId) tuple from ({0}, {1}) to ({2}, {3}) for " +
410
410
@"replica set ""{4}"" because replica set primary {5} sent ({6}, {7})—a larger " +
@@ -424,7 +424,7 @@ private ClusterDescription ProcessReplicaSetChange(ClusterDescription clusterDes
424
424
}
425
425
else // current primary is stale & setVersion is not stale ⇒ the electionId must be stale
426
426
{
427
- _clusterEventsLogger . LogAndPublish ( new SdamInformationEvent (
427
+ _clusterEventLogger . LogAndPublish ( new SdamInformationEvent (
428
428
@"Updating stale electionId: Updating the current " +
429
429
@"(maxSetVersion, maxElectionId) tuple from ({0}, {1}) to ({2}, {3}) for " +
430
430
@"replica set ""{4}"" because replica set primary {5} sent ({6}, {7})—" +
@@ -583,7 +583,7 @@ private ClusterDescription EnsureServer(ClusterDescription clusterDescription, E
583
583
return clusterDescription ;
584
584
}
585
585
586
- _clusterEventsLogger . LogAndPublish ( new ClusterAddingServerEvent ( ClusterId , endPoint ) ) ;
586
+ _clusterEventLogger . LogAndPublish ( new ClusterAddingServerEvent ( ClusterId , endPoint ) ) ;
587
587
588
588
stopwatch . Start ( ) ;
589
589
server = CreateServer ( endPoint ) ;
@@ -595,7 +595,7 @@ private ClusterDescription EnsureServer(ClusterDescription clusterDescription, E
595
595
clusterDescription = clusterDescription . WithServerDescription ( server . Description ) ;
596
596
stopwatch . Stop ( ) ;
597
597
598
- _clusterEventsLogger . LogAndPublish ( new ClusterAddedServerEvent ( server . ServerId , stopwatch . Elapsed ) ) ;
598
+ _clusterEventLogger . LogAndPublish ( new ClusterAddedServerEvent ( server . ServerId , stopwatch . Elapsed ) ) ;
599
599
600
600
return clusterDescription ;
601
601
}
@@ -636,7 +636,7 @@ private ClusterDescription RemoveServer(ClusterDescription clusterDescription, E
636
636
return clusterDescription ;
637
637
}
638
638
639
- _clusterEventsLogger . LogAndPublish ( new ClusterRemovingServerEvent ( server . ServerId , reason ) ) ;
639
+ _clusterEventLogger . LogAndPublish ( new ClusterRemovingServerEvent ( server . ServerId , reason ) ) ;
640
640
641
641
stopwatch . Start ( ) ;
642
642
_servers . Remove ( server ) ;
@@ -646,7 +646,7 @@ private ClusterDescription RemoveServer(ClusterDescription clusterDescription, E
646
646
server . Dispose ( ) ;
647
647
stopwatch . Stop ( ) ;
648
648
649
- _clusterEventsLogger . LogAndPublish ( new ClusterRemovedServerEvent ( server . ServerId , reason , stopwatch . Elapsed ) ) ;
649
+ _clusterEventLogger . LogAndPublish ( new ClusterRemovedServerEvent ( server . ServerId , reason , stopwatch . Elapsed ) ) ;
650
650
651
651
return clusterDescription . WithoutServerDescription ( endPoint ) ;
652
652
}
0 commit comments