{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/comments/82908776","pull_request_review_id":3783288,"id":82908776,"diff_hunk":"@@ -27,5 +29,63 @@ public static long ConvertToBucket(DateTime dt)\n             }\n             return min;\n         }\n+\n+        // Used to compute epoch. \n+        const long ticksBaseline = 633663648000000000L;\n+        const long ticksPerMonth = 26785144663987L;\n+        \n+        public static DateTime CommonEpoch = new DateTime(0, DateTimeKind.Utc); // maps to epoch 0 \n+        public static string CommonEpochSuffix = \"common\";\n+\n+        public static long GetEpochNumberFromTable(CloudTable table)\n+        {\n+            string tableName = table.Name;\n+            if (tableName.Length < 5)\n+            {\n+                return -1;\n+            }\n+            string suffix = tableName.Substring(tableName.Length - 5, 5);\n+            long epoch;\n+            if (long.TryParse(suffix, out epoch))\n+            {\n+                return epoch;\n+            }\n+            return -1;\n+        }\n+\n+        // Epoch must be positive, orderd integers.\n+        // Use YYYYMM \n+        private static long GetEpochNumber(DateTime epoch)","path":"src/Microsoft.Azure.WebJobs.Logging/Internal/TimeBucket.cs","position":40,"original_position":40,"commit_id":"c5234eea848df6b5bb5b49d954332236f363aecd","original_commit_id":"c5234eea848df6b5bb5b49d954332236f363aecd","user":{"login":"mathewc","id":1056548,"avatar_url":"https://avatars.githubusercontent.com/u/1056548?v=3","gravatar_id":"","url":"https://api.github.com/users/mathewc","html_url":"https://github.com/mathewc","followers_url":"https://api.github.com/users/mathewc/followers","following_url":"https://api.github.com/users/mathewc/following{/other_user}","gists_url":"https://api.github.com/users/mathewc/gists{/gist_id}","starred_url":"https://api.github.com/users/mathewc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathewc/subscriptions","organizations_url":"https://api.github.com/users/mathewc/orgs","repos_url":"https://api.github.com/users/mathewc/repos","events_url":"https://api.github.com/users/mathewc/events{/privacy}","received_events_url":"https://api.github.com/users/mathewc/received_events","type":"User","site_admin":false},"body":"This mapping from DateTime to opaque epoch numbers seems complicated. Why is it needed at all? Given a set of tables each table holding a month's worth of data, you can find out directly which table a given DateTime maps to, right? The suffix of each table defines a min/max date/time.","created_at":"2016-10-11T23:13:09Z","updated_at":"2016-10-11T23:13:09Z","html_url":"https://github.com/Azure/azure-webjobs-sdk/pull/862#discussion_r82908776","pull_request_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/862","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/comments/82908776"},"html":{"href":"https://github.com/Azure/azure-webjobs-sdk/pull/862#discussion_r82908776"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/862"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/862","id":87994337,"html_url":"https://github.com/Azure/azure-webjobs-sdk/pull/862","diff_url":"https://github.com/Azure/azure-webjobs-sdk/pull/862.diff","patch_url":"https://github.com/Azure/azure-webjobs-sdk/pull/862.patch","issue_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/862","number":862,"state":"open","locked":false,"title":"switch logging over to shard per-table. ","user":{"login":"MikeStall","id":1538900,"avatar_url":"https://avatars.githubusercontent.com/u/1538900?v=3","gravatar_id":"","url":"https://api.github.com/users/MikeStall","html_url":"https://github.com/MikeStall","followers_url":"https://api.github.com/users/MikeStall/followers","following_url":"https://api.github.com/users/MikeStall/following{/other_user}","gists_url":"https://api.github.com/users/MikeStall/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeStall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeStall/subscriptions","organizations_url":"https://api.github.com/users/MikeStall/orgs","repos_url":"https://api.github.com/users/MikeStall/repos","events_url":"https://api.github.com/users/MikeStall/events{/privacy}","received_events_url":"https://api.github.com/users/MikeStall/received_events","type":"User","site_admin":false},"body":"Allows deleting a table at a time.  Each month's worth of data gets its own table. \r\nFix https://github.com/Azure/azure-webjobs-sdk/issues/684 \r\n\r\nA few outstanding items here before :\r\n1. The existing 30+ logging tests pass as is (The changes to the test file are cosmetic). But add more tests for the new corner cases (like range queries across tables). \r\n2. Optimize the LogReader.SafeExecuteQuerySegmentedAsync() method to use continuation token. \r\n\r\n","created_at":"2016-10-04T23:41:27Z","updated_at":"2016-10-11T23:13:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bdcb5ebfb2184a92331d23f539dff558245fdb77","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/862/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/862/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/862/comments","statuses_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/statuses/c5234eea848df6b5bb5b49d954332236f363aecd","head":{"label":"Azure:logs3","ref":"logs3","sha":"c5234eea848df6b5bb5b49d954332236f363aecd","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":21712185,"name":"azure-webjobs-sdk","full_name":"Azure/azure-webjobs-sdk","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-webjobs-sdk","description":"Azure WebJobs SDK","fork":false,"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk","forks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/forks","keys_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/teams","hooks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/events","assignees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/tags","blobs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/subscription","commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/merges","archive_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/downloads","issues_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/deployments","created_at":"2014-07-10T22:15:31Z","updated_at":"2016-10-11T09:52:57Z","pushed_at":"2016-10-11T19:48:54Z","git_url":"git://github.com/Azure/azure-webjobs-sdk.git","ssh_url":"git@github.com:Azure/azure-webjobs-sdk.git","clone_url":"https://github.com/Azure/azure-webjobs-sdk.git","svn_url":"https://github.com/Azure/azure-webjobs-sdk","homepage":"","size":12307,"stargazers_count":149,"watchers_count":149,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":194,"forks":65,"open_issues":194,"watchers":149,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"6a1b3c3a104c4b4c0b6dd6c16cc350becfe07969","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":21712185,"name":"azure-webjobs-sdk","full_name":"Azure/azure-webjobs-sdk","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-webjobs-sdk","description":"Azure WebJobs SDK","fork":false,"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk","forks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/forks","keys_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/teams","hooks_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/events","assignees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/tags","blobs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/subscription","commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/merges","archive_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/downloads","issues_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/deployments","created_at":"2014-07-10T22:15:31Z","updated_at":"2016-10-11T09:52:57Z","pushed_at":"2016-10-11T19:48:54Z","git_url":"git://github.com/Azure/azure-webjobs-sdk.git","ssh_url":"git@github.com:Azure/azure-webjobs-sdk.git","clone_url":"https://github.com/Azure/azure-webjobs-sdk.git","svn_url":"https://github.com/Azure/azure-webjobs-sdk","homepage":"","size":12307,"stargazers_count":149,"watchers_count":149,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":194,"forks":65,"open_issues":194,"watchers":149,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/862"},"html":{"href":"https://github.com/Azure/azure-webjobs-sdk/pull/862"},"issue":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/862"},"comments":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/862/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/862/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/pulls/862/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-webjobs-sdk/statuses/c5234eea848df6b5bb5b49d954332236f363aecd"}}}}
{"actor":{"display_login":"mathewc"}}