{"action":"created","comment":{"url":"https://api.github.com/repos/infinispan/infinispan/pulls/comments/31249201","id":31249201,"diff_hunk":"@@ -0,0 +1,127 @@\n+package org.infinispan.server.hotrod.iteration\n+\n+import java.io.{ObjectInput, ObjectOutput}\n+\n+import org.infinispan.commons.io.UnsignedNumeric\n+import org.infinispan.commons.marshall.{AbstractExternalizer, Marshaller}\n+import org.infinispan.distribution.DistributionManager\n+import org.infinispan.distribution.ch.ConsistentHash\n+import org.infinispan.factories.annotations.Inject\n+import org.infinispan.filter.{AbstractKeyValueFilterConverter, KeyValueFilterConverter}\n+import org.infinispan.metadata.Metadata\n+import org.infinispan.server.hotrod._\n+\n+import scala.collection.JavaConversions._\n+\n+/**\n+ * @author gustavonalle\n+ * @since 8.0\n+ */\n+\n+trait InjectableFilter[K, V, C] extends AbstractKeyValueFilterConverter[K, V, C] {\n+   var cache: Cache = _\n+\n+   @Inject def injectDependencies(cache: Cache) {\n+      this.cache = cache\n+   }\n+}\n+\n+class WrappedFilter[K, V, C, D](val outer: InjectableFilter[K, C, D], val inner: InjectableFilter[K, V, C]) extends InjectableFilter[K, V, D] {\n+   @Inject\n+   override def injectDependencies(cache: Cache): Unit = {\n+      outer.injectDependencies(cache)\n+      inner.injectDependencies(cache)\n+   }\n+\n+   override def filterAndConvert(key: K, value: V, metadata: Metadata): D = {\n+      val innerResult = inner.filterAndConvert(key, value, metadata)\n+      if (innerResult == null) null.asInstanceOf[D]\n+      else {\n+         outer.filterAndConvert(key, innerResult, metadata)\n+      }\n+   }\n+}\n+\n+object WrappedFilter {\n+   def apply[K, V, C, D](outer: InjectableFilter[K, C, D],\n+                         inner: InjectableFilter[K, V, C]): WrappedFilter[K, V, C, D] =\n+      new WrappedFilter(outer, inner)\n+}\n+\n+class WrappedFilterExternalizer[K, V, C, D] extends AbstractExternalizer[WrappedFilter[K, V, C, D]] {\n+   override def getTypeClasses = setAsJavaSet(Set(classOf[WrappedFilter[K, V, C, D]]))\n+\n+   override def writeObject(output: ObjectOutput, obj: WrappedFilter[K, V, C, D]) = {\n+      output.writeObject(obj.outer)\n+      output.writeObject(obj.inner)\n+   }\n+\n+   override def readObject(input: ObjectInput): WrappedFilter[K, V, C, D] = {\n+      val outer = input.readObject().asInstanceOf[InjectableFilter[K, C, D]]\n+      val inner = input.readObject().asInstanceOf[InjectableFilter[K, V, C]]\n+      WrappedFilter(outer, inner)\n+   }\n+}\n+\n+class UnmarshallKeyValueFilterConverter[K, V, C](val delegate: KeyValueFilterConverter[K, V, C], val marshallerClass: Class[_ <: Marshaller]) extends InjectableFilter[Bytes, Bytes, Bytes] {","path":"server/hotrod/src/main/scala/org/infinispan/server/hotrod/iteration/IterationFilters.scala","position":66,"original_position":66,"commit_id":"8286f31481121ea18a48eb468dde37fe6b95bc48","original_commit_id":"8286f31481121ea18a48eb468dde37fe6b95bc48","user":{"login":"gustavonalle","id":440989,"avatar_url":"https://avatars.githubusercontent.com/u/440989?v=3","gravatar_id":"","url":"https://api.github.com/users/gustavonalle","html_url":"https://github.com/gustavonalle","followers_url":"https://api.github.com/users/gustavonalle/followers","following_url":"https://api.github.com/users/gustavonalle/following{/other_user}","gists_url":"https://api.github.com/users/gustavonalle/gists{/gist_id}","starred_url":"https://api.github.com/users/gustavonalle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gustavonalle/subscriptions","organizations_url":"https://api.github.com/users/gustavonalle/orgs","repos_url":"https://api.github.com/users/gustavonalle/repos","events_url":"https://api.github.com/users/gustavonalle/events{/privacy}","received_events_url":"https://api.github.com/users/gustavonalle/received_events","type":"User","site_admin":false},"body":"wrt to the wrappers, I'll have to reorganize them a bit since I've discovered an issue with iterating with compatibility mode on","created_at":"2015-05-28T16:01:54Z","updated_at":"2015-05-28T16:01:54Z","html_url":"https://github.com/infinispan/infinispan/pull/3511#discussion_r31249201","pull_request_url":"https://api.github.com/repos/infinispan/infinispan/pulls/3511","_links":{"self":{"href":"https://api.github.com/repos/infinispan/infinispan/pulls/comments/31249201"},"html":{"href":"https://github.com/infinispan/infinispan/pull/3511#discussion_r31249201"},"pull_request":{"href":"https://api.github.com/repos/infinispan/infinispan/pulls/3511"}}},"pull_request":{"url":"https://api.github.com/repos/infinispan/infinispan/pulls/3511","id":36245725,"html_url":"https://github.com/infinispan/infinispan/pull/3511","diff_url":"https://github.com/infinispan/infinispan/pull/3511.diff","patch_url":"https://github.com/infinispan/infinispan/pull/3511.patch","issue_url":"https://api.github.com/repos/infinispan/infinispan/issues/3511","number":3511,"state":"open","locked":false,"title":"ISPN-5219 Expose Distributed Iterators over HotRod","user":{"login":"gustavonalle","id":440989,"avatar_url":"https://avatars.githubusercontent.com/u/440989?v=3","gravatar_id":"","url":"https://api.github.com/users/gustavonalle","html_url":"https://github.com/gustavonalle","followers_url":"https://api.github.com/users/gustavonalle/followers","following_url":"https://api.github.com/users/gustavonalle/following{/other_user}","gists_url":"https://api.github.com/users/gustavonalle/gists{/gist_id}","starred_url":"https://api.github.com/users/gustavonalle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gustavonalle/subscriptions","organizations_url":"https://api.github.com/users/gustavonalle/orgs","repos_url":"https://api.github.com/users/gustavonalle/repos","events_url":"https://api.github.com/users/gustavonalle/events{/privacy}","received_events_url":"https://api.github.com/users/gustavonalle/received_events","type":"User","site_admin":false},"body":"https://issues.jboss.org/browse/ISPN-5219\r\n\r\nImplementation following design at https://github.com/infinispan/infinispan/wiki/Remote-Iterator","created_at":"2015-05-26T21:07:41Z","updated_at":"2015-05-28T16:01:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a7f3826eebf67d452677493461f8e354b47fdf20","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/infinispan/infinispan/pulls/3511/commits","review_comments_url":"https://api.github.com/repos/infinispan/infinispan/pulls/3511/comments","review_comment_url":"https://api.github.com/repos/infinispan/infinispan/pulls/comments{/number}","comments_url":"https://api.github.com/repos/infinispan/infinispan/issues/3511/comments","statuses_url":"https://api.github.com/repos/infinispan/infinispan/statuses/8286f31481121ea18a48eb468dde37fe6b95bc48","head":{"label":"gustavonalle:remote_iterator","ref":"remote_iterator","sha":"8286f31481121ea18a48eb468dde37fe6b95bc48","user":{"login":"gustavonalle","id":440989,"avatar_url":"https://avatars.githubusercontent.com/u/440989?v=3","gravatar_id":"","url":"https://api.github.com/users/gustavonalle","html_url":"https://github.com/gustavonalle","followers_url":"https://api.github.com/users/gustavonalle/followers","following_url":"https://api.github.com/users/gustavonalle/following{/other_user}","gists_url":"https://api.github.com/users/gustavonalle/gists{/gist_id}","starred_url":"https://api.github.com/users/gustavonalle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gustavonalle/subscriptions","organizations_url":"https://api.github.com/users/gustavonalle/orgs","repos_url":"https://api.github.com/users/gustavonalle/repos","events_url":"https://api.github.com/users/gustavonalle/events{/privacy}","received_events_url":"https://api.github.com/users/gustavonalle/received_events","type":"User","site_admin":false},"repo":{"id":20231400,"name":"infinispan","full_name":"gustavonalle/infinispan","owner":{"login":"gustavonalle","id":440989,"avatar_url":"https://avatars.githubusercontent.com/u/440989?v=3","gravatar_id":"","url":"https://api.github.com/users/gustavonalle","html_url":"https://github.com/gustavonalle","followers_url":"https://api.github.com/users/gustavonalle/followers","following_url":"https://api.github.com/users/gustavonalle/following{/other_user}","gists_url":"https://api.github.com/users/gustavonalle/gists{/gist_id}","starred_url":"https://api.github.com/users/gustavonalle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gustavonalle/subscriptions","organizations_url":"https://api.github.com/users/gustavonalle/orgs","repos_url":"https://api.github.com/users/gustavonalle/repos","events_url":"https://api.github.com/users/gustavonalle/events{/privacy}","received_events_url":"https://api.github.com/users/gustavonalle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gustavonalle/infinispan","description":"Infinispan is an open source data grid platform and highly scalable NoSQL cloud data store.","fork":true,"url":"https://api.github.com/repos/gustavonalle/infinispan","forks_url":"https://api.github.com/repos/gustavonalle/infinispan/forks","keys_url":"https://api.github.com/repos/gustavonalle/infinispan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gustavonalle/infinispan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gustavonalle/infinispan/teams","hooks_url":"https://api.github.com/repos/gustavonalle/infinispan/hooks","issue_events_url":"https://api.github.com/repos/gustavonalle/infinispan/issues/events{/number}","events_url":"https://api.github.com/repos/gustavonalle/infinispan/events","assignees_url":"https://api.github.com/repos/gustavonalle/infinispan/assignees{/user}","branches_url":"https://api.github.com/repos/gustavonalle/infinispan/branches{/branch}","tags_url":"https://api.github.com/repos/gustavonalle/infinispan/tags","blobs_url":"https://api.github.com/repos/gustavonalle/infinispan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gustavonalle/infinispan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gustavonalle/infinispan/git/refs{/sha}","trees_url":"https://api.github.com/repos/gustavonalle/infinispan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gustavonalle/infinispan/statuses/{sha}","languages_url":"https://api.github.com/repos/gustavonalle/infinispan/languages","stargazers_url":"https://api.github.com/repos/gustavonalle/infinispan/stargazers","contributors_url":"https://api.github.com/repos/gustavonalle/infinispan/contributors","subscribers_url":"https://api.github.com/repos/gustavonalle/infinispan/subscribers","subscription_url":"https://api.github.com/repos/gustavonalle/infinispan/subscription","commits_url":"https://api.github.com/repos/gustavonalle/infinispan/commits{/sha}","git_commits_url":"https://api.github.com/repos/gustavonalle/infinispan/git/commits{/sha}","comments_url":"https://api.github.com/repos/gustavonalle/infinispan/comments{/number}","issue_comment_url":"https://api.github.com/repos/gustavonalle/infinispan/issues/comments{/number}","contents_url":"https://api.github.com/repos/gustavonalle/infinispan/contents/{+path}","compare_url":"https://api.github.com/repos/gustavonalle/infinispan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gustavonalle/infinispan/merges","archive_url":"https://api.github.com/repos/gustavonalle/infinispan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gustavonalle/infinispan/downloads","issues_url":"https://api.github.com/repos/gustavonalle/infinispan/issues{/number}","pulls_url":"https://api.github.com/repos/gustavonalle/infinispan/pulls{/number}","milestones_url":"https://api.github.com/repos/gustavonalle/infinispan/milestones{/number}","notifications_url":"https://api.github.com/repos/gustavonalle/infinispan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gustavonalle/infinispan/labels{/name}","releases_url":"https://api.github.com/repos/gustavonalle/infinispan/releases{/id}","created_at":"2014-05-27T18:52:33Z","updated_at":"2015-05-06T08:02:25Z","pushed_at":"2015-05-27T19:12:12Z","git_url":"git://github.com/gustavonalle/infinispan.git","ssh_url":"git@github.com:gustavonalle/infinispan.git","clone_url":"https://github.com/gustavonalle/infinispan.git","svn_url":"https://github.com/gustavonalle/infinispan","homepage":"http://www.infinispan.org","size":67567,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"infinispan:master","ref":"master","sha":"4a37550e36201d7ace60f82b412ff06d3b043bfe","user":{"login":"infinispan","id":458093,"avatar_url":"https://avatars.githubusercontent.com/u/458093?v=3","gravatar_id":"","url":"https://api.github.com/users/infinispan","html_url":"https://github.com/infinispan","followers_url":"https://api.github.com/users/infinispan/followers","following_url":"https://api.github.com/users/infinispan/following{/other_user}","gists_url":"https://api.github.com/users/infinispan/gists{/gist_id}","starred_url":"https://api.github.com/users/infinispan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infinispan/subscriptions","organizations_url":"https://api.github.com/users/infinispan/orgs","repos_url":"https://api.github.com/users/infinispan/repos","events_url":"https://api.github.com/users/infinispan/events{/privacy}","received_events_url":"https://api.github.com/users/infinispan/received_events","type":"Organization","site_admin":false},"repo":{"id":1050944,"name":"infinispan","full_name":"infinispan/infinispan","owner":{"login":"infinispan","id":458093,"avatar_url":"https://avatars.githubusercontent.com/u/458093?v=3","gravatar_id":"","url":"https://api.github.com/users/infinispan","html_url":"https://github.com/infinispan","followers_url":"https://api.github.com/users/infinispan/followers","following_url":"https://api.github.com/users/infinispan/following{/other_user}","gists_url":"https://api.github.com/users/infinispan/gists{/gist_id}","starred_url":"https://api.github.com/users/infinispan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infinispan/subscriptions","organizations_url":"https://api.github.com/users/infinispan/orgs","repos_url":"https://api.github.com/users/infinispan/repos","events_url":"https://api.github.com/users/infinispan/events{/privacy}","received_events_url":"https://api.github.com/users/infinispan/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/infinispan/infinispan","description":"Infinispan is an open source data grid platform and highly scalable NoSQL cloud data store.","fork":false,"url":"https://api.github.com/repos/infinispan/infinispan","forks_url":"https://api.github.com/repos/infinispan/infinispan/forks","keys_url":"https://api.github.com/repos/infinispan/infinispan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/infinispan/infinispan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/infinispan/infinispan/teams","hooks_url":"https://api.github.com/repos/infinispan/infinispan/hooks","issue_events_url":"https://api.github.com/repos/infinispan/infinispan/issues/events{/number}","events_url":"https://api.github.com/repos/infinispan/infinispan/events","assignees_url":"https://api.github.com/repos/infinispan/infinispan/assignees{/user}","branches_url":"https://api.github.com/repos/infinispan/infinispan/branches{/branch}","tags_url":"https://api.github.com/repos/infinispan/infinispan/tags","blobs_url":"https://api.github.com/repos/infinispan/infinispan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/infinispan/infinispan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/infinispan/infinispan/git/refs{/sha}","trees_url":"https://api.github.com/repos/infinispan/infinispan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/infinispan/infinispan/statuses/{sha}","languages_url":"https://api.github.com/repos/infinispan/infinispan/languages","stargazers_url":"https://api.github.com/repos/infinispan/infinispan/stargazers","contributors_url":"https://api.github.com/repos/infinispan/infinispan/contributors","subscribers_url":"https://api.github.com/repos/infinispan/infinispan/subscribers","subscription_url":"https://api.github.com/repos/infinispan/infinispan/subscription","commits_url":"https://api.github.com/repos/infinispan/infinispan/commits{/sha}","git_commits_url":"https://api.github.com/repos/infinispan/infinispan/git/commits{/sha}","comments_url":"https://api.github.com/repos/infinispan/infinispan/comments{/number}","issue_comment_url":"https://api.github.com/repos/infinispan/infinispan/issues/comments{/number}","contents_url":"https://api.github.com/repos/infinispan/infinispan/contents/{+path}","compare_url":"https://api.github.com/repos/infinispan/infinispan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/infinispan/infinispan/merges","archive_url":"https://api.github.com/repos/infinispan/infinispan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/infinispan/infinispan/downloads","issues_url":"https://api.github.com/repos/infinispan/infinispan/issues{/number}","pulls_url":"https://api.github.com/repos/infinispan/infinispan/pulls{/number}","milestones_url":"https://api.github.com/repos/infinispan/infinispan/milestones{/number}","notifications_url":"https://api.github.com/repos/infinispan/infinispan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/infinispan/infinispan/labels{/name}","releases_url":"https://api.github.com/repos/infinispan/infinispan/releases{/id}","created_at":"2010-11-04T12:33:19Z","updated_at":"2015-05-20T16:43:16Z","pushed_at":"2015-05-28T14:44:12Z","git_url":"git://github.com/infinispan/infinispan.git","ssh_url":"git@github.com:infinispan/infinispan.git","clone_url":"https://github.com/infinispan/infinispan.git","svn_url":"https://github.com/infinispan/infinispan","homepage":"http://www.infinispan.org","size":153561,"stargazers_count":381,"watchers_count":381,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":290,"mirror_url":null,"open_issues_count":10,"forks":290,"open_issues":10,"watchers":381,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/infinispan/infinispan/pulls/3511"},"html":{"href":"https://github.com/infinispan/infinispan/pull/3511"},"issue":{"href":"https://api.github.com/repos/infinispan/infinispan/issues/3511"},"comments":{"href":"https://api.github.com/repos/infinispan/infinispan/issues/3511/comments"},"review_comments":{"href":"https://api.github.com/repos/infinispan/infinispan/pulls/3511/comments"},"review_comment":{"href":"https://api.github.com/repos/infinispan/infinispan/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/infinispan/infinispan/pulls/3511/commits"},"statuses":{"href":"https://api.github.com/repos/infinispan/infinispan/statuses/8286f31481121ea18a48eb468dde37fe6b95bc48"}}}}