{"action":"created","comment":{"url":"https://api.github.com/repos/datastax/java-driver/pulls/comments/34992922","id":34992922,"diff_hunk":"@@ -48,10 +48,12 @@\n     <log4j.version>1.2.17</log4j.version>\n     <slf4j-log4j12.version>1.7.6</slf4j-log4j12.version>\n     <!--\n-      We use an old version of Guava to be compatible with Spark 1.1.\n-      Check with the spark-cassandra-connector team before upgrading this.\n+      Warning: since JAVA-721, Guava version MUST be >= 16.0.1\n+      https://code.google.com/p/guava-libraries/issues/detail?id=1635\n+      https://code.google.com/p/guava-libraries/issues/detail?id=1637\n+      https://bugs.openjdk.java.net/browse/JDK-8031984\n     -->\n-    <guava.version>14.0.1</guava.version>\n+    <guava.version>16.0.1</guava.version>","path":"pom.xml","position":12,"original_position":12,"commit_id":"a8ff72e342a8e218211f88197d37388794822716","original_commit_id":"032fb3a69a1199885d876b9007cff165e1de9ef0","user":{"login":"adutra","id":463876,"avatar_url":"https://avatars.githubusercontent.com/u/463876?v=3","gravatar_id":"","url":"https://api.github.com/users/adutra","html_url":"https://github.com/adutra","followers_url":"https://api.github.com/users/adutra/followers","following_url":"https://api.github.com/users/adutra/following{/other_user}","gists_url":"https://api.github.com/users/adutra/gists{/gist_id}","starred_url":"https://api.github.com/users/adutra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adutra/subscriptions","organizations_url":"https://api.github.com/users/adutra/orgs","repos_url":"https://api.github.com/users/adutra/repos","events_url":"https://api.github.com/users/adutra/events{/privacy}","received_events_url":"https://api.github.com/users/adutra/received_events","type":"User","site_admin":false},"body":"Will bump to 18.0; feels like it's now or never.","created_at":"2015-07-20T13:19:28Z","updated_at":"2015-07-20T13:19:28Z","html_url":"https://github.com/datastax/java-driver/pull/387#discussion_r34992922","pull_request_url":"https://api.github.com/repos/datastax/java-driver/pulls/387","_links":{"self":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/comments/34992922"},"html":{"href":"https://github.com/datastax/java-driver/pull/387#discussion_r34992922"},"pull_request":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/387"}}},"pull_request":{"url":"https://api.github.com/repos/datastax/java-driver/pulls/387","id":38447297,"html_url":"https://github.com/datastax/java-driver/pull/387","diff_url":"https://github.com/datastax/java-driver/pull/387.diff","patch_url":"https://github.com/datastax/java-driver/pull/387.patch","issue_url":"https://api.github.com/repos/datastax/java-driver/issues/387","number":387,"state":"open","locked":false,"title":"JAVA-721: Allow user to register custom type codecs (2.2 branch).","user":{"login":"adutra","id":463876,"avatar_url":"https://avatars.githubusercontent.com/u/463876?v=3","gravatar_id":"","url":"https://api.github.com/users/adutra","html_url":"https://github.com/adutra","followers_url":"https://api.github.com/users/adutra/followers","following_url":"https://api.github.com/users/adutra/following{/other_user}","gists_url":"https://api.github.com/users/adutra/gists{/gist_id}","starred_url":"https://api.github.com/users/adutra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adutra/subscriptions","organizations_url":"https://api.github.com/users/adutra/orgs","repos_url":"https://api.github.com/users/adutra/repos","events_url":"https://api.github.com/users/adutra/events{/privacy}","received_events_url":"https://api.github.com/users/adutra/received_events","type":"User","site_admin":false},"body":"Use cases are:\r\n\r\n* global (per cluster): use a CodecRegistry class to retrieve codecs, configurable on a per-cluster basis (e.g. to deserialize CQL timestamps as Joda or Java 8 classes)\r\n* particular (per table/column): override the global codec on a per table/column basis (e.g. to deserialize a text CQL type as a JSON object)\r\n\r\nThe 2nd use case will only be possible for `GettableData` instances (`BoundStatement`s and `Row`s basically). It will not be available for `SimpleStatement`s nor `BuiltStatement`s (because these do not have any information about types). In other words, customizing serialization on a per-column basis will only be feasible when using prepared statements.\r\n\r\nSummary of changes:\r\n\r\nMaven\r\n* Guava HAS to be 16.0.1 or higher, see [this](https://code.google.com/p/guava-libraries/issues/detail?id=1635) for details.\r\n\r\nTypeCodec\r\n* Now public API, most static methods moved to `CodecRegistry`;\r\n* Now a codec can only handle one Java type and one CQL type, so some existing codecs have been refactored;\r\n* New inspection methods to verify if a codec can handle specific types (`accepts(X)`).\r\n\r\nDataType\r\n* No more references to `TypeCodec`, the logic is transferred to `CodecRegistry` (because it's now dynamic);\r\n* Most static methods that serialize and deserialize have been removed;\r\n* The `javaClass` attribute has been removed;\r\n\r\nCodecRegistry\r\n* New class that contains all the known codecs;\r\n* Has a builder;\r\n* Has a cache for Java/CQL types to codecs;\r\n* Can be associated with a Cluster: `builder.withCodecRegistry()`;\r\n* Can be retrieved in a Cluster: `cluster.getConfiguration().getCodecRegistry()`;\r\n* The default registry is `CodecRegistry.DEFAULT_INSTANCE`;\r\n* Throws `CodecNotFoundException`.\r\n\r\nSerializing values\r\n* `SimpleStatement` and `BuiltStatement` versions of `getValues()`: now use a unified `convert()` method in `CodecUtils`;\r\n* `BoundStatement.bind()`: guesses the best codec;\r\n* `BoundStatement` methods `setBool()`, `setInt()` etc: retrieve the exact codec as implied by the method contract (i.e. `setBool()` will look for a codec that handles `Boolean <-> cbool` exclusively). _These methods can only be used if appropriate codecs are available (e.g. the default ones)_.\r\n* Alternatively, `BoundStatement` has new `setObject(Object, X)` methods that accept a Java type as a second parameter.\r\n\r\nDeserializing values\r\n* New methods `getObjec(int, X)` and `getObject(String, X)` in `GettableData`: retrieve and object using the provided java type; the appropriate codec is looked up in the cluster's `CodecRegistry`;\r\n* Methods `getBool()`, `getInt()`, etc. in `AbstractGettableData`: deserialize with exact codec as implied by the method contract. _These methods can only be used if appropriate codecs are available (e.g. the default ones), otherwise they would throw `ClassCastException`s_.\r\n\r\nTokens\r\n* Token instances are always serialized and deserialized with default codecs\r\n* Routing Keys: serialization of routing keys for `BuiltStatement` is now deferred, `BuiltStatement.buildRoutingKey(ProtocolVersion)` must be invoked prior to `BuiltStatement.getRoutingKey()`\r\n\r\nUDTs and Tuples\r\n* Constructors have changed\r\n* `Tuple.of()` is now deprecated in favor of `Metadata.newTupleType()`\r\n\r\nTests\r\n* See `TypeCodecXXXTest` and `CodecRegistryTest` for examples of JSON serialization and fancy codecs\r\n","created_at":"2015-06-24T14:24:13Z","updated_at":"2015-07-20T13:19:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1eae2a126488a2404c8f72769a78cbbd3d49810","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/datastax/java-driver/pulls/387/commits","review_comments_url":"https://api.github.com/repos/datastax/java-driver/pulls/387/comments","review_comment_url":"https://api.github.com/repos/datastax/java-driver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/datastax/java-driver/issues/387/comments","statuses_url":"https://api.github.com/repos/datastax/java-driver/statuses/a8ff72e342a8e218211f88197d37388794822716","head":{"label":"datastax:java721-2.2","ref":"java721-2.2","sha":"a8ff72e342a8e218211f88197d37388794822716","user":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","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":6765281,"name":"java-driver","full_name":"datastax/java-driver","owner":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","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/java-driver","description":"DataStax Java Driver for Apache Cassandra","fork":false,"url":"https://api.github.com/repos/datastax/java-driver","forks_url":"https://api.github.com/repos/datastax/java-driver/forks","keys_url":"https://api.github.com/repos/datastax/java-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datastax/java-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datastax/java-driver/teams","hooks_url":"https://api.github.com/repos/datastax/java-driver/hooks","issue_events_url":"https://api.github.com/repos/datastax/java-driver/issues/events{/number}","events_url":"https://api.github.com/repos/datastax/java-driver/events","assignees_url":"https://api.github.com/repos/datastax/java-driver/assignees{/user}","branches_url":"https://api.github.com/repos/datastax/java-driver/branches{/branch}","tags_url":"https://api.github.com/repos/datastax/java-driver/tags","blobs_url":"https://api.github.com/repos/datastax/java-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datastax/java-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datastax/java-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/datastax/java-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datastax/java-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/datastax/java-driver/languages","stargazers_url":"https://api.github.com/repos/datastax/java-driver/stargazers","contributors_url":"https://api.github.com/repos/datastax/java-driver/contributors","subscribers_url":"https://api.github.com/repos/datastax/java-driver/subscribers","subscription_url":"https://api.github.com/repos/datastax/java-driver/subscription","commits_url":"https://api.github.com/repos/datastax/java-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/datastax/java-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/datastax/java-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/datastax/java-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/datastax/java-driver/contents/{+path}","compare_url":"https://api.github.com/repos/datastax/java-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datastax/java-driver/merges","archive_url":"https://api.github.com/repos/datastax/java-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datastax/java-driver/downloads","issues_url":"https://api.github.com/repos/datastax/java-driver/issues{/number}","pulls_url":"https://api.github.com/repos/datastax/java-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/datastax/java-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/datastax/java-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datastax/java-driver/labels{/name}","releases_url":"https://api.github.com/repos/datastax/java-driver/releases{/id}","created_at":"2012-11-19T18:44:41Z","updated_at":"2015-07-17T17:36:53Z","pushed_at":"2015-07-20T10:01:42Z","git_url":"git://github.com/datastax/java-driver.git","ssh_url":"git@github.com:datastax/java-driver.git","clone_url":"https://github.com/datastax/java-driver.git","svn_url":"https://github.com/datastax/java-driver","homepage":null,"size":21510,"stargazers_count":486,"watchers_count":486,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":344,"mirror_url":null,"open_issues_count":34,"forks":344,"open_issues":34,"watchers":486,"default_branch":"2.1"}},"base":{"label":"datastax:2.2","ref":"2.2","sha":"c1d8d70035a9e6d9795c188c0af67d9e7d6cbb60","user":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","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":6765281,"name":"java-driver","full_name":"datastax/java-driver","owner":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","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/java-driver","description":"DataStax Java Driver for Apache Cassandra","fork":false,"url":"https://api.github.com/repos/datastax/java-driver","forks_url":"https://api.github.com/repos/datastax/java-driver/forks","keys_url":"https://api.github.com/repos/datastax/java-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datastax/java-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datastax/java-driver/teams","hooks_url":"https://api.github.com/repos/datastax/java-driver/hooks","issue_events_url":"https://api.github.com/repos/datastax/java-driver/issues/events{/number}","events_url":"https://api.github.com/repos/datastax/java-driver/events","assignees_url":"https://api.github.com/repos/datastax/java-driver/assignees{/user}","branches_url":"https://api.github.com/repos/datastax/java-driver/branches{/branch}","tags_url":"https://api.github.com/repos/datastax/java-driver/tags","blobs_url":"https://api.github.com/repos/datastax/java-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datastax/java-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datastax/java-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/datastax/java-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datastax/java-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/datastax/java-driver/languages","stargazers_url":"https://api.github.com/repos/datastax/java-driver/stargazers","contributors_url":"https://api.github.com/repos/datastax/java-driver/contributors","subscribers_url":"https://api.github.com/repos/datastax/java-driver/subscribers","subscription_url":"https://api.github.com/repos/datastax/java-driver/subscription","commits_url":"https://api.github.com/repos/datastax/java-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/datastax/java-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/datastax/java-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/datastax/java-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/datastax/java-driver/contents/{+path}","compare_url":"https://api.github.com/repos/datastax/java-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datastax/java-driver/merges","archive_url":"https://api.github.com/repos/datastax/java-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datastax/java-driver/downloads","issues_url":"https://api.github.com/repos/datastax/java-driver/issues{/number}","pulls_url":"https://api.github.com/repos/datastax/java-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/datastax/java-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/datastax/java-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datastax/java-driver/labels{/name}","releases_url":"https://api.github.com/repos/datastax/java-driver/releases{/id}","created_at":"2012-11-19T18:44:41Z","updated_at":"2015-07-17T17:36:53Z","pushed_at":"2015-07-20T10:01:42Z","git_url":"git://github.com/datastax/java-driver.git","ssh_url":"git@github.com:datastax/java-driver.git","clone_url":"https://github.com/datastax/java-driver.git","svn_url":"https://github.com/datastax/java-driver","homepage":null,"size":21510,"stargazers_count":486,"watchers_count":486,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":344,"mirror_url":null,"open_issues_count":34,"forks":344,"open_issues":34,"watchers":486,"default_branch":"2.1"}},"_links":{"self":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/387"},"html":{"href":"https://github.com/datastax/java-driver/pull/387"},"issue":{"href":"https://api.github.com/repos/datastax/java-driver/issues/387"},"comments":{"href":"https://api.github.com/repos/datastax/java-driver/issues/387/comments"},"review_comments":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/387/comments"},"review_comment":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/387/commits"},"statuses":{"href":"https://api.github.com/repos/datastax/java-driver/statuses/a8ff72e342a8e218211f88197d37388794822716"}}}}