{"action":"created","comment":{"url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments/23707063","id":23707063,"diff_hunk":"@@ -105,26 +107,44 @@ private static int computeBinarySize(Collection<Metric> metrics) {\n         \n         return size;\n     }\n+\n     private static void write(Metric metric, CodedOutputStream out) throws IOException {\n-        \n+\n         out.writeStringNoTag(metric.getLocator().getTenantId());\n         out.writeStringNoTag(metric.getLocator().getMetricName());\n-        out.writeStringNoTag(metric.getDataType().toString());\n+        DataType dataType = getDataType(metric);\n+\n+        out.writeStringNoTag(dataType.toString());\n         out.writeRawVarint64(metric.getCollectionTime());\n         out.writeRawVarint32(metric.getTtlInSeconds());\n         out.writeStringNoTag(metric.getUnit());\n         if (metric.getDataType().equals(DataType.STRING))\n             out.writeStringNoTag((String) metric.getMetricValue());\n-        else if (metric.getDataType().equals(DataType.INT))\n+        else if (dataType.equals(DataType.INT))\n             out.writeRawVarint32((Integer)metric.getMetricValue());\n-        else if (metric.getDataType().equals(DataType.LONG))\n-            out.writeRawVarint64((Long)metric.getMetricValue());\n-        else if (metric.getDataType().equals(DataType.DOUBLE))\n+        else if (dataType.equals(DataType.LONG))\n+            out.writeRawVarint64((Long) metric.getMetricValue());\n+        else if (dataType.equals(DataType.DOUBLE))\n             out.writeDoubleNoTag((Double) metric.getMetricValue());\n         else if (metric.getDataType().equals(DataType.BOOLEAN))\n             out.writeBoolNoTag((Boolean) metric.getMetricValue());\n     }\n-    \n+\n+    private static DataType getDataType(Metric metric) {","path":"blueflood-udp/src/main/java/com/rackspacecloud/blueflood/service/udp/UDPMetricSerialization.java","position":71,"original_position":71,"commit_id":"b7bae55b8ad70d27597b50004509b54e7793ee4f","original_commit_id":"b7bae55b8ad70d27597b50004509b54e7793ee4f","user":{"login":"tilogaat","id":8238570,"avatar_url":"https://avatars.githubusercontent.com/u/8238570?v=3","gravatar_id":"","url":"https://api.github.com/users/tilogaat","html_url":"https://github.com/tilogaat","followers_url":"https://api.github.com/users/tilogaat/followers","following_url":"https://api.github.com/users/tilogaat/following{/other_user}","gists_url":"https://api.github.com/users/tilogaat/gists{/gist_id}","starred_url":"https://api.github.com/users/tilogaat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tilogaat/subscriptions","organizations_url":"https://api.github.com/users/tilogaat/orgs","repos_url":"https://api.github.com/users/tilogaat/repos","events_url":"https://api.github.com/users/tilogaat/events{/privacy}","received_events_url":"https://api.github.com/users/tilogaat/received_events","type":"User","site_admin":false},"body":"This method is used in write and computeBinarySize which is why I extracted it into a method. Also, the datatype itself is plugged into the output stream. ","created_at":"2015-01-28T17:58:38Z","updated_at":"2015-01-28T17:58:38Z","html_url":"https://github.com/rackerlabs/blueflood/pull/421#discussion_r23707063","pull_request_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/421","_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments/23707063"},"html":{"href":"https://github.com/rackerlabs/blueflood/pull/421#discussion_r23707063"},"pull_request":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/421"}}},"pull_request":{"url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/421","id":27801480,"html_url":"https://github.com/rackerlabs/blueflood/pull/421","diff_url":"https://github.com/rackerlabs/blueflood/pull/421.diff","patch_url":"https://github.com/rackerlabs/blueflood/pull/421.patch","issue_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/421","number":421,"state":"open","locked":false,"title":"Consolidating all DataTypes of all numeric metrics into a single NUMERIC datatype","user":{"login":"tilogaat","id":8238570,"avatar_url":"https://avatars.githubusercontent.com/u/8238570?v=3","gravatar_id":"","url":"https://api.github.com/users/tilogaat","html_url":"https://github.com/tilogaat","followers_url":"https://api.github.com/users/tilogaat/followers","following_url":"https://api.github.com/users/tilogaat/following{/other_user}","gists_url":"https://api.github.com/users/tilogaat/gists{/gist_id}","starred_url":"https://api.github.com/users/tilogaat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tilogaat/subscriptions","organizations_url":"https://api.github.com/users/tilogaat/orgs","repos_url":"https://api.github.com/users/tilogaat/repos","events_url":"https://api.github.com/users/tilogaat/events{/privacy}","received_events_url":"https://api.github.com/users/tilogaat/received_events","type":"User","site_admin":false},"body":"Another smaller PR that is a part of the larger whole PR #412 \r\n\r\nThis PR gets rid of usages of the following DataTypes in bf-core:\r\n- DataType.INT\r\n- DataType.LONG\r\n- DataType.Double\r\n-DataType.Bigint\r\n\r\nAll these are replaced by a single data type - DataType.Numeric\r\n\r\nThe DataType value is used in blueflood-core, only for serializing/de-serializing String and Boolean metrics and does not serve any purpose for numeric metrics. However, for UDPSerialization it is required to deserialize the UDP datagram. \r\n\r\nThis is the first step towards stopping caching of DataType information in the metadata cache\r\nThis PR is also a response to the review comments made here https://github.com/rackerlabs/blueflood/pull/412#discussion_r23191294. ","created_at":"2015-01-21T22:33:10Z","updated_at":"2015-01-28T17:58:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6e81f6e74fbc6b9cba9a1be316d8998a0df514a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/421/commits","review_comments_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/421/comments","review_comment_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments/{number}","comments_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/421/comments","statuses_url":"https://api.github.com/repos/rackerlabs/blueflood/statuses/b7bae55b8ad70d27597b50004509b54e7793ee4f","head":{"label":"tilogaat:numeric-datatype","ref":"numeric-datatype","sha":"b7bae55b8ad70d27597b50004509b54e7793ee4f","user":{"login":"tilogaat","id":8238570,"avatar_url":"https://avatars.githubusercontent.com/u/8238570?v=3","gravatar_id":"","url":"https://api.github.com/users/tilogaat","html_url":"https://github.com/tilogaat","followers_url":"https://api.github.com/users/tilogaat/followers","following_url":"https://api.github.com/users/tilogaat/following{/other_user}","gists_url":"https://api.github.com/users/tilogaat/gists{/gist_id}","starred_url":"https://api.github.com/users/tilogaat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tilogaat/subscriptions","organizations_url":"https://api.github.com/users/tilogaat/orgs","repos_url":"https://api.github.com/users/tilogaat/repos","events_url":"https://api.github.com/users/tilogaat/events{/privacy}","received_events_url":"https://api.github.com/users/tilogaat/received_events","type":"User","site_admin":false},"repo":{"id":22357256,"name":"blueflood","full_name":"tilogaat/blueflood","owner":{"login":"tilogaat","id":8238570,"avatar_url":"https://avatars.githubusercontent.com/u/8238570?v=3","gravatar_id":"","url":"https://api.github.com/users/tilogaat","html_url":"https://github.com/tilogaat","followers_url":"https://api.github.com/users/tilogaat/followers","following_url":"https://api.github.com/users/tilogaat/following{/other_user}","gists_url":"https://api.github.com/users/tilogaat/gists{/gist_id}","starred_url":"https://api.github.com/users/tilogaat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tilogaat/subscriptions","organizations_url":"https://api.github.com/users/tilogaat/orgs","repos_url":"https://api.github.com/users/tilogaat/repos","events_url":"https://api.github.com/users/tilogaat/events{/privacy}","received_events_url":"https://api.github.com/users/tilogaat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tilogaat/blueflood","description":"A distributed system designed to ingest and process time series data","fork":true,"url":"https://api.github.com/repos/tilogaat/blueflood","forks_url":"https://api.github.com/repos/tilogaat/blueflood/forks","keys_url":"https://api.github.com/repos/tilogaat/blueflood/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tilogaat/blueflood/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tilogaat/blueflood/teams","hooks_url":"https://api.github.com/repos/tilogaat/blueflood/hooks","issue_events_url":"https://api.github.com/repos/tilogaat/blueflood/issues/events{/number}","events_url":"https://api.github.com/repos/tilogaat/blueflood/events","assignees_url":"https://api.github.com/repos/tilogaat/blueflood/assignees{/user}","branches_url":"https://api.github.com/repos/tilogaat/blueflood/branches{/branch}","tags_url":"https://api.github.com/repos/tilogaat/blueflood/tags","blobs_url":"https://api.github.com/repos/tilogaat/blueflood/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tilogaat/blueflood/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tilogaat/blueflood/git/refs{/sha}","trees_url":"https://api.github.com/repos/tilogaat/blueflood/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tilogaat/blueflood/statuses/{sha}","languages_url":"https://api.github.com/repos/tilogaat/blueflood/languages","stargazers_url":"https://api.github.com/repos/tilogaat/blueflood/stargazers","contributors_url":"https://api.github.com/repos/tilogaat/blueflood/contributors","subscribers_url":"https://api.github.com/repos/tilogaat/blueflood/subscribers","subscription_url":"https://api.github.com/repos/tilogaat/blueflood/subscription","commits_url":"https://api.github.com/repos/tilogaat/blueflood/commits{/sha}","git_commits_url":"https://api.github.com/repos/tilogaat/blueflood/git/commits{/sha}","comments_url":"https://api.github.com/repos/tilogaat/blueflood/comments{/number}","issue_comment_url":"https://api.github.com/repos/tilogaat/blueflood/issues/comments/{number}","contents_url":"https://api.github.com/repos/tilogaat/blueflood/contents/{+path}","compare_url":"https://api.github.com/repos/tilogaat/blueflood/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tilogaat/blueflood/merges","archive_url":"https://api.github.com/repos/tilogaat/blueflood/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tilogaat/blueflood/downloads","issues_url":"https://api.github.com/repos/tilogaat/blueflood/issues{/number}","pulls_url":"https://api.github.com/repos/tilogaat/blueflood/pulls{/number}","milestones_url":"https://api.github.com/repos/tilogaat/blueflood/milestones{/number}","notifications_url":"https://api.github.com/repos/tilogaat/blueflood/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tilogaat/blueflood/labels{/name}","releases_url":"https://api.github.com/repos/tilogaat/blueflood/releases{/id}","created_at":"2014-07-28T20:44:27Z","updated_at":"2014-07-28T21:21:07Z","pushed_at":"2015-01-28T17:54:11Z","git_url":"git://github.com/tilogaat/blueflood.git","ssh_url":"git@github.com:tilogaat/blueflood.git","clone_url":"https://github.com/tilogaat/blueflood.git","svn_url":"https://github.com/tilogaat/blueflood","homepage":"http://www.blueflood.io","size":4660,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"rackerlabs:master","ref":"master","sha":"a8ac5e281c6ad5bef5d5bc2f713ee37184ce58d6","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}","created_at":"2013-05-15T14:50:39Z","updated_at":"2015-01-27T21:53:37Z","pushed_at":"2015-01-27T21:53:37Z","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":9214,"stargazers_count":267,"watchers_count":267,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":36,"mirror_url":null,"open_issues_count":32,"forks":36,"open_issues":32,"watchers":267,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/421"},"html":{"href":"https://github.com/rackerlabs/blueflood/pull/421"},"issue":{"href":"https://api.github.com/repos/rackerlabs/blueflood/issues/421"},"comments":{"href":"https://api.github.com/repos/rackerlabs/blueflood/issues/421/comments"},"review_comments":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/421/comments"},"review_comment":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/421/commits"},"statuses":{"href":"https://api.github.com/repos/rackerlabs/blueflood/statuses/b7bae55b8ad70d27597b50004509b54e7793ee4f"}}}}