Skip to content

Commit

Permalink
Merge pull request #22 from tagomoris/parameter-names-should-be-camel…
Browse files Browse the repository at this point in the history
…-case

Parameter names should be camel case
  • Loading branch information
tagomoris committed Jul 2, 2018
2 parents f660e85 + 10a2c19 commit 553d56c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ Instanciate client object and set default configurations.

* opts [object]
* host [string]
* presto coordinator hostname or address (default: localhost)
* Presto coordinator hostname or address (default: localhost)
* ssl [object]
* setting a Hash object enables SSL and verify server certificate with options (default: `null`):
* Setting a Hash object enables SSL and verify server certificate with options (default: `null`):
* `ca`: An authority certificate or array of authority certificates to check the remote host against
* `cert`: Public x509 certificate to use (default : `null`)
* `ciphers` : Default cipher suite to use. (default: https://nodejs.org/api/tls.html#tls_modifying_the_default_tls_cipher_suite)
Expand All @@ -57,26 +57,25 @@ Instanciate client object and set default configurations.
* `secureProtocol`: Optional SSL method to use. The possible values are listed as SSL_METHODS, use the function names as strings. For example, "SSLv3_method" to force SSL version 3 (default: `SSLv23_method`)
* `servername`: Server name for the SNI (Server Name Indication) TLS extension
* port [integer]
* presto coordinator port (default: 8080)
* Presto coordinator port (default: 8080)
* user [string]
* username of query (default: process user name)
* Username of query (default: process user name)
* basic_auth [object]
* Pass in a user and password to enable Authorization Basic headers on all requests.
* basic_auth: {user: "user", password: "password"} (default:null)
* catalog [string]
* default catalog name
* Default catalog name
* schema [string]
* default schema name
* Default schema name
* checkInterval [integer]
* interval milliseconds of each RPC to check query status (default: 800ms)
* enable_verbose_state_callback [boolean]
* when set to `true`, this flag modifies the condition of the state change callback to return data every `checkInterval` (default: 800ms).
* when set to `true`, if you wish to modify the frequency of updates you must change the `checkInterval` value accordingly.
* when enable_verbose_state_callback is set to `false`, the state change callback will only be called upon a change in state.
* Interval milliseconds of each RPC to check query status (default: 800ms)
* enableVerboseStateCallback [boolean]
* Enable more verbose callback for Presto query states (default: false)
* When set to `true`, this flag modifies the condition of the state change callback to return data every `checkInterval`(default: 800ms). Modify `checkInterval` if you wish to change the frequency.
* Otherwise (`false`), the state change callback will only be called upon a change in state.
* The purpose of this variable is to enable verbose update capability in state callbacks. This is such that "percentage complete" and "processed rows" may be extracted despite the state still remaining in a particular state eg. "RUNNING".
* (default: false)
* jsonParser [object]
* custom json parser if required (default: `JSON`)
* Custom json parser if required (default: `JSON`)

return value: client instance object

Expand Down
5 changes: 3 additions & 2 deletions lib/presto-client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var Client = exports.Client = function(args){
this.schema = args.schema;

this.checkInterval = args.checkInterval || QUERY_STATE_CHECK_INTERVAL;

this.enableVerboseStateCallback = args.enableVerboseStateCallback || false;
this.jsonParser = args.jsonParser || JSON;

if (args.ssl) {
Expand Down Expand Up @@ -242,7 +242,8 @@ Client.prototype.statementResource = function(opts) {
var data_callback = opts.data;
var success_callback = opts.success || opts.callback;
var error_callback = opts.error || opts.callback;
var enable_verbose_state_callback = opts.enable_verbose_state_callback || false;

var enable_verbose_state_callback = this.enableVerboseStateCallback || false;

var req = { method: 'POST', path: '/v1/statement', headers: header, body: opts.query };
client.request(req, function(err, code, data){
Expand Down

0 comments on commit 553d56c

Please sign in to comment.