{"action":"created","comment":{"url":"https://api.github.com/repos/ctripcorp/hermes/pulls/comments/40632024","id":40632024,"diff_hunk":"@@ -501,4 +529,95 @@ private boolean resendAfter(ResendGroupId l, ResendGroupId r) {\n \t\treturn false;\n \t}\n \n+\t@Override\n+\tpublic Object findMessageByTime(Tpp tpp, long time) {\n+\t\treturn needFirstMessage(time) ? getFirstMessage(tpp) : //\n+\t\t      needLastMessage(time) ? getLastMessage(tpp) : //\n+\t\t            findMessageInRange(tpp, getFirstMessage(tpp), getLastMessage(tpp), time);\n+\t}\n+\n+\tprivate boolean needFirstMessage(long time) {\n+\t\treturn Long.MIN_VALUE == time || -2 == time;\n+\t}\n+\n+\tprivate boolean needLastMessage(long time) {\n+\t\treturn Long.MAX_VALUE == time || -1 == time;\n+\t}\n+\n+\tprivate MessagePriority findMessageInRange(Tpp tpp, MessagePriority firstMsg, MessagePriority lastMsg, long time) {\n+\t\tif (firstMsg == null //","path":"hermes-broker/src/main/java/com/ctrip/hermes/broker/queue/storage/mysql/MySQLMessageQueueStorage.java","position":104,"original_position":104,"commit_id":"b65b4b85be6a34e059c3a72fa130efeb40a8e321","original_commit_id":"b65b4b85be6a34e059c3a72fa130efeb40a8e321","user":{"login":"leoliang","id":1219278,"avatar_url":"https://avatars.githubusercontent.com/u/1219278?v=3","gravatar_id":"","url":"https://api.github.com/users/leoliang","html_url":"https://github.com/leoliang","followers_url":"https://api.github.com/users/leoliang/followers","following_url":"https://api.github.com/users/leoliang/following{/other_user}","gists_url":"https://api.github.com/users/leoliang/gists{/gist_id}","starred_url":"https://api.github.com/users/leoliang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leoliang/subscriptions","organizations_url":"https://api.github.com/users/leoliang/orgs","repos_url":"https://api.github.com/users/leoliang/repos","events_url":"https://api.github.com/users/leoliang/events{/privacy}","received_events_url":"https://api.github.com/users/leoliang/received_events","type":"User","site_admin":false},"body":"use iteration","created_at":"2015-09-29T03:36:11Z","updated_at":"2015-09-29T03:36:11Z","html_url":"https://github.com/ctripcorp/hermes/pull/629#discussion_r40632024","pull_request_url":"https://api.github.com/repos/ctripcorp/hermes/pulls/629","_links":{"self":{"href":"https://api.github.com/repos/ctripcorp/hermes/pulls/comments/40632024"},"html":{"href":"https://github.com/ctripcorp/hermes/pull/629#discussion_r40632024"},"pull_request":{"href":"https://api.github.com/repos/ctripcorp/hermes/pulls/629"}}},"pull_request":{"url":"https://api.github.com/repos/ctripcorp/hermes/pulls/629","id":46127133,"html_url":"https://github.com/ctripcorp/hermes/pull/629","diff_url":"https://github.com/ctripcorp/hermes/pull/629.diff","patch_url":"https://github.com/ctripcorp/hermes/pull/629.patch","issue_url":"https://api.github.com/repos/ctripcorp/hermes/issues/629","number":629,"state":"open","locked":false,"title":"message stream impl for review","user":{"login":"songtong","id":2427688,"avatar_url":"https://avatars.githubusercontent.com/u/2427688?v=3","gravatar_id":"","url":"https://api.github.com/users/songtong","html_url":"https://github.com/songtong","followers_url":"https://api.github.com/users/songtong/followers","following_url":"https://api.github.com/users/songtong/following{/other_user}","gists_url":"https://api.github.com/users/songtong/gists{/gist_id}","starred_url":"https://api.github.com/users/songtong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/songtong/subscriptions","organizations_url":"https://api.github.com/users/songtong/orgs","repos_url":"https://api.github.com/users/songtong/repos","events_url":"https://api.github.com/users/songtong/events{/privacy}","received_events_url":"https://api.github.com/users/songtong/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-28T07:31:38Z","updated_at":"2015-09-29T03:36:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c002485c795bb11fa28dc0dd42c75b48b83053c4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ctripcorp/hermes/pulls/629/commits","review_comments_url":"https://api.github.com/repos/ctripcorp/hermes/pulls/629/comments","review_comment_url":"https://api.github.com/repos/ctripcorp/hermes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ctripcorp/hermes/issues/629/comments","statuses_url":"https://api.github.com/repos/ctripcorp/hermes/statuses/b65b4b85be6a34e059c3a72fa130efeb40a8e321","head":{"label":"songtong:mryi_2","ref":"mryi_2","sha":"b65b4b85be6a34e059c3a72fa130efeb40a8e321","user":{"login":"songtong","id":2427688,"avatar_url":"https://avatars.githubusercontent.com/u/2427688?v=3","gravatar_id":"","url":"https://api.github.com/users/songtong","html_url":"https://github.com/songtong","followers_url":"https://api.github.com/users/songtong/followers","following_url":"https://api.github.com/users/songtong/following{/other_user}","gists_url":"https://api.github.com/users/songtong/gists{/gist_id}","starred_url":"https://api.github.com/users/songtong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/songtong/subscriptions","organizations_url":"https://api.github.com/users/songtong/orgs","repos_url":"https://api.github.com/users/songtong/repos","events_url":"https://api.github.com/users/songtong/events{/privacy}","received_events_url":"https://api.github.com/users/songtong/received_events","type":"User","site_admin":false},"repo":{"id":36206406,"name":"hermes","full_name":"songtong/hermes","owner":{"login":"songtong","id":2427688,"avatar_url":"https://avatars.githubusercontent.com/u/2427688?v=3","gravatar_id":"","url":"https://api.github.com/users/songtong","html_url":"https://github.com/songtong","followers_url":"https://api.github.com/users/songtong/followers","following_url":"https://api.github.com/users/songtong/following{/other_user}","gists_url":"https://api.github.com/users/songtong/gists{/gist_id}","starred_url":"https://api.github.com/users/songtong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/songtong/subscriptions","organizations_url":"https://api.github.com/users/songtong/orgs","repos_url":"https://api.github.com/users/songtong/repos","events_url":"https://api.github.com/users/songtong/events{/privacy}","received_events_url":"https://api.github.com/users/songtong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/songtong/hermes","description":"Ctrip asynchronous message queue solution","fork":true,"url":"https://api.github.com/repos/songtong/hermes","forks_url":"https://api.github.com/repos/songtong/hermes/forks","keys_url":"https://api.github.com/repos/songtong/hermes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/songtong/hermes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/songtong/hermes/teams","hooks_url":"https://api.github.com/repos/songtong/hermes/hooks","issue_events_url":"https://api.github.com/repos/songtong/hermes/issues/events{/number}","events_url":"https://api.github.com/repos/songtong/hermes/events","assignees_url":"https://api.github.com/repos/songtong/hermes/assignees{/user}","branches_url":"https://api.github.com/repos/songtong/hermes/branches{/branch}","tags_url":"https://api.github.com/repos/songtong/hermes/tags","blobs_url":"https://api.github.com/repos/songtong/hermes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/songtong/hermes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/songtong/hermes/git/refs{/sha}","trees_url":"https://api.github.com/repos/songtong/hermes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/songtong/hermes/statuses/{sha}","languages_url":"https://api.github.com/repos/songtong/hermes/languages","stargazers_url":"https://api.github.com/repos/songtong/hermes/stargazers","contributors_url":"https://api.github.com/repos/songtong/hermes/contributors","subscribers_url":"https://api.github.com/repos/songtong/hermes/subscribers","subscription_url":"https://api.github.com/repos/songtong/hermes/subscription","commits_url":"https://api.github.com/repos/songtong/hermes/commits{/sha}","git_commits_url":"https://api.github.com/repos/songtong/hermes/git/commits{/sha}","comments_url":"https://api.github.com/repos/songtong/hermes/comments{/number}","issue_comment_url":"https://api.github.com/repos/songtong/hermes/issues/comments{/number}","contents_url":"https://api.github.com/repos/songtong/hermes/contents/{+path}","compare_url":"https://api.github.com/repos/songtong/hermes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/songtong/hermes/merges","archive_url":"https://api.github.com/repos/songtong/hermes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/songtong/hermes/downloads","issues_url":"https://api.github.com/repos/songtong/hermes/issues{/number}","pulls_url":"https://api.github.com/repos/songtong/hermes/pulls{/number}","milestones_url":"https://api.github.com/repos/songtong/hermes/milestones{/number}","notifications_url":"https://api.github.com/repos/songtong/hermes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/songtong/hermes/labels{/name}","releases_url":"https://api.github.com/repos/songtong/hermes/releases{/id}","created_at":"2015-05-25T02:57:26Z","updated_at":"2015-05-25T02:57:27Z","pushed_at":"2015-09-28T07:32:40Z","git_url":"git://github.com/songtong/hermes.git","ssh_url":"git@github.com:songtong/hermes.git","clone_url":"https://github.com/songtong/hermes.git","svn_url":"https://github.com/songtong/hermes","homepage":null,"size":7247,"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":"ctripcorp:master","ref":"master","sha":"cd073006567fe52a982f44edd339bf8e99a123ae","user":{"login":"ctripcorp","id":10720307,"avatar_url":"https://avatars.githubusercontent.com/u/10720307?v=3","gravatar_id":"","url":"https://api.github.com/users/ctripcorp","html_url":"https://github.com/ctripcorp","followers_url":"https://api.github.com/users/ctripcorp/followers","following_url":"https://api.github.com/users/ctripcorp/following{/other_user}","gists_url":"https://api.github.com/users/ctripcorp/gists{/gist_id}","starred_url":"https://api.github.com/users/ctripcorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctripcorp/subscriptions","organizations_url":"https://api.github.com/users/ctripcorp/orgs","repos_url":"https://api.github.com/users/ctripcorp/repos","events_url":"https://api.github.com/users/ctripcorp/events{/privacy}","received_events_url":"https://api.github.com/users/ctripcorp/received_events","type":"Organization","site_admin":false},"repo":{"id":29948156,"name":"hermes","full_name":"ctripcorp/hermes","owner":{"login":"ctripcorp","id":10720307,"avatar_url":"https://avatars.githubusercontent.com/u/10720307?v=3","gravatar_id":"","url":"https://api.github.com/users/ctripcorp","html_url":"https://github.com/ctripcorp","followers_url":"https://api.github.com/users/ctripcorp/followers","following_url":"https://api.github.com/users/ctripcorp/following{/other_user}","gists_url":"https://api.github.com/users/ctripcorp/gists{/gist_id}","starred_url":"https://api.github.com/users/ctripcorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctripcorp/subscriptions","organizations_url":"https://api.github.com/users/ctripcorp/orgs","repos_url":"https://api.github.com/users/ctripcorp/repos","events_url":"https://api.github.com/users/ctripcorp/events{/privacy}","received_events_url":"https://api.github.com/users/ctripcorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ctripcorp/hermes","description":"Ctrip asynchronous message queue solution","fork":false,"url":"https://api.github.com/repos/ctripcorp/hermes","forks_url":"https://api.github.com/repos/ctripcorp/hermes/forks","keys_url":"https://api.github.com/repos/ctripcorp/hermes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ctripcorp/hermes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ctripcorp/hermes/teams","hooks_url":"https://api.github.com/repos/ctripcorp/hermes/hooks","issue_events_url":"https://api.github.com/repos/ctripcorp/hermes/issues/events{/number}","events_url":"https://api.github.com/repos/ctripcorp/hermes/events","assignees_url":"https://api.github.com/repos/ctripcorp/hermes/assignees{/user}","branches_url":"https://api.github.com/repos/ctripcorp/hermes/branches{/branch}","tags_url":"https://api.github.com/repos/ctripcorp/hermes/tags","blobs_url":"https://api.github.com/repos/ctripcorp/hermes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ctripcorp/hermes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ctripcorp/hermes/git/refs{/sha}","trees_url":"https://api.github.com/repos/ctripcorp/hermes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ctripcorp/hermes/statuses/{sha}","languages_url":"https://api.github.com/repos/ctripcorp/hermes/languages","stargazers_url":"https://api.github.com/repos/ctripcorp/hermes/stargazers","contributors_url":"https://api.github.com/repos/ctripcorp/hermes/contributors","subscribers_url":"https://api.github.com/repos/ctripcorp/hermes/subscribers","subscription_url":"https://api.github.com/repos/ctripcorp/hermes/subscription","commits_url":"https://api.github.com/repos/ctripcorp/hermes/commits{/sha}","git_commits_url":"https://api.github.com/repos/ctripcorp/hermes/git/commits{/sha}","comments_url":"https://api.github.com/repos/ctripcorp/hermes/comments{/number}","issue_comment_url":"https://api.github.com/repos/ctripcorp/hermes/issues/comments{/number}","contents_url":"https://api.github.com/repos/ctripcorp/hermes/contents/{+path}","compare_url":"https://api.github.com/repos/ctripcorp/hermes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ctripcorp/hermes/merges","archive_url":"https://api.github.com/repos/ctripcorp/hermes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ctripcorp/hermes/downloads","issues_url":"https://api.github.com/repos/ctripcorp/hermes/issues{/number}","pulls_url":"https://api.github.com/repos/ctripcorp/hermes/pulls{/number}","milestones_url":"https://api.github.com/repos/ctripcorp/hermes/milestones{/number}","notifications_url":"https://api.github.com/repos/ctripcorp/hermes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ctripcorp/hermes/labels{/name}","releases_url":"https://api.github.com/repos/ctripcorp/hermes/releases{/id}","created_at":"2015-01-28T03:15:03Z","updated_at":"2015-09-26T02:19:48Z","pushed_at":"2015-09-28T07:31:39Z","git_url":"git://github.com/ctripcorp/hermes.git","ssh_url":"git@github.com:ctripcorp/hermes.git","clone_url":"https://github.com/ctripcorp/hermes.git","svn_url":"https://github.com/ctripcorp/hermes","homepage":null,"size":13260,"stargazers_count":18,"watchers_count":18,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":3,"forks":21,"open_issues":3,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ctripcorp/hermes/pulls/629"},"html":{"href":"https://github.com/ctripcorp/hermes/pull/629"},"issue":{"href":"https://api.github.com/repos/ctripcorp/hermes/issues/629"},"comments":{"href":"https://api.github.com/repos/ctripcorp/hermes/issues/629/comments"},"review_comments":{"href":"https://api.github.com/repos/ctripcorp/hermes/pulls/629/comments"},"review_comment":{"href":"https://api.github.com/repos/ctripcorp/hermes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ctripcorp/hermes/pulls/629/commits"},"statuses":{"href":"https://api.github.com/repos/ctripcorp/hermes/statuses/b65b4b85be6a34e059c3a72fa130efeb40a8e321"}}}}