Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions integration/session_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -637,11 +637,11 @@ def test_raise_error_on_future_resolution_timeout
@@ccm_cluster.block_node("node1")

future = session.execute_async("SELECT * FROM users")
start_time = Time.now.to_i
start_time = Time.now
assert_raises(Cassandra::Errors::TimeoutError) do
future.get(2)
end
assert_equal 2, Time.now.to_i - start_time
assert_in_delta(2, Time.now - start_time, 0.5)
ensure
@@ccm_cluster.unblock_nodes
cluster && cluster.close
Expand Down
5 changes: 5 additions & 0 deletions lib/cassandra/cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ def close
def inspect
"#<#{self.class.name}:0x#{object_id.to_s(16)} " \
"name=#{name.inspect}, " \
"port=#{@connection_options.port}, " \
"protocol_version=#{@connection_options.protocol_version}, " \
"load_balancing_policy=#{@load_balancing_policy.inspect}, " \
"consistency=#{@execution_options.consistency.inspect}, " \
"timeout=#{@execution_options.timeout.inspect}, " \
"hosts=#{hosts.inspect}, " \
"keyspaces=#{keyspaces.inspect}>"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/cassandra/cluster/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def find_replicas(keyspace, statement)
end

def update(data)
@name = data['name']
@name = data['cluster_name']
@partitioner = @partitioners[data['partitioner']]

self
Expand Down
11 changes: 11 additions & 0 deletions lib/cassandra/load_balancing/policies/dc_aware_round_robin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,17 @@ def plan(keyspace, statement, options)

Plan.new(local, remote, position)
end

# @private
def inspect
"#<#{self.class.name}:0x#{object_id.to_s(16)} " \
"datacenter=#{@datacenter.inspect}, " \
"use_remote=#{@use_remote.inspect}, " \
"max_remote=#{@max_remote.inspect}, " \
"local=#{@local.inspect}, " \
"remote=#{@remote.inspect}, " \
"position=#{@position.inspect}>"
end
end
end
end
Expand Down
7 changes: 7 additions & 0 deletions lib/cassandra/load_balancing/policies/round_robin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ def plan(keyspace, statement, options)

Plan.new(hosts, position)
end

# @private
def inspect
"#<#{self.class.name}:0x#{object_id.to_s(16)} " \
"hosts=#{@hosts.inspect}, " \
"position=#{@position.inspect}>"
end
end
end
end
Expand Down
7 changes: 7 additions & 0 deletions lib/cassandra/load_balancing/policies/token_aware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ def plan(keyspace, statement, options)

Plan.new(replicas, @policy, keyspace, statement, options)
end

# @private
def inspect
"#<#{self.class.name}:0x#{object_id.to_s(16)} " \
"policy=#{@policy.inspect}, " \
"shuffle=#{@shuffle.inspect}>"
end
end
end
end
Expand Down
7 changes: 7 additions & 0 deletions lib/cassandra/load_balancing/policies/white_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ def host_up(host)
def host_down(host)
@policy.host_down(host) if @ips.include?(host.ip)
end

# @private
def inspect
"#<#{self.class.name}:0x#{object_id.to_s(16)} " \
"policy=#{@policy.inspect}, " \
"ips=#{@ips.inspect}>"
end
end
end
end
Expand Down