class Cql::Client::CachePropertiesStep

@private

Public Instance Methods

run(pending_connection) click to toggle source
# File lib/cql/client/connector.rb, line 197
def run(pending_connection)
  request = Protocol::QueryRequest.new('SELECT data_center, host_id FROM system.local', nil, nil, :one)
  f = pending_connection.execute(request)
  f.on_value do |result|
    unless result.empty?
      pending_connection[:host_id] = result.first['host_id']
      pending_connection[:data_center] = result.first['data_center']
    end
  end
  f.map(pending_connection)
end