GitHub PullRequestReviewCommentEvent at 2014-08-14 18:16:37
Repository: spark-cassandra-connector
Actor: koeninger
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/datastax/spark-cassandra-connector/pulls/comments/16255654","id":16255654,"diff_hunk":"@@ -34,11 +34,21 @@ object CassandraConnectorConf {\n   }\n \n   def apply(conf: SparkConf): CassandraConnectorConf = {\n-    val host = InetAddress.getByName(conf.get(CassandraConnectionHostProperty, InetAddress.getLocalHost.getHostAddress))\n+    val hosts = conf.get(CassandraConnectionHostProperty, InetAddress.getLocalHost.getHostAddress).\n+      split(\",\").\n+      flatMap { host =>\n+        try {\n+          Some(InetAddress.getByName(host))\n+        } catch {\n+          case x: java.net.UnknownHostException =>\n+            logError(\"Unknown host\", x)\n+            None\n+        }\n+      }.toSet","path":"spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/cql/CassandraConnectorConf.scala","position":33,"original_position":33,"commit_id":"e139fbf7c65ad1d280da0d10f632e292e0013b73","original_commit_id":"e139fbf7c65ad1d280da0d10f632e292e0013b73","user":{"login":"koeninger","id":98311,"avatar_url":"https://avatars.githubusercontent.com/u/98311?v=2","gravatar_id":"43db6edb2c82a7c76cb5b5911391f02a","url":"https://api.github.com/users/koeninger","html_url":"https://github.com/koeninger","followers_url":"https://api.github.com/users/koeninger/followers","following_url":"https://api.github.com/users/koeninger/following{/other_user}","gists_url":"https://api.github.com/users/koeninger/gists{/gist_id}","starred_url":"https://api.github.com/users/koeninger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koeninger/subscriptions","organizations_url":"https://api.github.com/users/koeninger/orgs","repos_url":"https://api.github.com/users/koeninger/repos","events_url":"https://api.github.com/users/koeninger/events{/privacy}","received_events_url":"https://api.github.com/users/koeninger/received_events","type":"User","site_admin":false},"body":"That will give you a set of strings, not a set of InetAddress.\r\n\r\nIf you meant something like\r\n\r\nval hostsWithFailover = Try(immutableSeq(conf.get(CassandraConnectionHostProperty,\r\n      InetAddress.getLocalHost.getHostAddress).split(\",\").map(InetAddress.getByName) \r\n)).toOption.toSet.flatten\r\n\r\nthat will fail fast (ie if the first host is bad you'll get an empty set) and silently (no error message as to which host was bad)\r\n\r\nAs a user, I'd want an error message so that I'd know a host was down or my configuration was bad.  I'd also want the connector to connect to a host if at least one was usable.  I think that's what this patch does.\r\n","created_at":"2014-08-14T18:16:37Z","updated_at":"2014-08-14T18:16:37Z","html_url":"https://github.com/datastax/spark-cassandra-connector/pull/163#discussion_r16255654","pull_request_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/pulls/163","_links":{"self":{"href":"https://api.github.com/repos/datastax/spark-cassandra-connector/pulls/comments/16255654"},"html":{"href":"https://github.com/datastax/spark-cassandra-connector/pull/163#discussion_r16255654"},"pull_request":{"href":"https://api.github.com/repos/datastax/spark-cassandra-connector/pulls/163"}}},"pull_request":{"url":"https://api.github.com/repos/datastax/spark-cassandra-connector/pulls/163","id":19802381,"html_url":"https://github.com/datastax/spark-cassandra-connector/pull/163","diff_url":"https://github.com/datastax/spark-cassandra-connector/pull/163.diff","patch_url":"https://github.com/datastax/spark-cassandra-connector/pull/163.patch","issue_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/issues/163","number":163,"state":"open","locked":false,"title":"Allow multiple comma-separated hosts in spark.cassandra.connection.host","user":{"login":"koeninger","id":98311,"avatar_url":"https://avatars.githubusercontent.com/u/98311?v=2","gravatar_id":"43db6edb2c82a7c76cb5b5911391f02a","url":"https://api.github.com/users/koeninger","html_url":"https://github.com/koeninger","followers_url":"https://api.github.com/users/koeninger/followers","following_url":"https://api.github.com/users/koeninger/following{/other_user}","gists_url":"https://api.github.com/users/koeninger/gists{/gist_id}","starred_url":"https://api.github.com/users/koeninger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koeninger/subscriptions","organizations_url":"https://api.github.com/users/koeninger/orgs","repos_url":"https://api.github.com/users/koeninger/repos","events_url":"https://api.github.com/users/koeninger/events{/privacy}","received_events_url":"https://api.github.com/users/koeninger/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-08-14T17:35:48Z","updated_at":"2014-08-14T18:16:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ae186923a1a68de9aecea8a11cfb66df5101f77","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/pulls/163/commits","review_comments_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/pulls/163/comments","review_comment_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/pulls/comments/{number}","comments_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/issues/163/comments","statuses_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/statuses/e139fbf7c65ad1d280da0d10f632e292e0013b73","head":{"label":"mediacrossinginc:mx_multiseed","ref":"mx_multiseed","sha":"e139fbf7c65ad1d280da0d10f632e292e0013b73","user":{"login":"mediacrossinginc","id":3456789,"avatar_url":"https://avatars.githubusercontent.com/u/3456789?v=2","gravatar_id":null,"url":"https://api.github.com/users/mediacrossinginc","html_url":"https://github.com/mediacrossinginc","followers_url":"https://api.github.com/users/mediacrossinginc/followers","following_url":"https://api.github.com/users/mediacrossinginc/following{/other_user}","gists_url":"https://api.github.com/users/mediacrossinginc/gists{/gist_id}","starred_url":"https://api.github.com/users/mediacrossinginc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediacrossinginc/subscriptions","organizations_url":"https://api.github.com/users/mediacrossinginc/orgs","repos_url":"https://api.github.com/users/mediacrossinginc/repos","events_url":"https://api.github.com/users/mediacrossinginc/events{/privacy}","received_events_url":"https://api.github.com/users/mediacrossinginc/received_events","type":"Organization","site_admin":false},"repo":{"id":22917847,"name":"spark-cassandra-connector","full_name":"mediacrossinginc/spark-cassandra-connector","owner":{"login":"mediacrossinginc","id":3456789,"avatar_url":"https://avatars.githubusercontent.com/u/3456789?v=2","gravatar_id":null,"url":"https://api.github.com/users/mediacrossinginc","html_url":"https://github.com/mediacrossinginc","followers_url":"https://api.github.com/users/mediacrossinginc/followers","following_url":"https://api.github.com/users/mediacrossinginc/following{/other_user}","gists_url":"https://api.github.com/users/mediacrossinginc/gists{/gist_id}","starred_url":"https://api.github.com/users/mediacrossinginc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediacrossinginc/subscriptions","organizations_url":"https://api.github.com/users/mediacrossinginc/orgs","repos_url":"https://api.github.com/users/mediacrossinginc/repos","events_url":"https://api.github.com/users/mediacrossinginc/events{/privacy}","received_events_url":"https://api.github.com/users/mediacrossinginc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mediacrossinginc/spark-cassandra-connector","description":"If you write a Spark application that needs access to Cassandra, this library is for you","fork":true,"url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector","forks_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/forks","keys_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/teams","hooks_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/hooks","issue_events_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/issues/events{/number}","events_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/events","assignees_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/assignees{/user}","branches_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/branches{/branch}","tags_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/tags","blobs_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/git/refs{/sha}","trees_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/statuses/{sha}","languages_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/languages","stargazers_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/stargazers","contributors_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/contributors","subscribers_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/subscribers","subscription_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/subscription","commits_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/commits{/sha}","git_commits_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/git/commits{/sha}","comments_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/comments{/number}","issue_comment_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/issues/comments/{number}","contents_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/contents/{+path}","compare_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/merges","archive_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/downloads","issues_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/issues{/number}","pulls_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/pulls{/number}","milestones_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/milestones{/number}","notifications_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/labels{/name}","releases_url":"https://api.github.com/repos/mediacrossinginc/spark-cassandra-connector/releases{/id}","created_at":"2014-08-13T14:08:24Z","updated_at":"2014-08-13T13:11:09Z","pushed_at":"2014-08-14T17:33:42Z","git_url":"git://github.com/mediacrossinginc/spark-cassandra-connector.git","ssh_url":"git@github.com:mediacrossinginc/spark-cassandra-connector.git","clone_url":"https://github.com/mediacrossinginc/spark-cassandra-connector.git","svn_url":"https://github.com/mediacrossinginc/spark-cassandra-connector","homepage":"","size":3946,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"datastax:master","ref":"master","sha":"71f08169a904fae0a1963daefeb5a6ebc9bc16ee","user":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=2","gravatar_id":"5cd14d804ff6455946254031d35efd3a","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":21280887,"name":"spark-cassandra-connector","full_name":"datastax/spark-cassandra-connector","owner":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=2","gravatar_id":"5cd14d804ff6455946254031d35efd3a","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/spark-cassandra-connector","description":"If you write a Spark application that needs access to Cassandra, this library is for you","fork":false,"url":"https://api.github.com/repos/datastax/spark-cassandra-connector","forks_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/forks","keys_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/teams","hooks_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/hooks","issue_events_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/issues/events{/number}","events_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/events","assignees_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/assignees{/user}","branches_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/branches{/branch}","tags_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/tags","blobs_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/git/refs{/sha}","trees_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/statuses/{sha}","languages_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/languages","stargazers_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/stargazers","contributors_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/contributors","subscribers_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/subscribers","subscription_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/subscription","commits_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/commits{/sha}","git_commits_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/git/commits{/sha}","comments_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/comments{/number}","issue_comment_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/issues/comments/{number}","contents_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/contents/{+path}","compare_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/merges","archive_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/downloads","issues_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/issues{/number}","pulls_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/pulls{/number}","milestones_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/milestones{/number}","notifications_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/labels{/name}","releases_url":"https://api.github.com/repos/datastax/spark-cassandra-connector/releases{/id}","created_at":"2014-06-27T15:45:54Z","updated_at":"2014-08-13T13:11:09Z","pushed_at":"2014-08-14T12:35:08Z","git_url":"git://github.com/datastax/spark-cassandra-connector.git","ssh_url":"git@github.com:datastax/spark-cassandra-connector.git","clone_url":"https://github.com/datastax/spark-cassandra-connector.git","svn_url":"https://github.com/datastax/spark-cassandra-connector","homepage":"","size":3946,"stargazers_count":151,"watchers_count":151,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":35,"mirror_url":null,"open_issues_count":38,"forks":35,"open_issues":38,"watchers":151,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/datastax/spark-cassandra-connector/pulls/163"},"html":{"href":"https://github.com/datastax/spark-cassandra-connector/pull/163"},"issue":{"href":"https://api.github.com/repos/datastax/spark-cassandra-connector/issues/163"},"comments":{"href":"https://api.github.com/repos/datastax/spark-cassandra-connector/issues/163/comments"},"review_comments":{"href":"https://api.github.com/repos/datastax/spark-cassandra-connector/pulls/163/comments"},"review_comment":{"href":"https://api.github.com/repos/datastax/spark-cassandra-connector/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/datastax/spark-cassandra-connector/pulls/163/commits"},"statuses":{"href":"https://api.github.com/repos/datastax/spark-cassandra-connector/statuses/e139fbf7c65ad1d280da0d10f632e292e0013b73"}}}}