Skip to content

Commit

Permalink
[CLIENT-1432] Changed fn name
Browse files Browse the repository at this point in the history
  • Loading branch information
vmsachin committed Jun 20, 2023
1 parent 0e5b98d commit b5c1804
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/aerospike/cluster.rb
Expand Up @@ -584,7 +584,7 @@ def remove_alias(aliass)

def create_node(nv)
node = ::Aerospike::Node.new(self, nv)
node.connection_pool_init(@client_policy.min_connections_per_node)
node.fill_connection_pool_up_to(@client_policy.min_connections_per_node)
node
end

Expand Down
2 changes: 1 addition & 1 deletion lib/aerospike/node.rb
Expand Up @@ -69,7 +69,7 @@ def has_rack(ns, rack_id)
racks[ns] == rack_id
end

def connection_pool_init(min_connection_size)
def fill_connection_pool_up_to(min_connection_size)
current_number_of_connections = @connections.length
if min_connection_size > 0
while current_number_of_connections < min_connection_size
Expand Down
4 changes: 2 additions & 2 deletions spec/aerospike/cluster_spec.rb
Expand Up @@ -28,12 +28,12 @@

before do
allow(Aerospike::Node).to receive(:new).with(instance, nv).and_return(node)
allow(node).to receive(:connection_pool_init).with(policy)
allow(node).to receive(:fill_connection_pool_up_to).with(policy)
end

it 'creates a new node and calls create_min_connections' do
expect(Aerospike::Node).to receive(:new).with(instance, nv).and_return(node)
expect(node).to receive(:connection_pool_init)
expect(node).to receive(:fill_connection_pool_up_to)
new_node = instance.create_node(nv)
expect(new_node).to eq(node)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/aerospike/node_spec.rb
Expand Up @@ -37,7 +37,7 @@
let(:current_number_of_connections) { 5 }

it 'creates the expected number of minimum connections' do
instance.connection_pool_init(10)
instance.fill_connection_pool_up_to(10)
expect(connections).to have_received(:create).exactly(5).times
expect(connections).to have_received(:offer).exactly(5).times
end
Expand Down

0 comments on commit b5c1804

Please sign in to comment.