{"action":"created","comment":{"url":"https://api.github.com/repos/datastax/nodejs-driver/pulls/comments/203975242","pull_request_review_id":138972431,"id":203975242,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzk3NTI0Mg==","diff_hunk":"@@ -153,15 +155,31 @@ class RequestHandler {\n     if (this.requestOptions.captureStackTrace) {\n       Error.captureStackTrace(this.stackContainer = {});\n     }\n+    this._callback = callback;\n     const self = this;\n-    this.loadBalancingPolicy.newQueryPlan(this.client.keyspace, this.requestOptions, function newPlanCb(err, iterator) {\n-      if (err) {\n-        return callback(err);\n-      }\n-      self._hostIterator = iterator;\n-      self._callback = callback;\n+    if (this.requestOptions.host) {\n+      // if host is configured bypass load balancing policy and use\n+      // a single host plan.\n+      let hostProvided = false; \n+      self._hostIterator = { ","path":"lib/request-handler.js","position":25,"original_position":25,"commit_id":"bf70de8a19b8bd20b552e0d542b84c87f56a1980","original_commit_id":"bf70de8a19b8bd20b552e0d542b84c87f56a1980","user":{"login":"jorgebay","id":2931196,"node_id":"MDQ6VXNlcjI5MzExOTY=","avatar_url":"https://avatars3.githubusercontent.com/u/2931196?v=4","gravatar_id":"","url":"https://api.github.com/users/jorgebay","html_url":"https://github.com/jorgebay","followers_url":"https://api.github.com/users/jorgebay/followers","following_url":"https://api.github.com/users/jorgebay/following{/other_user}","gists_url":"https://api.github.com/users/jorgebay/gists{/gist_id}","starred_url":"https://api.github.com/users/jorgebay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorgebay/subscriptions","organizations_url":"https://api.github.com/users/jorgebay/orgs","repos_url":"https://api.github.com/users/jorgebay/repos","events_url":"https://api.github.com/users/jorgebay/events{/privacy}","received_events_url":"https://api.github.com/users/jorgebay/received_events","type":"User","site_admin":false},"body":"We can reuse existing `utils.arrayIterator([ host ])` or you can write a small generator function (Node.js 4 supports it):\r\n\r\n```javascript\r\nfunction* singleHostIterator(h) {\r\n  yield h;\r\n}\r\n\r\nself._hostIterator = singleHostIterator(host);\r\n```","created_at":"2018-07-20T08:40:39Z","updated_at":"2018-07-20T08:59:12Z","html_url":"https://github.com/datastax/nodejs-driver/pull/281#discussion_r203975242","pull_request_url":"https://api.github.com/repos/datastax/nodejs-driver/pulls/281","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/datastax/nodejs-driver/pulls/comments/203975242"},"html":{"href":"https://github.com/datastax/nodejs-driver/pull/281#discussion_r203975242"},"pull_request":{"href":"https://api.github.com/repos/datastax/nodejs-driver/pulls/281"}}},"pull_request":{"url":"https://api.github.com/repos/datastax/nodejs-driver/pulls/281","id":202646385,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyNjQ2Mzg1","html_url":"https://github.com/datastax/nodejs-driver/pull/281","diff_url":"https://github.com/datastax/nodejs-driver/pull/281.diff","patch_url":"https://github.com/datastax/nodejs-driver/pull/281.patch","issue_url":"https://api.github.com/repos/datastax/nodejs-driver/issues/281","number":281,"state":"open","locked":false,"title":"Add 'host' query option to enable host targeting","user":{"login":"tolbertam","id":6889771,"node_id":"MDQ6VXNlcjY4ODk3NzE=","avatar_url":"https://avatars1.githubusercontent.com/u/6889771?v=4","gravatar_id":"","url":"https://api.github.com/users/tolbertam","html_url":"https://github.com/tolbertam","followers_url":"https://api.github.com/users/tolbertam/followers","following_url":"https://api.github.com/users/tolbertam/following{/other_user}","gists_url":"https://api.github.com/users/tolbertam/gists{/gist_id}","starred_url":"https://api.github.com/users/tolbertam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tolbertam/subscriptions","organizations_url":"https://api.github.com/users/tolbertam/orgs","repos_url":"https://api.github.com/users/tolbertam/repos","events_url":"https://api.github.com/users/tolbertam/events{/privacy}","received_events_url":"https://api.github.com/users/tolbertam/received_events","type":"User","site_admin":false},"body":"For [NODEJS-443](https://datastax-oss.atlassian.net/browse/NODEJS-443).\r\n\r\nAdds a new 'host' query option for host targeting, i.e.:\r\n\r\n```javascript\r\nconst host = client.hosts.get('127.0.0.2:9042');\r\nclient.execute('select rpc_address from system.local', [], { host: host })\r\n  .then((result) => console.log('Queried host:', result.info.queriedHost, '\\nRows:', result.rows));\r\n```\r\n\r\nemits:\r\n\r\n    Queried host: 127.0.0.2:9042\r\n    Rows: [ Row { rpc_address: InetAddress: 127.0.0.2 } ]","created_at":"2018-07-19T18:30:24Z","updated_at":"2018-07-20T08:59:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e8d94606ae3358367977c0ac8df182f0a1fa6ad1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/datastax/nodejs-driver/pulls/281/commits","review_comments_url":"https://api.github.com/repos/datastax/nodejs-driver/pulls/281/comments","review_comment_url":"https://api.github.com/repos/datastax/nodejs-driver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/datastax/nodejs-driver/issues/281/comments","statuses_url":"https://api.github.com/repos/datastax/nodejs-driver/statuses/bf70de8a19b8bd20b552e0d542b84c87f56a1980","head":{"label":"datastax:NODEJS-443","ref":"NODEJS-443","sha":"bf70de8a19b8bd20b552e0d542b84c87f56a1980","user":{"login":"datastax","id":573369,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3MzM2OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/573369?v=4","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"repo":{"id":23706552,"node_id":"MDEwOlJlcG9zaXRvcnkyMzcwNjU1Mg==","name":"nodejs-driver","full_name":"datastax/nodejs-driver","owner":{"login":"datastax","id":573369,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3MzM2OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/573369?v=4","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datastax/nodejs-driver","description":"DataStax Node.js Driver for Apache Cassandra","fork":false,"url":"https://api.github.com/repos/datastax/nodejs-driver","forks_url":"https://api.github.com/repos/datastax/nodejs-driver/forks","keys_url":"https://api.github.com/repos/datastax/nodejs-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datastax/nodejs-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datastax/nodejs-driver/teams","hooks_url":"https://api.github.com/repos/datastax/nodejs-driver/hooks","issue_events_url":"https://api.github.com/repos/datastax/nodejs-driver/issues/events{/number}","events_url":"https://api.github.com/repos/datastax/nodejs-driver/events","assignees_url":"https://api.github.com/repos/datastax/nodejs-driver/assignees{/user}","branches_url":"https://api.github.com/repos/datastax/nodejs-driver/branches{/branch}","tags_url":"https://api.github.com/repos/datastax/nodejs-driver/tags","blobs_url":"https://api.github.com/repos/datastax/nodejs-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datastax/nodejs-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datastax/nodejs-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/datastax/nodejs-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datastax/nodejs-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/datastax/nodejs-driver/languages","stargazers_url":"https://api.github.com/repos/datastax/nodejs-driver/stargazers","contributors_url":"https://api.github.com/repos/datastax/nodejs-driver/contributors","subscribers_url":"https://api.github.com/repos/datastax/nodejs-driver/subscribers","subscription_url":"https://api.github.com/repos/datastax/nodejs-driver/subscription","commits_url":"https://api.github.com/repos/datastax/nodejs-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/datastax/nodejs-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/datastax/nodejs-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/datastax/nodejs-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/datastax/nodejs-driver/contents/{+path}","compare_url":"https://api.github.com/repos/datastax/nodejs-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datastax/nodejs-driver/merges","archive_url":"https://api.github.com/repos/datastax/nodejs-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datastax/nodejs-driver/downloads","issues_url":"https://api.github.com/repos/datastax/nodejs-driver/issues{/number}","pulls_url":"https://api.github.com/repos/datastax/nodejs-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/datastax/nodejs-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/datastax/nodejs-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datastax/nodejs-driver/labels{/name}","releases_url":"https://api.github.com/repos/datastax/nodejs-driver/releases{/id}","deployments_url":"https://api.github.com/repos/datastax/nodejs-driver/deployments","created_at":"2014-09-05T14:46:37Z","updated_at":"2018-07-19T20:36:39Z","pushed_at":"2018-07-19T22:04:09Z","git_url":"git://github.com/datastax/nodejs-driver.git","ssh_url":"git@github.com:datastax/nodejs-driver.git","clone_url":"https://github.com/datastax/nodejs-driver.git","svn_url":"https://github.com/datastax/nodejs-driver","homepage":null,"size":4004,"stargazers_count":777,"watchers_count":777,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":128,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":128,"open_issues":4,"watchers":777,"default_branch":"master"}},"base":{"label":"datastax:master","ref":"master","sha":"b482abb30940ffe5c72fd23803e1b0ed40220523","user":{"login":"datastax","id":573369,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3MzM2OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/573369?v=4","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"repo":{"id":23706552,"node_id":"MDEwOlJlcG9zaXRvcnkyMzcwNjU1Mg==","name":"nodejs-driver","full_name":"datastax/nodejs-driver","owner":{"login":"datastax","id":573369,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3MzM2OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/573369?v=4","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datastax/nodejs-driver","description":"DataStax Node.js Driver for Apache Cassandra","fork":false,"url":"https://api.github.com/repos/datastax/nodejs-driver","forks_url":"https://api.github.com/repos/datastax/nodejs-driver/forks","keys_url":"https://api.github.com/repos/datastax/nodejs-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datastax/nodejs-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datastax/nodejs-driver/teams","hooks_url":"https://api.github.com/repos/datastax/nodejs-driver/hooks","issue_events_url":"https://api.github.com/repos/datastax/nodejs-driver/issues/events{/number}","events_url":"https://api.github.com/repos/datastax/nodejs-driver/events","assignees_url":"https://api.github.com/repos/datastax/nodejs-driver/assignees{/user}","branches_url":"https://api.github.com/repos/datastax/nodejs-driver/branches{/branch}","tags_url":"https://api.github.com/repos/datastax/nodejs-driver/tags","blobs_url":"https://api.github.com/repos/datastax/nodejs-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datastax/nodejs-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datastax/nodejs-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/datastax/nodejs-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datastax/nodejs-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/datastax/nodejs-driver/languages","stargazers_url":"https://api.github.com/repos/datastax/nodejs-driver/stargazers","contributors_url":"https://api.github.com/repos/datastax/nodejs-driver/contributors","subscribers_url":"https://api.github.com/repos/datastax/nodejs-driver/subscribers","subscription_url":"https://api.github.com/repos/datastax/nodejs-driver/subscription","commits_url":"https://api.github.com/repos/datastax/nodejs-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/datastax/nodejs-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/datastax/nodejs-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/datastax/nodejs-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/datastax/nodejs-driver/contents/{+path}","compare_url":"https://api.github.com/repos/datastax/nodejs-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datastax/nodejs-driver/merges","archive_url":"https://api.github.com/repos/datastax/nodejs-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datastax/nodejs-driver/downloads","issues_url":"https://api.github.com/repos/datastax/nodejs-driver/issues{/number}","pulls_url":"https://api.github.com/repos/datastax/nodejs-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/datastax/nodejs-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/datastax/nodejs-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datastax/nodejs-driver/labels{/name}","releases_url":"https://api.github.com/repos/datastax/nodejs-driver/releases{/id}","deployments_url":"https://api.github.com/repos/datastax/nodejs-driver/deployments","created_at":"2014-09-05T14:46:37Z","updated_at":"2018-07-19T20:36:39Z","pushed_at":"2018-07-19T22:04:09Z","git_url":"git://github.com/datastax/nodejs-driver.git","ssh_url":"git@github.com:datastax/nodejs-driver.git","clone_url":"https://github.com/datastax/nodejs-driver.git","svn_url":"https://github.com/datastax/nodejs-driver","homepage":null,"size":4004,"stargazers_count":777,"watchers_count":777,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":128,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":128,"open_issues":4,"watchers":777,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/datastax/nodejs-driver/pulls/281"},"html":{"href":"https://github.com/datastax/nodejs-driver/pull/281"},"issue":{"href":"https://api.github.com/repos/datastax/nodejs-driver/issues/281"},"comments":{"href":"https://api.github.com/repos/datastax/nodejs-driver/issues/281/comments"},"review_comments":{"href":"https://api.github.com/repos/datastax/nodejs-driver/pulls/281/comments"},"review_comment":{"href":"https://api.github.com/repos/datastax/nodejs-driver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/datastax/nodejs-driver/pulls/281/commits"},"statuses":{"href":"https://api.github.com/repos/datastax/nodejs-driver/statuses/bf70de8a19b8bd20b552e0d542b84c87f56a1980"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jorgebay"}}