module Impala

Constants

DEFAULT_HOST
DEFAULT_PORT
VERSION

Public Class Methods

connect(host=DEFAULT_HOST, port=DEFAULT_PORT, options={}) { |connection| ... } click to toggle source

Connect to an Impala server. If a block is given, it will close the connection after yielding the connection to the block. @param [String] host the hostname or IP address of the Impala server @param [int] port the port that the Impala server is listening on @yieldparam [Connection] conn the open connection. Will be closed once the block

finishes

@return [Connection] the open connection, or, if a block is

passed, the return value of the block
   # File lib/impala.rb
40 def self.connect(host=DEFAULT_HOST, port=DEFAULT_PORT, options={})
41   connection = Connection.new(host, port, options)
42 
43   if block_given?
44     begin
45       ret = yield connection
46     ensure
47       connection.close
48     end
49   else
50     ret = connection
51   end
52 
53   ret
54 end