Skip to content

Commit

Permalink
Fixing after code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhen Li committed Jul 14, 2017
1 parent 2496a81 commit cff5165
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 30 deletions.
16 changes: 0 additions & 16 deletions Neo4j.Driver/Neo4j.Driver.Tests/Routing/LoadBalancerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,6 @@
// limitations under the License.

using System;
// Copyright (c) 2002-2017 "Neo Technology,"
// Network Engine for Objects in Lund AB [http://neotechnology.com]
//
// This file is part of Neo4j.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using FluentAssertions;
using Moq;
using Neo4j.Driver.Internal.Connector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,16 +363,10 @@ public void ShouldAcceptRoutingTableIfNoWriter()
}
}

public class TryAcquireConnectionMethod
{


}

internal class ListBasedRoutingTable : IRoutingTable
{
private readonly List<Uri> _routers;
private List<Uri> _removed;
private readonly List<Uri> _removed;
private int _count = 0;

public ListBasedRoutingTable(List<Uri> routers)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ internal class ClusterConnectionPool : LoggerBase, IClusterConnectionPool
ConnectionPoolSettings poolSettings=null,
ILogger logger=null
) :
this(connSettings, poolSettings, new HashSet<Uri>(), logger)
this(connSettings, poolSettings, Enumerable.Empty<Uri>(), logger)
{
_fakePool = connectionPool;
_pools = clusterPool;
Expand Down
3 changes: 1 addition & 2 deletions Neo4j.Driver/Neo4j.Driver/Internal/Routing/LoadBalancer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ private IConnection AcquireConnection(AccessMode mode)
}
//else connection already removed by clusterConnection onError method
}
var name = mode == AccessMode.Read ? "read" : "wrtie";
throw new SessionExpiredException($"Failed to connect to any {name} server.");
throw new SessionExpiredException($"Failed to connect to any {mode.ToString().ToLower()} server.");
}

private IConnection CreateClusterConnection(Uri uri, AccessMode mode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ internal class RoundRobinRoutingTable : IRoutingTable
private readonly long _expireAfterSeconds;

public RoundRobinRoutingTable(IEnumerable<Uri> routers, long expireAfterSeconds = 0)
:this(routers, Enumerable.Empty<Uri>(), Enumerable.Empty<Uri>(), expireAfterSeconds)
{
_expireAfterSeconds = expireAfterSeconds;
_stopwatch = new Stopwatch();
_stopwatch.Restart();
_routers.Add(routers);// init
}

public RoundRobinRoutingTable(IEnumerable<Uri> routers, IEnumerable<Uri> readers, IEnumerable<Uri> writers,
Expand Down

0 comments on commit cff5165

Please sign in to comment.