{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/andes/pulls/comments/80851881","pull_request_review_id":1875832,"id":80851881,"diff_hunk":"@@ -0,0 +1,112 @@\n+/*\n+ * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\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+ * http://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 org.wso2.andes.kernel.slot;\n+\n+import org.apache.commons.lang.StringUtils;\n+import org.wso2.andes.configuration.AndesConfigurationManager;\n+import org.wso2.andes.configuration.enums.AndesConfiguration;\n+import org.wso2.andes.kernel.AndesException;\n+\n+import java.util.List;\n+import java.util.Set;\n+\n+/**\n+ * AbstractSlotManager holds the common responsibilities for the standalone slot manager and cluster mode slot manager.\n+ */\n+public abstract class AbstractSlotManager {\n+\n+    /**\n+     * To keep the name of queue on which deletion task is currently running\n+     */\n+    protected String currentDeletionQueue = StringUtils.EMPTY;\n+\n+    /**\n+     * To keep the lower bound Id of the current expiry message deletion range\n+     */\n+    protected long currentDeletionRangeLowerBoundId;\n+\n+    /**\n+     *  The slot gap need to be maintained as not reachable for deletion task as they may be allocated\n+     *  to a slot delivery worker in the near future\n+     */\n+    protected int safetySlotCount;\n+\n+    public AbstractSlotManager(){\n+        this.safetySlotCount = AndesConfigurationManager.readValue\n+                (AndesConfiguration.PERFORMANCE_TUNING_SAFE_DELETE_REGION_SLOT_COUNT);\n+    }\n+\n+    /**\n+     * Get the lower bound id of safe deletion range","path":"modules/andes-core/broker/src/main/java/org/wso2/andes/kernel/slot/AbstractSlotManager.java","position":54,"original_position":54,"commit_id":"3b0d4d285d1539f08a6414cbccd273f441274b3f","original_commit_id":"3b0d4d285d1539f08a6414cbccd273f441274b3f","user":{"login":"sirojan24","id":10102529,"avatar_url":"https://avatars.githubusercontent.com/u/10102529?v=3","gravatar_id":"","url":"https://api.github.com/users/sirojan24","html_url":"https://github.com/sirojan24","followers_url":"https://api.github.com/users/sirojan24/followers","following_url":"https://api.github.com/users/sirojan24/following{/other_user}","gists_url":"https://api.github.com/users/sirojan24/gists{/gist_id}","starred_url":"https://api.github.com/users/sirojan24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirojan24/subscriptions","organizations_url":"https://api.github.com/users/sirojan24/orgs","repos_url":"https://api.github.com/users/sirojan24/repos","events_url":"https://api.github.com/users/sirojan24/events{/privacy}","received_events_url":"https://api.github.com/users/sirojan24/received_events","type":"User","site_admin":false},"body":"Done in https://github.com/wso2/andes/pull/714","created_at":"2016-09-28T06:47:39Z","updated_at":"2016-09-28T06:47:40Z","html_url":"https://github.com/wso2/andes/pull/660#discussion_r80851881","pull_request_url":"https://api.github.com/repos/wso2/andes/pulls/660","_links":{"self":{"href":"https://api.github.com/repos/wso2/andes/pulls/comments/80851881"},"html":{"href":"https://github.com/wso2/andes/pull/660#discussion_r80851881"},"pull_request":{"href":"https://api.github.com/repos/wso2/andes/pulls/660"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/andes/pulls/660","id":78670732,"html_url":"https://github.com/wso2/andes/pull/660","diff_url":"https://github.com/wso2/andes/pull/660.diff","patch_url":"https://github.com/wso2/andes/pull/660.patch","issue_url":"https://api.github.com/repos/wso2/andes/issues/660","number":660,"state":"closed","locked":false,"title":"[MB-1686] Add message TTL feature","user":{"login":"sirojan24","id":10102529,"avatar_url":"https://avatars.githubusercontent.com/u/10102529?v=3","gravatar_id":"","url":"https://api.github.com/users/sirojan24","html_url":"https://github.com/sirojan24","followers_url":"https://api.github.com/users/sirojan24/followers","following_url":"https://api.github.com/users/sirojan24/following{/other_user}","gists_url":"https://api.github.com/users/sirojan24/gists{/gist_id}","starred_url":"https://api.github.com/users/sirojan24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirojan24/subscriptions","organizations_url":"https://api.github.com/users/sirojan24/orgs","repos_url":"https://api.github.com/users/sirojan24/repos","events_url":"https://api.github.com/users/sirojan24/events{/privacy}","received_events_url":"https://api.github.com/users/sirojan24/received_events","type":"User","site_admin":false},"body":"Implementation of TTL feature for messages. The expiration time is calculated based on the TTL value of a message and the arrival time to broker. Based on the calculated expiration time, messages were checked at the message flusher whether it is expired or not in the delivery. In addition to that, a periodic task is running for the purpose of deleting the expired messages from the database. Periodic task deletes the expired messages which are not allocated for slots currently or in near future (According to a deletion safe zone calculation based on configuration). Expired messages at slots can be caught at the flusher. There is a configuration to enable the deletion of the messages in DLC.\r\n\r\nRelated JIRA link : https://wso2.org/jira/browse/MB-1686\r\n\r\nPlease merge the following along this.\r\n1. wso2/carbon-business-messaging#298\r\n2. https://github.com/wso2/product-mb/pull/404 ","created_at":"2016-07-25T12:13:18Z","updated_at":"2016-09-28T06:47:40Z","closed_at":"2016-07-29T11:28:04Z","merged_at":"2016-07-29T11:28:04Z","merge_commit_sha":"e0b5a7309c240c2598f5edcdbe53a6254489f870","assignee":{"login":"sirojan24","id":10102529,"avatar_url":"https://avatars.githubusercontent.com/u/10102529?v=3","gravatar_id":"","url":"https://api.github.com/users/sirojan24","html_url":"https://github.com/sirojan24","followers_url":"https://api.github.com/users/sirojan24/followers","following_url":"https://api.github.com/users/sirojan24/following{/other_user}","gists_url":"https://api.github.com/users/sirojan24/gists{/gist_id}","starred_url":"https://api.github.com/users/sirojan24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirojan24/subscriptions","organizations_url":"https://api.github.com/users/sirojan24/orgs","repos_url":"https://api.github.com/users/sirojan24/repos","events_url":"https://api.github.com/users/sirojan24/events{/privacy}","received_events_url":"https://api.github.com/users/sirojan24/received_events","type":"User","site_admin":false},"assignees":[{"login":"sirojan24","id":10102529,"avatar_url":"https://avatars.githubusercontent.com/u/10102529?v=3","gravatar_id":"","url":"https://api.github.com/users/sirojan24","html_url":"https://github.com/sirojan24","followers_url":"https://api.github.com/users/sirojan24/followers","following_url":"https://api.github.com/users/sirojan24/following{/other_user}","gists_url":"https://api.github.com/users/sirojan24/gists{/gist_id}","starred_url":"https://api.github.com/users/sirojan24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirojan24/subscriptions","organizations_url":"https://api.github.com/users/sirojan24/orgs","repos_url":"https://api.github.com/users/sirojan24/repos","events_url":"https://api.github.com/users/sirojan24/events{/privacy}","received_events_url":"https://api.github.com/users/sirojan24/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/wso2/andes/pulls/660/commits","review_comments_url":"https://api.github.com/repos/wso2/andes/pulls/660/comments","review_comment_url":"https://api.github.com/repos/wso2/andes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/andes/issues/660/comments","statuses_url":"https://api.github.com/repos/wso2/andes/statuses/3b0d4d285d1539f08a6414cbccd273f441274b3f","head":{"label":"sirojan24:feature-message-expiration-upload","ref":"feature-message-expiration-upload","sha":"3b0d4d285d1539f08a6414cbccd273f441274b3f","user":{"login":"sirojan24","id":10102529,"avatar_url":"https://avatars.githubusercontent.com/u/10102529?v=3","gravatar_id":"","url":"https://api.github.com/users/sirojan24","html_url":"https://github.com/sirojan24","followers_url":"https://api.github.com/users/sirojan24/followers","following_url":"https://api.github.com/users/sirojan24/following{/other_user}","gists_url":"https://api.github.com/users/sirojan24/gists{/gist_id}","starred_url":"https://api.github.com/users/sirojan24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirojan24/subscriptions","organizations_url":"https://api.github.com/users/sirojan24/orgs","repos_url":"https://api.github.com/users/sirojan24/repos","events_url":"https://api.github.com/users/sirojan24/events{/privacy}","received_events_url":"https://api.github.com/users/sirojan24/received_events","type":"User","site_admin":false},"repo":{"id":61710905,"name":"andes","full_name":"sirojan24/andes","owner":{"login":"sirojan24","id":10102529,"avatar_url":"https://avatars.githubusercontent.com/u/10102529?v=3","gravatar_id":"","url":"https://api.github.com/users/sirojan24","html_url":"https://github.com/sirojan24","followers_url":"https://api.github.com/users/sirojan24/followers","following_url":"https://api.github.com/users/sirojan24/following{/other_user}","gists_url":"https://api.github.com/users/sirojan24/gists{/gist_id}","starred_url":"https://api.github.com/users/sirojan24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirojan24/subscriptions","organizations_url":"https://api.github.com/users/sirojan24/orgs","repos_url":"https://api.github.com/users/sirojan24/repos","events_url":"https://api.github.com/users/sirojan24/events{/privacy}","received_events_url":"https://api.github.com/users/sirojan24/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sirojan24/andes","description":"","fork":true,"url":"https://api.github.com/repos/sirojan24/andes","forks_url":"https://api.github.com/repos/sirojan24/andes/forks","keys_url":"https://api.github.com/repos/sirojan24/andes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sirojan24/andes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sirojan24/andes/teams","hooks_url":"https://api.github.com/repos/sirojan24/andes/hooks","issue_events_url":"https://api.github.com/repos/sirojan24/andes/issues/events{/number}","events_url":"https://api.github.com/repos/sirojan24/andes/events","assignees_url":"https://api.github.com/repos/sirojan24/andes/assignees{/user}","branches_url":"https://api.github.com/repos/sirojan24/andes/branches{/branch}","tags_url":"https://api.github.com/repos/sirojan24/andes/tags","blobs_url":"https://api.github.com/repos/sirojan24/andes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sirojan24/andes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sirojan24/andes/git/refs{/sha}","trees_url":"https://api.github.com/repos/sirojan24/andes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sirojan24/andes/statuses/{sha}","languages_url":"https://api.github.com/repos/sirojan24/andes/languages","stargazers_url":"https://api.github.com/repos/sirojan24/andes/stargazers","contributors_url":"https://api.github.com/repos/sirojan24/andes/contributors","subscribers_url":"https://api.github.com/repos/sirojan24/andes/subscribers","subscription_url":"https://api.github.com/repos/sirojan24/andes/subscription","commits_url":"https://api.github.com/repos/sirojan24/andes/commits{/sha}","git_commits_url":"https://api.github.com/repos/sirojan24/andes/git/commits{/sha}","comments_url":"https://api.github.com/repos/sirojan24/andes/comments{/number}","issue_comment_url":"https://api.github.com/repos/sirojan24/andes/issues/comments{/number}","contents_url":"https://api.github.com/repos/sirojan24/andes/contents/{+path}","compare_url":"https://api.github.com/repos/sirojan24/andes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sirojan24/andes/merges","archive_url":"https://api.github.com/repos/sirojan24/andes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sirojan24/andes/downloads","issues_url":"https://api.github.com/repos/sirojan24/andes/issues{/number}","pulls_url":"https://api.github.com/repos/sirojan24/andes/pulls{/number}","milestones_url":"https://api.github.com/repos/sirojan24/andes/milestones{/number}","notifications_url":"https://api.github.com/repos/sirojan24/andes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sirojan24/andes/labels{/name}","releases_url":"https://api.github.com/repos/sirojan24/andes/releases{/id}","deployments_url":"https://api.github.com/repos/sirojan24/andes/deployments","created_at":"2016-06-22T10:36:50Z","updated_at":"2016-06-22T10:36:58Z","pushed_at":"2016-09-28T05:07:27Z","git_url":"git://github.com/sirojan24/andes.git","ssh_url":"git@github.com:sirojan24/andes.git","clone_url":"https://github.com/sirojan24/andes.git","svn_url":"https://github.com/sirojan24/andes","homepage":null,"size":68339,"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":"wso2:master","ref":"master","sha":"4f0b068c6e3bb8301ba3d8b9fb8715af8b8db8d6","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":20559270,"name":"andes","full_name":"wso2/andes","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2/andes","description":"","fork":false,"url":"https://api.github.com/repos/wso2/andes","forks_url":"https://api.github.com/repos/wso2/andes/forks","keys_url":"https://api.github.com/repos/wso2/andes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/andes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/andes/teams","hooks_url":"https://api.github.com/repos/wso2/andes/hooks","issue_events_url":"https://api.github.com/repos/wso2/andes/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/andes/events","assignees_url":"https://api.github.com/repos/wso2/andes/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/andes/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/andes/tags","blobs_url":"https://api.github.com/repos/wso2/andes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/andes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/andes/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/andes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/andes/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/andes/languages","stargazers_url":"https://api.github.com/repos/wso2/andes/stargazers","contributors_url":"https://api.github.com/repos/wso2/andes/contributors","subscribers_url":"https://api.github.com/repos/wso2/andes/subscribers","subscription_url":"https://api.github.com/repos/wso2/andes/subscription","commits_url":"https://api.github.com/repos/wso2/andes/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/andes/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/andes/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/andes/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/andes/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/andes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/andes/merges","archive_url":"https://api.github.com/repos/wso2/andes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/andes/downloads","issues_url":"https://api.github.com/repos/wso2/andes/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/andes/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/andes/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/andes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/andes/labels{/name}","releases_url":"https://api.github.com/repos/wso2/andes/releases{/id}","deployments_url":"https://api.github.com/repos/wso2/andes/deployments","created_at":"2014-06-06T10:04:24Z","updated_at":"2016-01-11T04:42:59Z","pushed_at":"2016-09-28T05:07:51Z","git_url":"git://github.com/wso2/andes.git","ssh_url":"git@github.com:wso2/andes.git","clone_url":"https://github.com/wso2/andes.git","svn_url":"https://github.com/wso2/andes","homepage":null,"size":69570,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":13,"forks":48,"open_issues":13,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/andes/pulls/660"},"html":{"href":"https://github.com/wso2/andes/pull/660"},"issue":{"href":"https://api.github.com/repos/wso2/andes/issues/660"},"comments":{"href":"https://api.github.com/repos/wso2/andes/issues/660/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/andes/pulls/660/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/andes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/andes/pulls/660/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/andes/statuses/3b0d4d285d1539f08a6414cbccd273f441274b3f"}}}}
{"actor":{"display_login":"sirojan24"}}