{"action":"created","comment":{"url":"https://api.github.com/repos/apache/stratos/pulls/comments/45713295","id":45713295,"diff_hunk":"@@ -61,54 +57,54 @@ public ThriftStatisticsPublisher(StreamDefinition streamDefinition, String thrif\n         this.streamDefinition = streamDefinition;\n \n         if (isPublisherEnabled()) {\n-        \tthis.enabled = true;\n+            this.enabled = true;\n             init();\n         }\n     }\n \n     private boolean isPublisherEnabled() {\n-    \tboolean publisherEnabled = false;\n-    \tfor (ThriftClientInfo thriftClientInfo : thriftClientInfoList) {\n-    \t\tpublisherEnabled = thriftClientInfo.isStatsPublisherEnabled();\n-    \t\tif(publisherEnabled){\n-    \t\t\tbreak;\n-    \t\t}\n-\t\t}    \t\n-\t\treturn publisherEnabled;\n-\t}\n-\n-\tprivate void init() {\n-        \n+        for (ThriftClientInfo thriftClientInfo : thriftClientInfoList) {\n+            if (thriftClientInfo.isStatsPublisherEnabled()) {\n+                return true;\n+            }\n+        }\n+        return false;\n+    }\n+\n+    private void init() {\n+\n         // Initialize load balancing data publisher       \n         loadBalancingDataPublisher = new LoadBalancingDataPublisher(getReceiverGroups());\n+\n+        //adding stream definition\n         loadBalancingDataPublisher.addStreamDefinition(streamDefinition);\n     }\n \n     private ArrayList<ReceiverGroup> getReceiverGroups() {\n-    \t\n-        ArrayList<ReceiverGroup> receiverGroups = new ArrayList<ReceiverGroup>();    \n-        \n+\n+        ArrayList<ReceiverGroup> receiverGroups = new ArrayList<ReceiverGroup>();\n+\n         for (ThriftClientInfo thriftClientInfo : thriftClientInfoList) {\n-        \tArrayList<DataPublisherHolder> dataPublisherHolders = new ArrayList<DataPublisherHolder>();\n-\t\t\tDataPublisherHolder aNode = new DataPublisherHolder(null, buildUrl(thriftClientInfo), thriftClientInfo.getUsername(), thriftClientInfo.getPassword());\n-\t\t\tdataPublisherHolders.add(aNode);\n-\t\t\tReceiverGroup group = new ReceiverGroup(dataPublisherHolders);\n-\t\t\treceiverGroups.add(group);\n-\t\t} \n-\t\treturn receiverGroups; \n-        \n-\t}\n-\n-\tprivate String buildUrl(ThriftClientInfo thriftClientInfo) {\n-\t\tString url = new StringBuilder()\n-\t\t\t\t\t\t.append(\"tcp://\")\n-\t\t\t\t\t\t.append(thriftClientInfo.getIp())\n-\t\t\t\t\t\t.append(\":\")\n-\t\t\t\t\t\t.append(thriftClientInfo.getPort()).toString();\t\t\t\t\n-\t\treturn url;\n-\t}\n-\n-\t@Override\n+            ArrayList<DataPublisherHolder> dataPublisherHolders = new ArrayList<DataPublisherHolder>();\n+            DataPublisherHolder aNode = new DataPublisherHolder(null, buildUrl(thriftClientInfo), thriftClientInfo.getUsername(), thriftClientInfo.getPassword());\n+            dataPublisherHolders.add(aNode);\n+            ReceiverGroup group = new ReceiverGroup(dataPublisherHolders);\n+            receiverGroups.add(group);\n+        }\n+        return receiverGroups;\n+\n+    }\n+\n+    private String buildUrl(ThriftClientInfo thriftClientInfo) {\n+        String url = new StringBuilder()\n+                .append(\"tcp://\")\n+                .append(thriftClientInfo.getIp())\n+                .append(\":\")\n+                .append(thriftClientInfo.getPort()).toString();\n+        return url;\n+    }\n+","path":"components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/ThriftStatisticsPublisher.java","position":112,"original_position":112,"commit_id":"05d1c187e1aeb3efeef4c1d4f6282ea41de51d63","original_commit_id":"05d1c187e1aeb3efeef4c1d4f6282ea41de51d63","user":{"login":"imesh","id":56142,"avatar_url":"https://avatars.githubusercontent.com/u/56142?v=3","gravatar_id":"","url":"https://api.github.com/users/imesh","html_url":"https://github.com/imesh","followers_url":"https://api.github.com/users/imesh/followers","following_url":"https://api.github.com/users/imesh/following{/other_user}","gists_url":"https://api.github.com/users/imesh/gists{/gist_id}","starred_url":"https://api.github.com/users/imesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imesh/subscriptions","organizations_url":"https://api.github.com/users/imesh/orgs","repos_url":"https://api.github.com/users/imesh/repos","events_url":"https://api.github.com/users/imesh/events{/privacy}","received_events_url":"https://api.github.com/users/imesh/received_events","type":"User","site_admin":false},"body":"How do we handle multiple thrift URLs if there are multiple servers defined?","created_at":"2015-11-24T09:39:02Z","updated_at":"2015-11-24T09:39:02Z","html_url":"https://github.com/apache/stratos/pull/493#discussion_r45713295","pull_request_url":"https://api.github.com/repos/apache/stratos/pulls/493","_links":{"self":{"href":"https://api.github.com/repos/apache/stratos/pulls/comments/45713295"},"html":{"href":"https://github.com/apache/stratos/pull/493#discussion_r45713295"},"pull_request":{"href":"https://api.github.com/repos/apache/stratos/pulls/493"}}},"pull_request":{"url":"https://api.github.com/repos/apache/stratos/pulls/493","id":51490124,"html_url":"https://github.com/apache/stratos/pull/493","diff_url":"https://github.com/apache/stratos/pull/493.diff","patch_url":"https://github.com/apache/stratos/pull/493.patch","issue_url":"https://api.github.com/repos/apache/stratos/issues/493","number":493,"state":"closed","locked":false,"title":"Fixing multiple publisher objects created for DAS events and refactoring cep and das thrift statistics publishers.","user":{"login":"Thanu","id":1333842,"avatar_url":"https://avatars.githubusercontent.com/u/1333842?v=3","gravatar_id":"","url":"https://api.github.com/users/Thanu","html_url":"https://github.com/Thanu","followers_url":"https://api.github.com/users/Thanu/followers","following_url":"https://api.github.com/users/Thanu/following{/other_user}","gists_url":"https://api.github.com/users/Thanu/gists{/gist_id}","starred_url":"https://api.github.com/users/Thanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thanu/subscriptions","organizations_url":"https://api.github.com/users/Thanu/orgs","repos_url":"https://api.github.com/users/Thanu/repos","events_url":"https://api.github.com/users/Thanu/events{/privacy}","received_events_url":"https://api.github.com/users/Thanu/received_events","type":"User","site_admin":false},"body":"This p/r includes changes for fixing multiple publisher objects created for DAS events (STRATOS-1629) and refactoring cep and das thrift publisher classes to make them singleton classes.","created_at":"2015-11-23T05:59:39Z","updated_at":"2015-11-24T09:39:02Z","closed_at":"2015-11-23T15:04:24Z","merged_at":"2015-11-23T15:04:24Z","merge_commit_sha":"ef8b9a7f63791899a80ff0ed3a8a7af5993d3e31","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/stratos/pulls/493/commits","review_comments_url":"https://api.github.com/repos/apache/stratos/pulls/493/comments","review_comment_url":"https://api.github.com/repos/apache/stratos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/stratos/issues/493/comments","statuses_url":"https://api.github.com/repos/apache/stratos/statuses/05d1c187e1aeb3efeef4c1d4f6282ea41de51d63","head":{"label":"Thanu:stratos-4.1.x","ref":"stratos-4.1.x","sha":"05d1c187e1aeb3efeef4c1d4f6282ea41de51d63","user":{"login":"Thanu","id":1333842,"avatar_url":"https://avatars.githubusercontent.com/u/1333842?v=3","gravatar_id":"","url":"https://api.github.com/users/Thanu","html_url":"https://github.com/Thanu","followers_url":"https://api.github.com/users/Thanu/followers","following_url":"https://api.github.com/users/Thanu/following{/other_user}","gists_url":"https://api.github.com/users/Thanu/gists{/gist_id}","starred_url":"https://api.github.com/users/Thanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thanu/subscriptions","organizations_url":"https://api.github.com/users/Thanu/orgs","repos_url":"https://api.github.com/users/Thanu/repos","events_url":"https://api.github.com/users/Thanu/events{/privacy}","received_events_url":"https://api.github.com/users/Thanu/received_events","type":"User","site_admin":false},"repo":{"id":39894248,"name":"stratos","full_name":"Thanu/stratos","owner":{"login":"Thanu","id":1333842,"avatar_url":"https://avatars.githubusercontent.com/u/1333842?v=3","gravatar_id":"","url":"https://api.github.com/users/Thanu","html_url":"https://github.com/Thanu","followers_url":"https://api.github.com/users/Thanu/followers","following_url":"https://api.github.com/users/Thanu/following{/other_user}","gists_url":"https://api.github.com/users/Thanu/gists{/gist_id}","starred_url":"https://api.github.com/users/Thanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thanu/subscriptions","organizations_url":"https://api.github.com/users/Thanu/orgs","repos_url":"https://api.github.com/users/Thanu/repos","events_url":"https://api.github.com/users/Thanu/events{/privacy}","received_events_url":"https://api.github.com/users/Thanu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Thanu/stratos","description":"Mirror of Apache Stratos","fork":true,"url":"https://api.github.com/repos/Thanu/stratos","forks_url":"https://api.github.com/repos/Thanu/stratos/forks","keys_url":"https://api.github.com/repos/Thanu/stratos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Thanu/stratos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Thanu/stratos/teams","hooks_url":"https://api.github.com/repos/Thanu/stratos/hooks","issue_events_url":"https://api.github.com/repos/Thanu/stratos/issues/events{/number}","events_url":"https://api.github.com/repos/Thanu/stratos/events","assignees_url":"https://api.github.com/repos/Thanu/stratos/assignees{/user}","branches_url":"https://api.github.com/repos/Thanu/stratos/branches{/branch}","tags_url":"https://api.github.com/repos/Thanu/stratos/tags","blobs_url":"https://api.github.com/repos/Thanu/stratos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Thanu/stratos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Thanu/stratos/git/refs{/sha}","trees_url":"https://api.github.com/repos/Thanu/stratos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Thanu/stratos/statuses/{sha}","languages_url":"https://api.github.com/repos/Thanu/stratos/languages","stargazers_url":"https://api.github.com/repos/Thanu/stratos/stargazers","contributors_url":"https://api.github.com/repos/Thanu/stratos/contributors","subscribers_url":"https://api.github.com/repos/Thanu/stratos/subscribers","subscription_url":"https://api.github.com/repos/Thanu/stratos/subscription","commits_url":"https://api.github.com/repos/Thanu/stratos/commits{/sha}","git_commits_url":"https://api.github.com/repos/Thanu/stratos/git/commits{/sha}","comments_url":"https://api.github.com/repos/Thanu/stratos/comments{/number}","issue_comment_url":"https://api.github.com/repos/Thanu/stratos/issues/comments{/number}","contents_url":"https://api.github.com/repos/Thanu/stratos/contents/{+path}","compare_url":"https://api.github.com/repos/Thanu/stratos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Thanu/stratos/merges","archive_url":"https://api.github.com/repos/Thanu/stratos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Thanu/stratos/downloads","issues_url":"https://api.github.com/repos/Thanu/stratos/issues{/number}","pulls_url":"https://api.github.com/repos/Thanu/stratos/pulls{/number}","milestones_url":"https://api.github.com/repos/Thanu/stratos/milestones{/number}","notifications_url":"https://api.github.com/repos/Thanu/stratos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Thanu/stratos/labels{/name}","releases_url":"https://api.github.com/repos/Thanu/stratos/releases{/id}","created_at":"2015-07-29T13:16:37Z","updated_at":"2015-07-29T13:16:43Z","pushed_at":"2015-11-24T06:55:31Z","git_url":"git://github.com/Thanu/stratos.git","ssh_url":"git@github.com:Thanu/stratos.git","clone_url":"https://github.com/Thanu/stratos.git","svn_url":"https://github.com/Thanu/stratos","homepage":null,"size":64960,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"apache:stratos-4.1.x","ref":"stratos-4.1.x","sha":"962ce94279322fce5b9c0d0719ebe0bec5934bed","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":20432793,"name":"stratos","full_name":"apache/stratos","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/stratos","description":"Mirror of Apache Stratos","fork":false,"url":"https://api.github.com/repos/apache/stratos","forks_url":"https://api.github.com/repos/apache/stratos/forks","keys_url":"https://api.github.com/repos/apache/stratos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/stratos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/stratos/teams","hooks_url":"https://api.github.com/repos/apache/stratos/hooks","issue_events_url":"https://api.github.com/repos/apache/stratos/issues/events{/number}","events_url":"https://api.github.com/repos/apache/stratos/events","assignees_url":"https://api.github.com/repos/apache/stratos/assignees{/user}","branches_url":"https://api.github.com/repos/apache/stratos/branches{/branch}","tags_url":"https://api.github.com/repos/apache/stratos/tags","blobs_url":"https://api.github.com/repos/apache/stratos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/stratos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/stratos/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/stratos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/stratos/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/stratos/languages","stargazers_url":"https://api.github.com/repos/apache/stratos/stargazers","contributors_url":"https://api.github.com/repos/apache/stratos/contributors","subscribers_url":"https://api.github.com/repos/apache/stratos/subscribers","subscription_url":"https://api.github.com/repos/apache/stratos/subscription","commits_url":"https://api.github.com/repos/apache/stratos/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/stratos/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/stratos/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/stratos/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/stratos/contents/{+path}","compare_url":"https://api.github.com/repos/apache/stratos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/stratos/merges","archive_url":"https://api.github.com/repos/apache/stratos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/stratos/downloads","issues_url":"https://api.github.com/repos/apache/stratos/issues{/number}","pulls_url":"https://api.github.com/repos/apache/stratos/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/stratos/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/stratos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/stratos/labels{/name}","releases_url":"https://api.github.com/repos/apache/stratos/releases{/id}","created_at":"2014-06-03T07:00:07Z","updated_at":"2015-11-24T02:49:32Z","pushed_at":"2015-11-24T09:15:25Z","git_url":"git://github.com/apache/stratos.git","ssh_url":"git@github.com:apache/stratos.git","clone_url":"https://github.com/apache/stratos.git","svn_url":"https://github.com/apache/stratos","homepage":null,"size":74508,"stargazers_count":115,"watchers_count":115,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":88,"mirror_url":"git://git.apache.org/stratos.git","open_issues_count":10,"forks":88,"open_issues":10,"watchers":115,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/stratos/pulls/493"},"html":{"href":"https://github.com/apache/stratos/pull/493"},"issue":{"href":"https://api.github.com/repos/apache/stratos/issues/493"},"comments":{"href":"https://api.github.com/repos/apache/stratos/issues/493/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/stratos/pulls/493/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/stratos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/stratos/pulls/493/commits"},"statuses":{"href":"https://api.github.com/repos/apache/stratos/statuses/05d1c187e1aeb3efeef4c1d4f6282ea41de51d63"}}}}