8000 Rename endPoint to _endPoint · cnblogs/EnyimMemcachedCore@fa872c6 · GitHub
[go: up one dir, main page]

Skip to content

Commit fa872c6

Browse files
committed
Rename endPoint to _endPoint
1 parent 051caec commit fa872c6

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Enyim.Caching/Memcached/MemcachedNode.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ private class InternalPoolImpl : IDisposable
201201
private readonly int maxItems;
202202

203203
private MemcachedNode ownerNode;
204-
private readonly EndPoint endPoint;
204+
private readonly EndPoint _endPoint;
205205
private readonly TimeSpan queueTimeout;
206206
private Semaphore semaphore;
207207

@@ -221,7 +221,7 @@ internal InternalPoolImpl(
221221

222222
this.ownerNode = ownerNode;
223223
this.isAlive = true;
224-
this.endPoint = ownerNode.EndPoint;
224+
_endPoint = ownerNode.EndPoint;
225225
this.queueTimeout = config.QueueTimeout;
226226

227227
this.minItems = config.MinPoolSize;
@@ -251,7 +251,7 @@ internal void InitPool()
251251
}
252252

253253
if (_logger.IsEnabled(LogLevel.Debug))
254-
_logger.LogDebug("Pool has been inited for {0} with {1} sockets", this.endPoint, this.minItems);
254+
_logger.LogDebug("Pool has been inited for {0} with {1} sockets", _endPoint, this.minItems);
255255

256256
}
257257
catch (Exception e)
@@ -289,11 +289,11 @@ public IPooledSocketResult Acquire()
289289
var result = new PooledSocketResult();
290290
var message = string.Empty;
291291

292-
if (_isDebugEnabled) _logger.LogDebug("Acquiring stream from pool on node " + this.endPoint);
292+
if (_isDebugEnabled) _logger.LogDebug($"Acquiring stream from pool on node '{_endPoint}'");
293293

294294
if (!this.isAlive || this.isDisposed)
295295
{
296-
message = "Pool is dead or disposed, returning null. " + this.endPoint;
296+
message = "Pool is dead or disposed, returning null. " + _endPoint;
297297
result.Fail(message);
298298

299299
if (_isDebugEnabled) _logger.LogDebug(message);
@@ -305,7 +305,7 @@ public IPooledSocketResult Acquire()
305305

306306
if (!this.semaphore.WaitOne(this.queueTimeout))
307307
{
308-
message = "Pool is full, timeouting. " + this.endPoint;
308+
message = "Pool is full, timeouting. " + _endPoint;
309309
if (_isDebugEnabled) _logger.LogDebug(message);
310310
result.Fail(message, new TimeoutException());
311311

@@ -316,7 +316,7 @@ public IPooledSocketResult Acquire()
316316
// maybe we died while waiting
317317
if (!this.isAlive)
318318
{
319-
message = "Pool is dead, returning null. " + this.endPoint;
319+
message = "Pool is dead, returning null. " + _endPoint;
320320
if (_isDebugEnabled) _logger.LogDebug(message);
321321
result.Fail(message);
322322

@@ -353,7 +353,7 @@ public IPooledSocketResult Acquire()
353353
}
354354

355355
// free item pool is empty
356-
message = "Could not get a socket from the pool, Creating a new item. " + this.endPoint;
356+
message = "Could not get a socket from the pool, Creating a new item. " + _endPoint;
357357
if (_isDebugEnabled) _logger.LogDebug(message);
358358

359359

@@ -368,7 +368,7 @@ public IPooledSocketResult Acquire()
368368
}
369369
catch (Exception e)
370370
{
371-
message = "Failed to create socket. " + this.endPoint;
371+
message = "Failed to create socket. " + _endPoint;
372372
_logger.LogError(message, e);
373373

374374
// eventhough this item failed the failure policy may keep the pool alive
@@ -389,15 +389,15 @@ public IPooledSocketResult Acquire()
389389

390390
private void MarkAsDead()
391391
{
392-
if (_isDebugEnabled) _logger.LogDebug("Mark as dead was requested for {0}", this.endPoint);
392+
if (_isDebugEnabled) _logger.LogDebug("Mark as dead was requested for {0}", _endPoint);
393393

394394
var shouldFail = ownerNode.FailurePolicy.ShouldFail();
395395

396396
if (_isDebugEnabled) _logger.LogDebug("FailurePolicy.ShouldFail(): " + shouldFail);
397397

398398
if (shouldFail)
399399
{
400-
if (_logger.IsEnabled(LogLevel.Warning)) _logger.LogWarning("Marking node {0} as dead", this.endPoint);
400+
if (_logger.IsEnabled(LogLevel.Warning)) _logger.LogWarning("Marking node {0} as dead", _endPoint);
401401

402402
this.isAlive = false;
403403
this.markedAsDeadUtc = DateTime.UtcNow;

0 commit comments

Comments
 (0)
0