{"action":"created","comment":{"url":"https://api.github.com/repos/apache/storm/pulls/comments/49161519","id":49161519,"diff_hunk":"@@ -0,0 +1,84 @@\n+/**\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  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+package org.apache.storm.mqtt.trident;\n+\n+import backtype.storm.Config;\n+import backtype.storm.task.OutputCollector;\n+import backtype.storm.topology.FailedException;\n+import org.apache.storm.mqtt.MqttMessage;\n+import org.apache.storm.mqtt.common.MqttOptions;\n+import org.apache.storm.mqtt.MqttTupleMapper;\n+import org.apache.storm.mqtt.common.MqttPublisher;\n+import org.apache.storm.mqtt.common.SslUtils;\n+import org.apache.storm.mqtt.ssl.KeyStoreLoader;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import storm.trident.operation.BaseFunction;\n+import storm.trident.operation.TridentCollector;\n+import storm.trident.operation.TridentOperationContext;\n+import storm.trident.tuple.TridentTuple;\n+\n+import java.util.Map;\n+\n+public class MqttPublishFunction extends BaseFunction {","path":"external/storm-mqtt/core/src/main/java/org/apache/storm/mqtt/trident/MqttPublishFunction.java","position":38,"original_position":38,"commit_id":"4b61308349d8c66d48234de22190fe721aa0e621","original_commit_id":"bd11b59ce3b46d1ccd2ccf5f94851ddf8ebafc21","user":{"login":"arunmahadevan","id":6792890,"avatar_url":"https://avatars.githubusercontent.com/u/6792890?v=3","gravatar_id":"","url":"https://api.github.com/users/arunmahadevan","html_url":"https://github.com/arunmahadevan","followers_url":"https://api.github.com/users/arunmahadevan/followers","following_url":"https://api.github.com/users/arunmahadevan/following{/other_user}","gists_url":"https://api.github.com/users/arunmahadevan/gists{/gist_id}","starred_url":"https://api.github.com/users/arunmahadevan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arunmahadevan/subscriptions","organizations_url":"https://api.github.com/users/arunmahadevan/orgs","repos_url":"https://api.github.com/users/arunmahadevan/repos","events_url":"https://api.github.com/users/arunmahadevan/events{/privacy}","received_events_url":"https://api.github.com/users/arunmahadevan/received_events","type":"User","site_admin":false},"body":"Since the function does not emit anything, it cannot be chained with further operations like normal functions and it appeared more like a sink. Hence thought it might be more apt for it to be implemented as a state instead of a function.\r\n\r\nAgree that its difficult to do exactly once, but many other state implementations also does not guarantee exactly once. Leave it to you to decide the right approach.","created_at":"2016-01-08T06:25:30Z","updated_at":"2016-01-08T06:25:30Z","html_url":"https://github.com/apache/storm/pull/991#discussion_r49161519","pull_request_url":"https://api.github.com/repos/apache/storm/pulls/991","_links":{"self":{"href":"https://api.github.com/repos/apache/storm/pulls/comments/49161519"},"html":{"href":"https://github.com/apache/storm/pull/991#discussion_r49161519"},"pull_request":{"href":"https://api.github.com/repos/apache/storm/pulls/991"}}},"pull_request":{"url":"https://api.github.com/repos/apache/storm/pulls/991","id":55148291,"html_url":"https://github.com/apache/storm/pull/991","diff_url":"https://github.com/apache/storm/pull/991.diff","patch_url":"https://github.com/apache/storm/pull/991.patch","issue_url":"https://api.github.com/repos/apache/storm/issues/991","number":991,"state":"open","locked":false,"title":"STORM-1406: Add MQTT Support","user":{"login":"ptgoetz","id":260896,"avatar_url":"https://avatars.githubusercontent.com/u/260896?v=3","gravatar_id":"","url":"https://api.github.com/users/ptgoetz","html_url":"https://github.com/ptgoetz","followers_url":"https://api.github.com/users/ptgoetz/followers","following_url":"https://api.github.com/users/ptgoetz/following{/other_user}","gists_url":"https://api.github.com/users/ptgoetz/gists{/gist_id}","starred_url":"https://api.github.com/users/ptgoetz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptgoetz/subscriptions","organizations_url":"https://api.github.com/users/ptgoetz/orgs","repos_url":"https://api.github.com/users/ptgoetz/repos","events_url":"https://api.github.com/users/ptgoetz/events{/privacy}","received_events_url":"https://api.github.com/users/ptgoetz/received_events","type":"User","site_admin":false},"body":"https://issues.apache.org/jira/browse/STORM-1406","created_at":"2016-01-05T21:53:35Z","updated_at":"2016-01-08T06:25:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"306d96cc0830676d276b0bd83b05393098288ae9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/storm/pulls/991/commits","review_comments_url":"https://api.github.com/repos/apache/storm/pulls/991/comments","review_comment_url":"https://api.github.com/repos/apache/storm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/storm/issues/991/comments","statuses_url":"https://api.github.com/repos/apache/storm/statuses/4b61308349d8c66d48234de22190fe721aa0e621","head":{"label":"ptgoetz:storm-mqtt","ref":"storm-mqtt","sha":"4b61308349d8c66d48234de22190fe721aa0e621","user":{"login":"ptgoetz","id":260896,"avatar_url":"https://avatars.githubusercontent.com/u/260896?v=3","gravatar_id":"","url":"https://api.github.com/users/ptgoetz","html_url":"https://github.com/ptgoetz","followers_url":"https://api.github.com/users/ptgoetz/followers","following_url":"https://api.github.com/users/ptgoetz/following{/other_user}","gists_url":"https://api.github.com/users/ptgoetz/gists{/gist_id}","starred_url":"https://api.github.com/users/ptgoetz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptgoetz/subscriptions","organizations_url":"https://api.github.com/users/ptgoetz/orgs","repos_url":"https://api.github.com/users/ptgoetz/repos","events_url":"https://api.github.com/users/ptgoetz/events{/privacy}","received_events_url":"https://api.github.com/users/ptgoetz/received_events","type":"User","site_admin":false},"repo":{"id":15115281,"name":"storm","full_name":"ptgoetz/storm","owner":{"login":"ptgoetz","id":260896,"avatar_url":"https://avatars.githubusercontent.com/u/260896?v=3","gravatar_id":"","url":"https://api.github.com/users/ptgoetz","html_url":"https://github.com/ptgoetz","followers_url":"https://api.github.com/users/ptgoetz/followers","following_url":"https://api.github.com/users/ptgoetz/following{/other_user}","gists_url":"https://api.github.com/users/ptgoetz/gists{/gist_id}","starred_url":"https://api.github.com/users/ptgoetz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptgoetz/subscriptions","organizations_url":"https://api.github.com/users/ptgoetz/orgs","repos_url":"https://api.github.com/users/ptgoetz/repos","events_url":"https://api.github.com/users/ptgoetz/events{/privacy}","received_events_url":"https://api.github.com/users/ptgoetz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ptgoetz/storm","description":"Mirror of Apache Storm","fork":true,"url":"https://api.github.com/repos/ptgoetz/storm","forks_url":"https://api.github.com/repos/ptgoetz/storm/forks","keys_url":"https://api.github.com/repos/ptgoetz/storm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ptgoetz/storm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ptgoetz/storm/teams","hooks_url":"https://api.github.com/repos/ptgoetz/storm/hooks","issue_events_url":"https://api.github.com/repos/ptgoetz/storm/issues/events{/number}","events_url":"https://api.github.com/repos/ptgoetz/storm/events","assignees_url":"https://api.github.com/repos/ptgoetz/storm/assignees{/user}","branches_url":"https://api.github.com/repos/ptgoetz/storm/branches{/branch}","tags_url":"https://api.github.com/repos/ptgoetz/storm/tags","blobs_url":"https://api.github.com/repos/ptgoetz/storm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ptgoetz/storm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ptgoetz/storm/git/refs{/sha}","trees_url":"https://api.github.com/repos/ptgoetz/storm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ptgoetz/storm/statuses/{sha}","languages_url":"https://api.github.com/repos/ptgoetz/storm/languages","stargazers_url":"https://api.github.com/repos/ptgoetz/storm/stargazers","contributors_url":"https://api.github.com/repos/ptgoetz/storm/contributors","subscribers_url":"https://api.github.com/repos/ptgoetz/storm/subscribers","subscription_url":"https://api.github.com/repos/ptgoetz/storm/subscription","commits_url":"https://api.github.com/repos/ptgoetz/storm/commits{/sha}","git_commits_url":"https://api.github.com/repos/ptgoetz/storm/git/commits{/sha}","comments_url":"https://api.github.com/repos/ptgoetz/storm/comments{/number}","issue_comment_url":"https://api.github.com/repos/ptgoetz/storm/issues/comments{/number}","contents_url":"https://api.github.com/repos/ptgoetz/storm/contents/{+path}","compare_url":"https://api.github.com/repos/ptgoetz/storm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ptgoetz/storm/merges","archive_url":"https://api.github.com/repos/ptgoetz/storm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ptgoetz/storm/downloads","issues_url":"https://api.github.com/repos/ptgoetz/storm/issues{/number}","pulls_url":"https://api.github.com/repos/ptgoetz/storm/pulls{/number}","milestones_url":"https://api.github.com/repos/ptgoetz/storm/milestones{/number}","notifications_url":"https://api.github.com/repos/ptgoetz/storm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ptgoetz/storm/labels{/name}","releases_url":"https://api.github.com/repos/ptgoetz/storm/releases{/id}","created_at":"2013-12-11T18:22:59Z","updated_at":"2015-01-04T01:30:49Z","pushed_at":"2016-01-08T05:31:38Z","git_url":"git://github.com/ptgoetz/storm.git","ssh_url":"git@github.com:ptgoetz/storm.git","clone_url":"https://github.com/ptgoetz/storm.git","svn_url":"https://github.com/ptgoetz/storm","homepage":null,"size":29260,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":5,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"cb1018db0ebf29291ad71d103610620ab06dd82c","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":14135470,"name":"storm","full_name":"apache/storm","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/storm","description":"Mirror of Apache Storm","fork":false,"url":"https://api.github.com/repos/apache/storm","forks_url":"https://api.github.com/repos/apache/storm/forks","keys_url":"https://api.github.com/repos/apache/storm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/storm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/storm/teams","hooks_url":"https://api.github.com/repos/apache/storm/hooks","issue_events_url":"https://api.github.com/repos/apache/storm/issues/events{/number}","events_url":"https://api.github.com/repos/apache/storm/events","assignees_url":"https://api.github.com/repos/apache/storm/assignees{/user}","branches_url":"https://api.github.com/repos/apache/storm/branches{/branch}","tags_url":"https://api.github.com/repos/apache/storm/tags","blobs_url":"https://api.github.com/repos/apache/storm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/storm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/storm/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/storm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/storm/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/storm/languages","stargazers_url":"https://api.github.com/repos/apache/storm/stargazers","contributors_url":"https://api.github.com/repos/apache/storm/contributors","subscribers_url":"https://api.github.com/repos/apache/storm/subscribers","subscription_url":"https://api.github.com/repos/apache/storm/subscription","commits_url":"https://api.github.com/repos/apache/storm/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/storm/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/storm/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/storm/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/storm/contents/{+path}","compare_url":"https://api.github.com/repos/apache/storm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/storm/merges","archive_url":"https://api.github.com/repos/apache/storm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/storm/downloads","issues_url":"https://api.github.com/repos/apache/storm/issues{/number}","pulls_url":"https://api.github.com/repos/apache/storm/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/storm/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/storm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/storm/labels{/name}","releases_url":"https://api.github.com/repos/apache/storm/releases{/id}","created_at":"2013-11-05T08:00:14Z","updated_at":"2016-01-07T21:55:56Z","pushed_at":"2016-01-08T05:50:33Z","git_url":"git://github.com/apache/storm.git","ssh_url":"git@github.com:apache/storm.git","clone_url":"https://github.com/apache/storm.git","svn_url":"https://github.com/apache/storm","homepage":null,"size":156014,"stargazers_count":2712,"watchers_count":2712,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2028,"mirror_url":"git://git.apache.org/storm.git","open_issues_count":77,"forks":2028,"open_issues":77,"watchers":2712,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/storm/pulls/991"},"html":{"href":"https://github.com/apache/storm/pull/991"},"issue":{"href":"https://api.github.com/repos/apache/storm/issues/991"},"comments":{"href":"https://api.github.com/repos/apache/storm/issues/991/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/storm/pulls/991/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/storm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/storm/pulls/991/commits"},"statuses":{"href":"https://api.github.com/repos/apache/storm/statuses/4b61308349d8c66d48234de22190fe721aa0e621"}}}}