{"action":"created","comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/pulls/comments/37642411","id":37642411,"diff_hunk":"@@ -0,0 +1,196 @@\n+/*\n+ * Copyright 2015 the original author or authors.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.springframework.cloud.data.admin.repository;\n+\n+import java.util.ArrayList;\n+import java.util.Collection;\n+import java.util.HashMap;\n+import java.util.HashSet;\n+import java.util.Iterator;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.Set;\n+\n+import org.springframework.cloud.data.core.StreamDefinition;\n+import org.springframework.data.domain.Page;\n+import org.springframework.data.domain.PageImpl;\n+import org.springframework.data.domain.PageRequest;\n+import org.springframework.data.domain.Pageable;\n+import org.springframework.data.domain.Sort;\n+import org.springframework.data.redis.connection.RedisConnectionFactory;\n+import org.springframework.data.redis.core.BoundHashOperations;\n+import org.springframework.data.redis.core.BoundZSetOperations;\n+import org.springframework.data.redis.core.DefaultTypedTuple;\n+import org.springframework.data.redis.core.RedisTemplate;\n+import org.springframework.data.redis.core.ZSetOperations;\n+import org.springframework.data.redis.serializer.StringRedisSerializer;\n+\n+/**\n+ * A redis implementation of {@link StreamDefinitionRepository}, storing each\n+ * definition as a {@literal name:dsl} mapping in a redis hash.\n+ * Also stores the list of all names in a sorted set (with constant zero score), as this\n+ * guarantees lexicographic order.\n+ *\n+ * @author Eric Bottard\n+ */\n+public class RedisStreamDefinitionRepository implements StreamDefinitionRepository {\n+\n+\tprivate final BoundHashOperations<String, String, String> hashOperations;\n+\n+\tprivate final BoundZSetOperations<String, String> zSetOperations;\n+\n+\tprivate final String hashKey;\n+\n+\tpublic RedisStreamDefinitionRepository(String hashKey, RedisConnectionFactory redisConnectionFactory) {","path":"spring-cloud-data-admin/src/main/java/org/springframework/cloud/data/admin/repository/RedisStreamDefinitionRepository.java","position":58,"original_position":58,"commit_id":"d1551d0eb8a749bcabe44781a2752539742592f6","original_commit_id":"d1551d0eb8a749bcabe44781a2752539742592f6","user":{"login":"pperalta","id":394956,"avatar_url":"https://avatars.githubusercontent.com/u/394956?v=3","gravatar_id":"","url":"https://api.github.com/users/pperalta","html_url":"https://github.com/pperalta","followers_url":"https://api.github.com/users/pperalta/followers","following_url":"https://api.github.com/users/pperalta/following{/other_user}","gists_url":"https://api.github.com/users/pperalta/gists{/gist_id}","starred_url":"https://api.github.com/users/pperalta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pperalta/subscriptions","organizations_url":"https://api.github.com/users/pperalta/orgs","repos_url":"https://api.github.com/users/pperalta/repos","events_url":"https://api.github.com/users/pperalta/events{/privacy}","received_events_url":"https://api.github.com/users/pperalta/received_events","type":"User","site_admin":false},"body":"Can we have some JavaDoc for this constructor? ","created_at":"2015-08-21T14:58:17Z","updated_at":"2015-08-21T14:58:17Z","html_url":"https://github.com/spring-cloud/spring-cloud-data/pull/56#discussion_r37642411","pull_request_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/pulls/56","_links":{"self":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-data/pulls/comments/37642411"},"html":{"href":"https://github.com/spring-cloud/spring-cloud-data/pull/56#discussion_r37642411"},"pull_request":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-data/pulls/56"}}},"pull_request":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/pulls/56","id":43043264,"html_url":"https://github.com/spring-cloud/spring-cloud-data/pull/56","diff_url":"https://github.com/spring-cloud/spring-cloud-data/pull/56.diff","patch_url":"https://github.com/spring-cloud/spring-cloud-data/pull/56.patch","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/issues/56","number":56,"state":"open","locked":false,"title":"XD-2919: Add Redis based StreamDefinitionRepository","user":{"login":"ericbottard","id":313494,"avatar_url":"https://avatars.githubusercontent.com/u/313494?v=3","gravatar_id":"","url":"https://api.github.com/users/ericbottard","html_url":"https://github.com/ericbottard","followers_url":"https://api.github.com/users/ericbottard/followers","following_url":"https://api.github.com/users/ericbottard/following{/other_user}","gists_url":"https://api.github.com/users/ericbottard/gists{/gist_id}","starred_url":"https://api.github.com/users/ericbottard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericbottard/subscriptions","organizations_url":"https://api.github.com/users/ericbottard/orgs","repos_url":"https://api.github.com/users/ericbottard/repos","events_url":"https://api.github.com/users/ericbottard/events{/privacy}","received_events_url":"https://api.github.com/users/ericbottard/received_events","type":"User","site_admin":false},"body":null,"created_at":"2015-08-21T14:26:19Z","updated_at":"2015-08-21T14:58:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93eeb4ce362f8c6cebb73b86aea1e3f47fc8dfe2","assignee":{"login":"pperalta","id":394956,"avatar_url":"https://avatars.githubusercontent.com/u/394956?v=3","gravatar_id":"","url":"https://api.github.com/users/pperalta","html_url":"https://github.com/pperalta","followers_url":"https://api.github.com/users/pperalta/followers","following_url":"https://api.github.com/users/pperalta/following{/other_user}","gists_url":"https://api.github.com/users/pperalta/gists{/gist_id}","starred_url":"https://api.github.com/users/pperalta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pperalta/subscriptions","organizations_url":"https://api.github.com/users/pperalta/orgs","repos_url":"https://api.github.com/users/pperalta/repos","events_url":"https://api.github.com/users/pperalta/events{/privacy}","received_events_url":"https://api.github.com/users/pperalta/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/pulls/56/commits","review_comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/pulls/56/comments","review_comment_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/issues/56/comments","statuses_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/statuses/d1551d0eb8a749bcabe44781a2752539742592f6","head":{"label":"ericbottard:XD-2919","ref":"XD-2919","sha":"d1551d0eb8a749bcabe44781a2752539742592f6","user":{"login":"ericbottard","id":313494,"avatar_url":"https://avatars.githubusercontent.com/u/313494?v=3","gravatar_id":"","url":"https://api.github.com/users/ericbottard","html_url":"https://github.com/ericbottard","followers_url":"https://api.github.com/users/ericbottard/followers","following_url":"https://api.github.com/users/ericbottard/following{/other_user}","gists_url":"https://api.github.com/users/ericbottard/gists{/gist_id}","starred_url":"https://api.github.com/users/ericbottard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericbottard/subscriptions","organizations_url":"https://api.github.com/users/ericbottard/orgs","repos_url":"https://api.github.com/users/ericbottard/repos","events_url":"https://api.github.com/users/ericbottard/events{/privacy}","received_events_url":"https://api.github.com/users/ericbottard/received_events","type":"User","site_admin":false},"repo":{"id":40243328,"name":"spring-cloud-data","full_name":"ericbottard/spring-cloud-data","owner":{"login":"ericbottard","id":313494,"avatar_url":"https://avatars.githubusercontent.com/u/313494?v=3","gravatar_id":"","url":"https://api.github.com/users/ericbottard","html_url":"https://github.com/ericbottard","followers_url":"https://api.github.com/users/ericbottard/followers","following_url":"https://api.github.com/users/ericbottard/following{/other_user}","gists_url":"https://api.github.com/users/ericbottard/gists{/gist_id}","starred_url":"https://api.github.com/users/ericbottard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericbottard/subscriptions","organizations_url":"https://api.github.com/users/ericbottard/orgs","repos_url":"https://api.github.com/users/ericbottard/repos","events_url":"https://api.github.com/users/ericbottard/events{/privacy}","received_events_url":"https://api.github.com/users/ericbottard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ericbottard/spring-cloud-data","description":"","fork":true,"url":"https://api.github.com/repos/ericbottard/spring-cloud-data","forks_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/forks","keys_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/teams","hooks_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/hooks","issue_events_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/issues/events{/number}","events_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/events","assignees_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/assignees{/user}","branches_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/branches{/branch}","tags_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/tags","blobs_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/git/refs{/sha}","trees_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/statuses/{sha}","languages_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/languages","stargazers_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/stargazers","contributors_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/contributors","subscribers_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/subscribers","subscription_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/subscription","commits_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/commits{/sha}","git_commits_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/git/commits{/sha}","comments_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/comments{/number}","issue_comment_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/issues/comments{/number}","contents_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/contents/{+path}","compare_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/merges","archive_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/downloads","issues_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/issues{/number}","pulls_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/pulls{/number}","milestones_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/milestones{/number}","notifications_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/labels{/name}","releases_url":"https://api.github.com/repos/ericbottard/spring-cloud-data/releases{/id}","created_at":"2015-08-05T12:13:08Z","updated_at":"2015-08-05T12:13:08Z","pushed_at":"2015-08-21T14:26:05Z","git_url":"git://github.com/ericbottard/spring-cloud-data.git","ssh_url":"git@github.com:ericbottard/spring-cloud-data.git","clone_url":"https://github.com/ericbottard/spring-cloud-data.git","svn_url":"https://github.com/ericbottard/spring-cloud-data","homepage":null,"size":367,"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":"spring-cloud:master","ref":"master","sha":"fc98144f36961297d1c0f3bdd90468f262289e7b","user":{"login":"spring-cloud","id":7815877,"avatar_url":"https://avatars.githubusercontent.com/u/7815877?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-cloud","html_url":"https://github.com/spring-cloud","followers_url":"https://api.github.com/users/spring-cloud/followers","following_url":"https://api.github.com/users/spring-cloud/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud/orgs","repos_url":"https://api.github.com/users/spring-cloud/repos","events_url":"https://api.github.com/users/spring-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud/received_events","type":"Organization","site_admin":false},"repo":{"id":39469487,"name":"spring-cloud-data","full_name":"spring-cloud/spring-cloud-data","owner":{"login":"spring-cloud","id":7815877,"avatar_url":"https://avatars.githubusercontent.com/u/7815877?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-cloud","html_url":"https://github.com/spring-cloud","followers_url":"https://api.github.com/users/spring-cloud/followers","following_url":"https://api.github.com/users/spring-cloud/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud/orgs","repos_url":"https://api.github.com/users/spring-cloud/repos","events_url":"https://api.github.com/users/spring-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spring-cloud/spring-cloud-data","description":"","fork":false,"url":"https://api.github.com/repos/spring-cloud/spring-cloud-data","forks_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/forks","keys_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/teams","hooks_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/hooks","issue_events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/issues/events{/number}","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/events","assignees_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/assignees{/user}","branches_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/branches{/branch}","tags_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/tags","blobs_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/languages","stargazers_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/stargazers","contributors_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/contributors","subscribers_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/subscribers","subscription_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/subscription","commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/contents/{+path}","compare_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/merges","archive_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/downloads","issues_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/issues{/number}","pulls_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/labels{/name}","releases_url":"https://api.github.com/repos/spring-cloud/spring-cloud-data/releases{/id}","created_at":"2015-07-21T20:56:11Z","updated_at":"2015-08-07T16:39:03Z","pushed_at":"2015-08-21T14:26:20Z","git_url":"git://github.com/spring-cloud/spring-cloud-data.git","ssh_url":"git@github.com:spring-cloud/spring-cloud-data.git","clone_url":"https://github.com/spring-cloud/spring-cloud-data.git","svn_url":"https://github.com/spring-cloud/spring-cloud-data","homepage":null,"size":1085,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":4,"forks":13,"open_issues":4,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-data/pulls/56"},"html":{"href":"https://github.com/spring-cloud/spring-cloud-data/pull/56"},"issue":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-data/issues/56"},"comments":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-data/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-data/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-data/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-data/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-data/statuses/d1551d0eb8a749bcabe44781a2752539742592f6"}}}}