{"action":"created","comment":{"url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments/67765639","id":67765639,"diff_hunk":"@@ -41,98 +43,105 @@ public static ConfigTtlProvider getInstance() {\n     }\n \n     private ConfigTtlProvider() {\n-        final Configuration config = Configuration.getInstance();\n+        this(Configuration.getInstance());\n+    }\n \n+    @VisibleForTesting\n+    ConfigTtlProvider(Configuration config) {\n         // String rollups\n-        stringTTL = new TimeValue(config.getIntegerProperty(TtlConfig.STRING_METRICS_TTL), TimeUnit.DAYS);\n+        TimeValue stringTTL = null;\n+        try {\n+            int value = config.getIntegerProperty(TtlConfig.STRING_METRICS_TTL);\n+            if (value > 0) {\n+                stringTTL = new TimeValue(config.getIntegerProperty(TtlConfig.STRING_METRICS_TTL), TimeUnit.DAYS);\n+            }\n+        } catch (NumberFormatException ex) {\n+            log.warn(\"No valid String TTL in config.\");","path":"blueflood-core/src/main/java/com/rackspacecloud/blueflood/cache/ConfigTtlProvider.java","position":38,"original_position":38,"commit_id":"222c8350f73813f85cfaf7dcf0e2f1d10818eefb","original_commit_id":"222c8350f73813f85cfaf7dcf0e2f1d10818eefb","user":{"login":"usnavi","id":1426961,"avatar_url":"https://avatars.githubusercontent.com/u/1426961?v=3","gravatar_id":"","url":"https://api.github.com/users/usnavi","html_url":"https://github.com/usnavi","followers_url":"https://api.github.com/users/usnavi/followers","following_url":"https://api.github.com/users/usnavi/following{/other_user}","gists_url":"https://api.github.com/users/usnavi/gists{/gist_id}","starred_url":"https://api.github.com/users/usnavi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usnavi/subscriptions","organizations_url":"https://api.github.com/users/usnavi/orgs","repos_url":"https://api.github.com/users/usnavi/repos","events_url":"https://api.github.com/users/usnavi/events{/privacy}","received_events_url":"https://api.github.com/users/usnavi/received_events","type":"User","site_admin":false},"body":"I'd include the exception as well.  E.g., http://www.slf4j.org/api/org/slf4j/Logger.html#warn(java.lang.String, java.lang.Throwable)","created_at":"2016-06-20T21:01:50Z","updated_at":"2016-06-20T21:01:50Z","html_url":"https://github.com/rackerlabs/blueflood/pull/704#discussion_r67765639","pull_request_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/704","_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments/67765639"},"html":{"href":"https://github.com/rackerlabs/blueflood/pull/704#discussion_r67765639"},"pull_request":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/704"}}},"pull_request":{"url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/704","id":74017098,"html_url":"https://github.com/rackerlabs/blueflood/pull/704","diff_url":"https://github.com/rackerlabs/blueflood/pull/704.diff","patch_url":"https://github.com/rackerlabs/blueflood/pull/704.patch","issue_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/704","number":704,"state":"open","locked":false,"title":"Refactor TTL providers","user":{"login":"DanielNi","id":3733413,"avatar_url":"https://avatars.githubusercontent.com/u/3733413?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielNi","html_url":"https://github.com/DanielNi","followers_url":"https://api.github.com/users/DanielNi/followers","following_url":"https://api.github.com/users/DanielNi/following{/other_user}","gists_url":"https://api.github.com/users/DanielNi/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielNi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielNi/subscriptions","organizations_url":"https://api.github.com/users/DanielNi/orgs","repos_url":"https://api.github.com/users/DanielNi/repos","events_url":"https://api.github.com/users/DanielNi/events{/privacy}","received_events_url":"https://api.github.com/users/DanielNi/received_events","type":"User","site_admin":false},"body":"WHAT: This PR combines the TTL providers into a single class `CombinedTtlProvider.java` and changes the `TenantTtlProvider.java` interface slightly so that it is less complicated.\r\n\r\nWHY: Cleans up the TTL provider code a bit and adds some testing.\r\n\r\nHOW: \r\n- Added the `CombinedTtlProvider.java` class\r\n- `TenantTtlProvider.java` now returns `Optional`, which is easier to reason with than exceptions\r\n- Removed `set()` method in the providers since it is not currently used and throws an exception\r\n- Moved the 5x TTL logic from `SafetyTtlProvider.java` to `CassandraModel.java` to make it less confusing\r\n- Made the TTL provider tests a bit more robust\r\n- Removed the Hist TTL configs since they are no longer being used","created_at":"2016-06-16T03:24:49Z","updated_at":"2016-06-20T21:01:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b3de3d04da272ce1efbf078528fcb8e3c9e46b8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/704/commits","review_comments_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/704/comments","review_comment_url":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rackerlabs/blueflood/issues/704/comments","statuses_url":"https://api.github.com/repos/rackerlabs/blueflood/statuses/222c8350f73813f85cfaf7dcf0e2f1d10818eefb","head":{"label":"DanielNi:refactor-ttl-providers","ref":"refactor-ttl-providers","sha":"222c8350f73813f85cfaf7dcf0e2f1d10818eefb","user":{"login":"DanielNi","id":3733413,"avatar_url":"https://avatars.githubusercontent.com/u/3733413?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielNi","html_url":"https://github.com/DanielNi","followers_url":"https://api.github.com/users/DanielNi/followers","following_url":"https://api.github.com/users/DanielNi/following{/other_user}","gists_url":"https://api.github.com/users/DanielNi/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielNi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielNi/subscriptions","organizations_url":"https://api.github.com/users/DanielNi/orgs","repos_url":"https://api.github.com/users/DanielNi/repos","events_url":"https://api.github.com/users/DanielNi/events{/privacy}","received_events_url":"https://api.github.com/users/DanielNi/received_events","type":"User","site_admin":false},"repo":{"id":60218249,"name":"blueflood","full_name":"DanielNi/blueflood","owner":{"login":"DanielNi","id":3733413,"avatar_url":"https://avatars.githubusercontent.com/u/3733413?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielNi","html_url":"https://github.com/DanielNi","followers_url":"https://api.github.com/users/DanielNi/followers","following_url":"https://api.github.com/users/DanielNi/following{/other_user}","gists_url":"https://api.github.com/users/DanielNi/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielNi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielNi/subscriptions","organizations_url":"https://api.github.com/users/DanielNi/orgs","repos_url":"https://api.github.com/users/DanielNi/repos","events_url":"https://api.github.com/users/DanielNi/events{/privacy}","received_events_url":"https://api.github.com/users/DanielNi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DanielNi/blueflood","description":"A distributed system designed to ingest and process time series data","fork":true,"url":"https://api.github.com/repos/DanielNi/blueflood","forks_url":"https://api.github.com/repos/DanielNi/blueflood/forks","keys_url":"https://api.github.com/repos/DanielNi/blueflood/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DanielNi/blueflood/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DanielNi/blueflood/teams","hooks_url":"https://api.github.com/repos/DanielNi/blueflood/hooks","issue_events_url":"https://api.github.com/repos/DanielNi/blueflood/issues/events{/number}","events_url":"https://api.github.com/repos/DanielNi/blueflood/events","assignees_url":"https://api.github.com/repos/DanielNi/blueflood/assignees{/user}","branches_url":"https://api.github.com/repos/DanielNi/blueflood/branches{/branch}","tags_url":"https://api.github.com/repos/DanielNi/blueflood/tags","blobs_url":"https://api.github.com/repos/DanielNi/blueflood/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DanielNi/blueflood/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DanielNi/blueflood/git/refs{/sha}","trees_url":"https://api.github.com/repos/DanielNi/blueflood/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DanielNi/blueflood/statuses/{sha}","languages_url":"https://api.github.com/repos/DanielNi/blueflood/languages","stargazers_url":"https://api.github.com/repos/DanielNi/blueflood/stargazers","contributors_url":"https://api.github.com/repos/DanielNi/blueflood/contributors","subscribers_url":"https://api.github.com/repos/DanielNi/blueflood/subscribers","subscription_url":"https://api.github.com/repos/DanielNi/blueflood/subscription","commits_url":"https://api.github.com/repos/DanielNi/blueflood/commits{/sha}","git_commits_url":"https://api.github.com/repos/DanielNi/blueflood/git/commits{/sha}","comments_url":"https://api.github.com/repos/DanielNi/blueflood/comments{/number}","issue_comment_url":"https://api.github.com/repos/DanielNi/blueflood/issues/comments{/number}","contents_url":"https://api.github.com/repos/DanielNi/blueflood/contents/{+path}","compare_url":"https://api.github.com/repos/DanielNi/blueflood/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DanielNi/blueflood/merges","archive_url":"https://api.github.com/repos/DanielNi/blueflood/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DanielNi/blueflood/downloads","issues_url":"https://api.github.com/repos/DanielNi/blueflood/issues{/number}","pulls_url":"https://api.github.com/repos/DanielNi/blueflood/pulls{/number}","milestones_url":"https://api.github.com/repos/DanielNi/blueflood/milestones{/number}","notifications_url":"https://api.github.com/repos/DanielNi/blueflood/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DanielNi/blueflood/labels{/name}","releases_url":"https://api.github.com/repos/DanielNi/blueflood/releases{/id}","deployments_url":"https://api.github.com/repos/DanielNi/blueflood/deployments","created_at":"2016-06-01T23:46:20Z","updated_at":"2016-06-01T23:46:23Z","pushed_at":"2016-06-17T23:09:43Z","git_url":"git://github.com/DanielNi/blueflood.git","ssh_url":"git@github.com:DanielNi/blueflood.git","clone_url":"https://github.com/DanielNi/blueflood.git","svn_url":"https://github.com/DanielNi/blueflood","homepage":"http://www.blueflood.io","size":10520,"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":"dcdf3e33fbe4d7b12b1cb6575ae389ddccd9517b","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-06-19T14:49:44Z","pushed_at":"2016-06-20T20:32:40Z","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":13597,"stargazers_count":443,"watchers_count":443,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":64,"mirror_url":null,"open_issues_count":32,"forks":64,"open_issues":32,"watchers":443,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/704"},"html":{"href":"https://github.com/rackerlabs/blueflood/pull/704"},"issue":{"href":"https://api.github.com/repos/rackerlabs/blueflood/issues/704"},"comments":{"href":"https://api.github.com/repos/rackerlabs/blueflood/issues/704/comments"},"review_comments":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/704/comments"},"review_comment":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rackerlabs/blueflood/pulls/704/commits"},"statuses":{"href":"https://api.github.com/repos/rackerlabs/blueflood/statuses/222c8350f73813f85cfaf7dcf0e2f1d10818eefb"}}}}
{"actor":{"display_login":"usnavi"}}