lib/node-impala.js
function connect() {
      var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var callback = arguments[1];

      this.host = props.host || '127.0.0.1';
      this.port = props.port || 21000;
      this.resultType = props.resultType || null;
      this.timeout = props.timeout || 1000;
      this.transport = props.transport || _thrift2.default.TBufferedTransport;
      this.protocol = props.protocol || _thrift2.default.TBinaryProtocol;
      this.options = {
        transport: this.transport,
        protocol: this.protocol,
        timeout: this.timeout
      };

      var deferred = _thrift.Q.defer();

      var connection = _thrift2.default.createConnection(this.host, this.port, this.options);
      var client = _thrift2.default.createClient(_ImpalaService2.default, connection);

      connection.on('error', ImpalaClient.onErrorDeferred(deferred));

      connection.on('connect', function () {
        deferred.resolve('Connection is established.');
      });

      this.client = client;
      this.connection = connection;

      deferred.promise.nodeify(callback);
      return deferred.promise;
    }
function connect() {
      var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var callback = arguments[1];

      this.host = props.host || '127.0.0.1';
      this.port = props.port || 21000;
      this.resultType = props.resultType || null;
      this.timeout = props.timeout || 1000;
      this.transport = props.transport || _thrift2.default.TBufferedTransport;
      this.protocol = props.protocol || _thrift2.default.TBinaryProtocol;
      this.options = {
        transport: this.transport,
        protocol: this.protocol,
        timeout: this.timeout
      };

      var deferred = _thrift.Q.defer();

      var connection = _thrift2.default.createConnection(this.host, this.port, this.options);
      var client = _thrift2.default.createClient(_ImpalaService2.default, connection);

      connection.on('error', ImpalaClient.onErrorDeferred(deferred));

      connection.on('connect', function () {
        deferred.resolve('Connection is established.');
      });

      this.client = client;
      this.connection = connection;

      deferred.promise.nodeify(callback);
      return deferred.promise;
    }
function connect ( ) { var props = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ; var callback = arguments [ 1 ] ; this . host = props . host || '127.0.0.1' ; this . port = props . port || 21000 ; this . resultType = props . resultType || null ; this . timeout = props . timeout || 1000 ; this . transport = props . transport || _thrift2 . default . TBufferedTransport ; this . protocol = props . protocol || _thrift2 . default . TBinaryProtocol ; this . options = { transport : this . transport , protocol : this . protocol , timeout : this . timeout } ; var deferred = _thrift . Q . defer ( ) ; var connection = _thrift2 . default . createConnection ( this . host , this . port , this . options ) ; var client = _thrift2 . default . createClient ( _ImpalaService2 . default , connection ) ; connection . on ( 'error' , ImpalaClient . onErrorDeferred ( deferred ) ) ; connection . on ( 'connect' , function ( ) { deferred . resolve ( 'Connection is established.' ) ; } ) ; this . client = client ; this . connection = connection ; deferred . promise . nodeify ( callback ) ; return deferred . promise ; }
Creates connection using given props.

@param props {object}
@param callback {function}
@returns {function|promise}
Creates connection using given props .