{"action":"created","comment":{"url":"https://api.github.com/repos/apache/cloudstack/pulls/comments/37572319","id":37572319,"diff_hunk":"@@ -469,4 +478,25 @@ public void removeOldUsageRecords(int days) {\n             txn.close();\n         }\n     }\n+\n+    @SuppressWarnings(\"deprecation\")\n+    public Pair<List<? extends UsageVO>, Integer> getUsageRecordsPendingQuotaAggregation(final long accountId, final long domainId) {\n+        final short opendb = TransactionLegacy.currentTxn().getDatabaseId();\n+        TransactionLegacy.open(TransactionLegacy.USAGE_DB).close();\n+        s_logger.debug(\"getting usage records for account: \" + accountId + \", domainId: \" + domainId);\n+        Filter usageFilter = new Filter(UsageVO.class, \"startDate\", true, 0L, 10000L);\n+        SearchCriteria<UsageVO> sc = createSearchCriteria();\n+        if (accountId != -1) {\n+            sc.addAnd(\"accountId\", SearchCriteria.Op.EQ, accountId);\n+        }\n+        if (domainId != -1) {\n+            sc.addAnd(\"domainId\", SearchCriteria.Op.EQ, domainId);\n+        }\n+        sc.addAnd(\"quotaCalculated\", SearchCriteria.Op.NULL);\n+        sc.addOr(\"quotaCalculated\", SearchCriteria.Op.EQ, 0);\n+        s_logger.debug(\"Getting usage records\" + usageFilter.getOrderBy());","path":"engine/schema/src/com/cloud/usage/dao/UsageDaoImpl.java","position":144,"original_position":144,"commit_id":"cd26e9dee16483cda5f77a457e8bb7f7df470565","original_commit_id":"cd26e9dee16483cda5f77a457e8bb7f7df470565","user":{"login":"jburwell","id":285646,"avatar_url":"https://avatars.githubusercontent.com/u/285646?v=3","gravatar_id":"","url":"https://api.github.com/users/jburwell","html_url":"https://github.com/jburwell","followers_url":"https://api.github.com/users/jburwell/followers","following_url":"https://api.github.com/users/jburwell/following{/other_user}","gists_url":"https://api.github.com/users/jburwell/gists{/gist_id}","starred_url":"https://api.github.com/users/jburwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jburwell/subscriptions","organizations_url":"https://api.github.com/users/jburwell/orgs","repos_url":"https://api.github.com/users/jburwell/repos","events_url":"https://api.github.com/users/jburwell/events{/privacy}","received_events_url":"https://api.github.com/users/jburwell/received_events","type":"User","site_admin":false},"body":"Debug logging statements should be wrapped in a ``if (s_logger.isDebugEnabled())`` check to avoid the overhead of string concatenation when debug logging is not enabled.","created_at":"2015-08-20T19:41:02Z","updated_at":"2015-08-20T19:41:02Z","html_url":"https://github.com/apache/cloudstack/pull/689#discussion_r37572319","pull_request_url":"https://api.github.com/repos/apache/cloudstack/pulls/689","_links":{"self":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/comments/37572319"},"html":{"href":"https://github.com/apache/cloudstack/pull/689#discussion_r37572319"},"pull_request":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/689"}}},"pull_request":{"url":"https://api.github.com/repos/apache/cloudstack/pulls/689","id":42322743,"html_url":"https://github.com/apache/cloudstack/pull/689","diff_url":"https://github.com/apache/cloudstack/pull/689.diff","patch_url":"https://github.com/apache/cloudstack/pull/689.patch","issue_url":"https://api.github.com/repos/apache/cloudstack/issues/689","number":689,"state":"open","locked":false,"title":"Quota master","user":{"login":"abhinandanprateek","id":12134381,"avatar_url":"https://avatars.githubusercontent.com/u/12134381?v=3","gravatar_id":"","url":"https://api.github.com/users/abhinandanprateek","html_url":"https://github.com/abhinandanprateek","followers_url":"https://api.github.com/users/abhinandanprateek/followers","following_url":"https://api.github.com/users/abhinandanprateek/following{/other_user}","gists_url":"https://api.github.com/users/abhinandanprateek/gists{/gist_id}","starred_url":"https://api.github.com/users/abhinandanprateek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhinandanprateek/subscriptions","organizations_url":"https://api.github.com/users/abhinandanprateek/orgs","repos_url":"https://api.github.com/users/abhinandanprateek/repos","events_url":"https://api.github.com/users/abhinandanprateek/events{/privacy}","received_events_url":"https://api.github.com/users/abhinandanprateek/received_events","type":"User","site_admin":false},"body":"This pull request is for quota service implementation, divided into following two commits:\r\n\r\n1. Quota server side implementation\r\n   a. Quota Framework plugin containing Daos\r\n   b. Quota database plugin for quota APIs\r\n   c. Quota Usage server enhancements \r\n\r\n2. Quota UI plugin","created_at":"2015-08-13T07:41:47Z","updated_at":"2015-08-20T19:41:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee33bc29aa2638e8a44f753d6456f58f8eea551e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/cloudstack/pulls/689/commits","review_comments_url":"https://api.github.com/repos/apache/cloudstack/pulls/689/comments","review_comment_url":"https://api.github.com/repos/apache/cloudstack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/cloudstack/issues/689/comments","statuses_url":"https://api.github.com/repos/apache/cloudstack/statuses/cd26e9dee16483cda5f77a457e8bb7f7df470565","head":{"label":"shapeblue:quota-master","ref":"quota-master","sha":"cd26e9dee16483cda5f77a457e8bb7f7df470565","user":{"login":"shapeblue","id":6001764,"avatar_url":"https://avatars.githubusercontent.com/u/6001764?v=3","gravatar_id":"","url":"https://api.github.com/users/shapeblue","html_url":"https://github.com/shapeblue","followers_url":"https://api.github.com/users/shapeblue/followers","following_url":"https://api.github.com/users/shapeblue/following{/other_user}","gists_url":"https://api.github.com/users/shapeblue/gists{/gist_id}","starred_url":"https://api.github.com/users/shapeblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shapeblue/subscriptions","organizations_url":"https://api.github.com/users/shapeblue/orgs","repos_url":"https://api.github.com/users/shapeblue/repos","events_url":"https://api.github.com/users/shapeblue/events{/privacy}","received_events_url":"https://api.github.com/users/shapeblue/received_events","type":"Organization","site_admin":false},"repo":{"id":35481491,"name":"cloudstack","full_name":"shapeblue/cloudstack","owner":{"login":"shapeblue","id":6001764,"avatar_url":"https://avatars.githubusercontent.com/u/6001764?v=3","gravatar_id":"","url":"https://api.github.com/users/shapeblue","html_url":"https://github.com/shapeblue","followers_url":"https://api.github.com/users/shapeblue/followers","following_url":"https://api.github.com/users/shapeblue/following{/other_user}","gists_url":"https://api.github.com/users/shapeblue/gists{/gist_id}","starred_url":"https://api.github.com/users/shapeblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shapeblue/subscriptions","organizations_url":"https://api.github.com/users/shapeblue/orgs","repos_url":"https://api.github.com/users/shapeblue/repos","events_url":"https://api.github.com/users/shapeblue/events{/privacy}","received_events_url":"https://api.github.com/users/shapeblue/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shapeblue/cloudstack","description":"The upstream repository is at http://github.com/apache/cloudstack. This is ShapeBlue's support/patch branches and Apache CloudStack™ backup","fork":true,"url":"https://api.github.com/repos/shapeblue/cloudstack","forks_url":"https://api.github.com/repos/shapeblue/cloudstack/forks","keys_url":"https://api.github.com/repos/shapeblue/cloudstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shapeblue/cloudstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shapeblue/cloudstack/teams","hooks_url":"https://api.github.com/repos/shapeblue/cloudstack/hooks","issue_events_url":"https://api.github.com/repos/shapeblue/cloudstack/issues/events{/number}","events_url":"https://api.github.com/repos/shapeblue/cloudstack/events","assignees_url":"https://api.github.com/repos/shapeblue/cloudstack/assignees{/user}","branches_url":"https://api.github.com/repos/shapeblue/cloudstack/branches{/branch}","tags_url":"https://api.github.com/repos/shapeblue/cloudstack/tags","blobs_url":"https://api.github.com/repos/shapeblue/cloudstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shapeblue/cloudstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shapeblue/cloudstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/shapeblue/cloudstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shapeblue/cloudstack/statuses/{sha}","languages_url":"https://api.github.com/repos/shapeblue/cloudstack/languages","stargazers_url":"https://api.github.com/repos/shapeblue/cloudstack/stargazers","contributors_url":"https://api.github.com/repos/shapeblue/cloudstack/contributors","subscribers_url":"https://api.github.com/repos/shapeblue/cloudstack/subscribers","subscription_url":"https://api.github.com/repos/shapeblue/cloudstack/subscription","commits_url":"https://api.github.com/repos/shapeblue/cloudstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/shapeblue/cloudstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/shapeblue/cloudstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/shapeblue/cloudstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/shapeblue/cloudstack/contents/{+path}","compare_url":"https://api.github.com/repos/shapeblue/cloudstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shapeblue/cloudstack/merges","archive_url":"https://api.github.com/repos/shapeblue/cloudstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shapeblue/cloudstack/downloads","issues_url":"https://api.github.com/repos/shapeblue/cloudstack/issues{/number}","pulls_url":"https://api.github.com/repos/shapeblue/cloudstack/pulls{/number}","milestones_url":"https://api.github.com/repos/shapeblue/cloudstack/milestones{/number}","notifications_url":"https://api.github.com/repos/shapeblue/cloudstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shapeblue/cloudstack/labels{/name}","releases_url":"https://api.github.com/repos/shapeblue/cloudstack/releases{/id}","created_at":"2015-05-12T10:22:21Z","updated_at":"2015-05-12T10:27:05Z","pushed_at":"2015-08-20T09:50:49Z","git_url":"git://github.com/shapeblue/cloudstack.git","ssh_url":"git@github.com:shapeblue/cloudstack.git","clone_url":"https://github.com/shapeblue/cloudstack.git","svn_url":"https://github.com/shapeblue/cloudstack","homepage":"http://shapeblue.com/packages","size":492795,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"b407c526f751c29438bbc41c04245b168678edae","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":9759448,"name":"cloudstack","full_name":"apache/cloudstack","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/cloudstack","description":"Mirror of Apache Cloudstack","fork":false,"url":"https://api.github.com/repos/apache/cloudstack","forks_url":"https://api.github.com/repos/apache/cloudstack/forks","keys_url":"https://api.github.com/repos/apache/cloudstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/cloudstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/cloudstack/teams","hooks_url":"https://api.github.com/repos/apache/cloudstack/hooks","issue_events_url":"https://api.github.com/repos/apache/cloudstack/issues/events{/number}","events_url":"https://api.github.com/repos/apache/cloudstack/events","assignees_url":"https://api.github.com/repos/apache/cloudstack/assignees{/user}","branches_url":"https://api.github.com/repos/apache/cloudstack/branches{/branch}","tags_url":"https://api.github.com/repos/apache/cloudstack/tags","blobs_url":"https://api.github.com/repos/apache/cloudstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/cloudstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/cloudstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/cloudstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/cloudstack/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/cloudstack/languages","stargazers_url":"https://api.github.com/repos/apache/cloudstack/stargazers","contributors_url":"https://api.github.com/repos/apache/cloudstack/contributors","subscribers_url":"https://api.github.com/repos/apache/cloudstack/subscribers","subscription_url":"https://api.github.com/repos/apache/cloudstack/subscription","commits_url":"https://api.github.com/repos/apache/cloudstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/cloudstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/cloudstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/cloudstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/cloudstack/contents/{+path}","compare_url":"https://api.github.com/repos/apache/cloudstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/cloudstack/merges","archive_url":"https://api.github.com/repos/apache/cloudstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/cloudstack/downloads","issues_url":"https://api.github.com/repos/apache/cloudstack/issues{/number}","pulls_url":"https://api.github.com/repos/apache/cloudstack/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/cloudstack/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/cloudstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/cloudstack/labels{/name}","releases_url":"https://api.github.com/repos/apache/cloudstack/releases{/id}","created_at":"2013-04-29T22:27:12Z","updated_at":"2015-08-18T06:09:46Z","pushed_at":"2015-08-20T14:09:42Z","git_url":"git://github.com/apache/cloudstack.git","ssh_url":"git@github.com:apache/cloudstack.git","clone_url":"https://github.com/apache/cloudstack.git","svn_url":"https://github.com/apache/cloudstack","homepage":null,"size":753689,"stargazers_count":273,"watchers_count":273,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":357,"mirror_url":"git://git.apache.org/cloudstack.git","open_issues_count":38,"forks":357,"open_issues":38,"watchers":273,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/689"},"html":{"href":"https://github.com/apache/cloudstack/pull/689"},"issue":{"href":"https://api.github.com/repos/apache/cloudstack/issues/689"},"comments":{"href":"https://api.github.com/repos/apache/cloudstack/issues/689/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/689/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/689/commits"},"statuses":{"href":"https://api.github.com/repos/apache/cloudstack/statuses/cd26e9dee16483cda5f77a457e8bb7f7df470565"}}}}