{"action":"created","comment":{"url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments/59398182","id":59398182,"diff_hunk":"@@ -0,0 +1,79 @@\n+/*\n+ * Copyright (c) 2016 Rackspace.\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+ * \thttp://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 com.rackspacecloud.blueflood.io;\n+\n+import com.google.common.collect.Table;\n+import com.rackspacecloud.blueflood.outputs.formats.MetricData;\n+import com.rackspacecloud.blueflood.rollup.Granularity;\n+import com.rackspacecloud.blueflood.types.BluefloodEnumRollup;\n+import com.rackspacecloud.blueflood.types.Locator;\n+import com.rackspacecloud.blueflood.types.Range;\n+\n+import java.util.List;\n+import java.util.Map;\n+import java.util.Set;\n+\n+/**\n+ * An interface describing behavior for reading/writing of Enum values from the\n+ * metrics_enum and metrics_preaggregated_{granularity} column families.\n+ *\n+ * The metrics_enum column family is a table of:\n+ * Row (key)    | Column1         | Value\n+ * -------------|-----------------|-------------------\n+ * metric name  | enum hash code  | enum string value\n+ *\n+ * The metrics_preaggregated_{granularity} column family is a table of:\n+ * Row (key)    | Column1         | Value\n+ * -------------|-----------------|-------------------\n+ * metric name  | timestamp       | serialized BluefloodEnumRollup object\n+ */\n+public interface EnumReader {","path":"blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/EnumReader.java","position":44,"original_position":44,"commit_id":"b8c91581c972cdbfd2b10ab3e18b54ba44c016c0","original_commit_id":"b8c91581c972cdbfd2b10ab3e18b54ba44c016c0","user":{"login":"shintasmith","id":3640870,"avatar_url":"https://avatars.githubusercontent.com/u/3640870?v=3","gravatar_id":"","url":"https://api.github.com/users/shintasmith","html_url":"https://github.com/shintasmith","followers_url":"https://api.github.com/users/shintasmith/followers","following_url":"https://api.github.com/users/shintasmith/following{/other_user}","gists_url":"https://api.github.com/users/shintasmith/gists{/gist_id}","starred_url":"https://api.github.com/users/shintasmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shintasmith/subscriptions","organizations_url":"https://api.github.com/users/shintasmith/orgs","repos_url":"https://api.github.com/users/shintasmith/repos","events_url":"https://api.github.com/users/shintasmith/events{/privacy}","received_events_url":"https://api.github.com/users/shintasmith/received_events","type":"User","site_admin":false},"body":"IO implies both read and write, no?","created_at":"2016-04-12T15:35:35Z","updated_at":"2016-04-12T15:35:35Z","html_url":"https://github.com/rackerlabs/blueflood/pull/663#discussion_r59398182","pull_request_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/663","_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments/59398182"},"html":{"href":"https://github.com/rackerlabs/blueflood/pull/663#discussion_r59398182"},"pull_request":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/663"}}},"pull_request":{"url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/663","id":65940265,"html_url":"https://github.com/rackerlabs/blueflood/pull/663","diff_url":"https://github.com/rackerlabs/blueflood/pull/663.diff","patch_url":"https://github.com/rackerlabs/blueflood/pull/663.patch","issue_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/663","number":663,"state":"open","locked":false,"title":"enum io using datastax","user":{"login":"shintasmith","id":3640870,"avatar_url":"https://avatars.githubusercontent.com/u/3640870?v=3","gravatar_id":"","url":"https://api.github.com/users/shintasmith","html_url":"https://github.com/shintasmith","followers_url":"https://api.github.com/users/shintasmith/followers","following_url":"https://api.github.com/users/shintasmith/following{/other_user}","gists_url":"https://api.github.com/users/shintasmith/gists{/gist_id}","starred_url":"https://api.github.com/users/shintasmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shintasmith/subscriptions","organizations_url":"https://api.github.com/users/shintasmith/orgs","repos_url":"https://api.github.com/users/shintasmith/repos","events_url":"https://api.github.com/users/shintasmith/events{/privacy}","received_events_url":"https://api.github.com/users/shintasmith/received_events","type":"User","site_admin":false},"body":"The main goal of this PR is to provide a set of Datastax driver classes that can read/write enum metrics. Enum is stored in two CFs: metrics_enum and metrics_preaggregated_{granularity}.\r\n\r\nThe original AstyanaxReader class that provides the functionality to read enums has code that sort of \"joins\" the two CFs and construct BluefloodEnumRollup objects from the two CFs. The code that does this is intertwined inside AstyanaxReader, but not necessarily all of the code is Astyanax specific. \r\n\r\nIn the Datastax world, the code is separated out. The code that deals with strictly reading/writing enums are isolated in the ```DatastaxEnumIO``` class, thus this class can be Datastax driver specific. The code that does the \"join\" is isolated in the ```EnumMetricDataIO```, and this class is driver agnostic.\r\n\r\nThe ```PreaggregatedMetricsIO``` classes are classes that deal with providing the Blueflood services a way to read/write a grouping of preaggregated metrics. Currently, it can only deal with Enum, as the other preaggregated metrics IO classes (such as counters, timers, histograms, etc) are not yet written. Eventually, the ```PreaggregatedMetricsIO``` will be added to the IOContainer and Services code will access it via IOContainer.\r\n\r\nThe majority of the tests are written to ensure the output of the new methods in DatastaxEnumIO and EnumMetricsDataIO are the same as the equivalent methods in AstyanaxReader/Writer. \r\n\r\nOther changes include:\r\n\r\n* update to latest Junit to fix some mocking issue\r\n** fix MetricsIntegrationTest so that tests pass regardless of the order they are run. The order has changed with the new Junit version\r\n\r\n* add JUnitParams package to enable running parameterized test methods (see EnumIOIntegrationTest)\r\n","created_at":"2016-04-11T04:54:51Z","updated_at":"2016-04-12T15:35:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"528f555a73e1abe91219c4ffe9e5d1784e9d998b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/663/commits","review_comments_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/663/comments","review_comment_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/663/comments","statuses_url":"https://api.github.com/repos/rackerlabs/blueflood/statuses/b8c91581c972cdbfd2b10ab3e18b54ba44c016c0","head":{"label":"shintasmith:datastax_enum","ref":"datastax_enum","sha":"b8c91581c972cdbfd2b10ab3e18b54ba44c016c0","user":{"login":"shintasmith","id":3640870,"avatar_url":"https://avatars.githubusercontent.com/u/3640870?v=3","gravatar_id":"","url":"https://api.github.com/users/shintasmith","html_url":"https://github.com/shintasmith","followers_url":"https://api.github.com/users/shintasmith/followers","following_url":"https://api.github.com/users/shintasmith/following{/other_user}","gists_url":"https://api.github.com/users/shintasmith/gists{/gist_id}","starred_url":"https://api.github.com/users/shintasmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shintasmith/subscriptions","organizations_url":"https://api.github.com/users/shintasmith/orgs","repos_url":"https://api.github.com/users/shintasmith/repos","events_url":"https://api.github.com/users/shintasmith/events{/privacy}","received_events_url":"https://api.github.com/users/shintasmith/received_events","type":"User","site_admin":false},"repo":{"id":45861100,"name":"blueflood","full_name":"shintasmith/blueflood","owner":{"login":"shintasmith","id":3640870,"avatar_url":"https://avatars.githubusercontent.com/u/3640870?v=3","gravatar_id":"","url":"https://api.github.com/users/shintasmith","html_url":"https://github.com/shintasmith","followers_url":"https://api.github.com/users/shintasmith/followers","following_url":"https://api.github.com/users/shintasmith/following{/other_user}","gists_url":"https://api.github.com/users/shintasmith/gists{/gist_id}","starred_url":"https://api.github.com/users/shintasmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shintasmith/subscriptions","organizations_url":"https://api.github.com/users/shintasmith/orgs","repos_url":"https://api.github.com/users/shintasmith/repos","events_url":"https://api.github.com/users/shintasmith/events{/privacy}","received_events_url":"https://api.github.com/users/shintasmith/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shintasmith/blueflood","description":"A distributed system designed to ingest and process time series data","fork":true,"url":"https://api.github.com/repos/shintasmith/blueflood","forks_url":"https://api.github.com/repos/shintasmith/blueflood/forks","keys_url":"https://api.github.com/repos/shintasmith/blueflood/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shintasmith/blueflood/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shintasmith/blueflood/teams","hooks_url":"https://api.github.com/repos/shintasmith/blueflood/hooks","issue_events_url":"https://api.github.com/repos/shintasmith/blueflood/issues/events{/number}","events_url":"https://api.github.com/repos/shintasmith/blueflood/events","assignees_url":"https://api.github.com/repos/shintasmith/blueflood/assignees{/user}","branches_url":"https://api.github.com/repos/shintasmith/blueflood/branches{/branch}","tags_url":"https://api.github.com/repos/shintasmith/blueflood/tags","blobs_url":"https://api.github.com/repos/shintasmith/blueflood/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shintasmith/blueflood/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shintasmith/blueflood/git/refs{/sha}","trees_url":"https://api.github.com/repos/shintasmith/blueflood/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shintasmith/blueflood/statuses/{sha}","languages_url":"https://api.github.com/repos/shintasmith/blueflood/languages","stargazers_url":"https://api.github.com/repos/shintasmith/blueflood/stargazers","contributors_url":"https://api.github.com/repos/shintasmith/blueflood/contributors","subscribers_url":"https://api.github.com/repos/shintasmith/blueflood/subscribers","subscription_url":"https://api.github.com/repos/shintasmith/blueflood/subscription","commits_url":"https://api.github.com/repos/shintasmith/blueflood/commits{/sha}","git_commits_url":"https://api.github.com/repos/shintasmith/blueflood/git/commits{/sha}","comments_url":"https://api.github.com/repos/shintasmith/blueflood/comments{/number}","issue_comment_url":"https://api.github.com/repos/shintasmith/blueflood/issues/comments{/number}","contents_url":"https://api.github.com/repos/shintasmith/blueflood/contents/{+path}","compare_url":"https://api.github.com/repos/shintasmith/blueflood/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shintasmith/blueflood/merges","archive_url":"https://api.github.com/repos/shintasmith/blueflood/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shintasmith/blueflood/downloads","issues_url":"https://api.github.com/repos/shintasmith/blueflood/issues{/number}","pulls_url":"https://api.github.com/repos/shintasmith/blueflood/pulls{/number}","milestones_url":"https://api.github.com/repos/shintasmith/blueflood/milestones{/number}","notifications_url":"https://api.github.com/repos/shintasmith/blueflood/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shintasmith/blueflood/labels{/name}","releases_url":"https://api.github.com/repos/shintasmith/blueflood/releases{/id}","deployments_url":"https://api.github.com/repos/shintasmith/blueflood/deployments","created_at":"2015-11-09T19:22:42Z","updated_at":"2016-01-12T19:55:23Z","pushed_at":"2016-04-12T15:17:53Z","git_url":"git://github.com/shintasmith/blueflood.git","ssh_url":"git@github.com:shintasmith/blueflood.git","clone_url":"https://github.com/shintasmith/blueflood.git","svn_url":"https://github.com/shintasmith/blueflood","homepage":"http://www.blueflood.io","size":9536,"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":"rackerlabs:master","ref":"master","sha":"90d553951c7007c61055dd7c9dc5ee146f397e5e","user":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":10081109,"name":"blueflood","full_name":"rackerlabs/blueflood","owner":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rackerlabs/blueflood","description":"A distributed system designed to ingest and process time series data","fork":false,"url":"https://api.github.com/repos/rackerlabs/blueflood","forks_url":"https://api.github.com/repos/rackerlabs/blueflood/forks","keys_url":"https://api.github.com/repos/rackerlabs/blueflood/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rackerlabs/blueflood/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rackerlabs/blueflood/teams","hooks_url":"https://api.github.com/repos/rackerlabs/blueflood/hooks","issue_events_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/events{/number}","events_url":"https://api.github.com/repos/rackerlabs/blueflood/events","assignees_url":"https://api.github.com/repos/rackerlabs/blueflood/assignees{/user}","branches_url":"https://api.github.com/repos/rackerlabs/blueflood/branches{/branch}","tags_url":"https://api.github.com/repos/rackerlabs/blueflood/tags","blobs_url":"https://api.github.com/repos/rackerlabs/blueflood/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rackerlabs/blueflood/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rackerlabs/blueflood/git/refs{/sha}","trees_url":"https://api.github.com/repos/rackerlabs/blueflood/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rackerlabs/blueflood/statuses/{sha}","languages_url":"https://api.github.com/repos/rackerlabs/blueflood/languages","stargazers_url":"https://api.github.com/repos/rackerlabs/blueflood/stargazers","contributors_url":"https://api.github.com/repos/rackerlabs/blueflood/contributors","subscribers_url":"https://api.github.com/repos/rackerlabs/blueflood/subscribers","subscription_url":"https://api.github.com/repos/rackerlabs/blueflood/subscription","commits_url":"https://api.github.com/repos/rackerlabs/blueflood/commits{/sha}","git_commits_url":"https://api.github.com/repos/rackerlabs/blueflood/git/commits{/sha}","comments_url":"https://api.github.com/repos/rackerlabs/blueflood/comments{/number}","issue_comment_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/comments{/number}","contents_url":"https://api.github.com/repos/rackerlabs/blueflood/contents/{+path}","compare_url":"https://api.github.com/repos/rackerlabs/blueflood/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rackerlabs/blueflood/merges","archive_url":"https://api.github.com/repos/rackerlabs/blueflood/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rackerlabs/blueflood/downloads","issues_url":"https://api.github.com/repos/rackerlabs/blueflood/issues{/number}","pulls_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls{/number}","milestones_url":"https://api.github.com/repos/rackerlabs/blueflood/milestones{/number}","notifications_url":"https://api.github.com/repos/rackerlabs/blueflood/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rackerlabs/blueflood/labels{/name}","releases_url":"https://api.github.com/repos/rackerlabs/blueflood/releases{/id}","deployments_url":"https://api.github.com/repos/rackerlabs/blueflood/deployments","created_at":"2013-05-15T14:50:39Z","updated_at":"2016-04-10T18:33:01Z","pushed_at":"2016-04-12T15:18:14Z","git_url":"git://github.com/rackerlabs/blueflood.git","ssh_url":"git@github.com:rackerlabs/blueflood.git","clone_url":"https://github.com/rackerlabs/blueflood.git","svn_url":"https://github.com/rackerlabs/blueflood","homepage":"http://www.blueflood.io","size":12841,"stargazers_count":423,"watchers_count":423,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":58,"mirror_url":null,"open_issues_count":25,"forks":58,"open_issues":25,"watchers":423,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/663"},"html":{"href":"https://github.com/rackerlabs/blueflood/pull/663"},"issue":{"href":"https://api.github.com/repos/rackerlabs/blueflood/issues/663"},"comments":{"href":"https://api.github.com/repos/rackerlabs/blueflood/issues/663/comments"},"review_comments":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/663/comments"},"review_comment":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/663/commits"},"statuses":{"href":"https://api.github.com/repos/rackerlabs/blueflood/statuses/b8c91581c972cdbfd2b10ab3e18b54ba44c016c0"}}}}