{"action":"created","comment":{"url":"https://api.github.com/repos/stealthly/go_kafka_client/pulls/comments/42310985","id":42310985,"diff_hunk":"@@ -0,0 +1,118 @@\n+package framework\n+\n+import (\n+\t\"encoding/json\"\n+\t\"fmt\"\n+\t\"net/url\"\n+\t\"strings\"\n+\n+\t\"github.com/golang/protobuf/proto\"\n+\tmesos \"github.com/mesos/mesos-go/mesosproto\"\n+\tutil \"github.com/mesos/mesos-go/mesosutil\"\n+)\n+\n+type MirrorMakerTask struct {\n+\t*CommonTask\n+}\n+\n+func NewMirrorMakerTask(id string, queryParams url.Values) (*MirrorMakerTask, error) {\n+\ttaskData := &TaskData{\n+\t\tID:    id,\n+\t\tState: TaskStateInactive,\n+\t\tConfig: TaskConfig{\n+\t\t\t\"num.producers\": \"1\",\n+\t\t\t\"num.streams\":   \"1\",\n+\t\t\t\"queue.size\":    \"10000\",\n+\t\t},\n+\t}\n+\n+\terr := taskData.Update(queryParams)\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\n+\treturn &MirrorMakerTask{\n+\t\t&CommonTask{TaskData: taskData},\n+\t}, nil\n+}\n+\n+func (mm *MirrorMakerTask) NewTaskInfo(offer *mesos.Offer) *mesos.TaskInfo {\n+\ttaskName := fmt.Sprintf(\"mirrormaker-%s\", mm.ID)\n+\ttaskId := &mesos.TaskID{\n+\t\tValue: proto.String(fmt.Sprintf(\"%s-%s\", taskName, uuid())),\n+\t}\n+\n+\tdata, err := json.Marshal(mm.Config)\n+\tif err != nil {\n+\t\tpanic(err)\n+\t}\n+\n+\ttaskInfo := &mesos.TaskInfo{\n+\t\tName:     proto.String(taskName),\n+\t\tTaskId:   taskId,\n+\t\tSlaveId:  offer.GetSlaveId(),\n+\t\tExecutor: mm.createExecutor(),\n+\t\tResources: []*mesos.Resource{\n+\t\t\tutil.NewScalarResource(\"cpus\", mm.Cpu),\n+\t\t\tutil.NewScalarResource(\"mem\", mm.Mem),\n+\t\t},\n+\t\tData: data,\n+\t}\n+\n+\treturn taskInfo\n+}\n+\n+func (mm *MirrorMakerTask) String() string {\n+\tresponse := \"    type: mirrormaker\\n\"","path":"mesos/framework/mirror_maker_task.go","position":66,"original_position":66,"commit_id":"a3beb7646e867c9d430102d84062aa1528fe51d5","original_commit_id":"a3beb7646e867c9d430102d84062aa1528fe51d5","user":{"login":"joestein","id":115151,"avatar_url":"https://avatars.githubusercontent.com/u/115151?v=3","gravatar_id":"","url":"https://api.github.com/users/joestein","html_url":"https://github.com/joestein","followers_url":"https://api.github.com/users/joestein/followers","following_url":"https://api.github.com/users/joestein/following{/other_user}","gists_url":"https://api.github.com/users/joestein/gists{/gist_id}","starred_url":"https://api.github.com/users/joestein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joestein/subscriptions","organizations_url":"https://api.github.com/users/joestein/orgs","repos_url":"https://api.github.com/users/joestein/repos","events_url":"https://api.github.com/users/joestein/events{/privacy}","received_events_url":"https://api.github.com/users/joestein/received_events","type":"User","site_admin":false},"body":"this should be another interface so that folks can do their own thing or use what we have packaged for them ya?","created_at":"2015-10-17T16:25:52Z","updated_at":"2015-10-17T16:25:52Z","html_url":"https://github.com/stealthly/go_kafka_client/pull/164#discussion_r42310985","pull_request_url":"https://api.github.com/repos/stealthly/go_kafka_client/pulls/164","_links":{"self":{"href":"https://api.github.com/repos/stealthly/go_kafka_client/pulls/comments/42310985"},"html":{"href":"https://github.com/stealthly/go_kafka_client/pull/164#discussion_r42310985"},"pull_request":{"href":"https://api.github.com/repos/stealthly/go_kafka_client/pulls/164"}}},"pull_request":{"url":"https://api.github.com/repos/stealthly/go_kafka_client/pulls/164","id":45795370,"html_url":"https://github.com/stealthly/go_kafka_client/pull/164","diff_url":"https://github.com/stealthly/go_kafka_client/pull/164.diff","patch_url":"https://github.com/stealthly/go_kafka_client/pull/164.patch","issue_url":"https://api.github.com/repos/stealthly/go_kafka_client/issues/164","number":164,"state":"open","locked":false,"title":"Consumer task","user":{"login":"yanzay","id":827984,"avatar_url":"https://avatars.githubusercontent.com/u/827984?v=3","gravatar_id":"","url":"https://api.github.com/users/yanzay","html_url":"https://github.com/yanzay","followers_url":"https://api.github.com/users/yanzay/followers","following_url":"https://api.github.com/users/yanzay/following{/other_user}","gists_url":"https://api.github.com/users/yanzay/gists{/gist_id}","starred_url":"https://api.github.com/users/yanzay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yanzay/subscriptions","organizations_url":"https://api.github.com/users/yanzay/orgs","repos_url":"https://api.github.com/users/yanzay/repos","events_url":"https://api.github.com/users/yanzay/events{/privacy}","received_events_url":"https://api.github.com/users/yanzay/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-23T15:42:16Z","updated_at":"2015-10-17T16:25:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa510f1eee46e99fe3d74d077780fe678ad6e260","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/stealthly/go_kafka_client/pulls/164/commits","review_comments_url":"https://api.github.com/repos/stealthly/go_kafka_client/pulls/164/comments","review_comment_url":"https://api.github.com/repos/stealthly/go_kafka_client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stealthly/go_kafka_client/issues/164/comments","statuses_url":"https://api.github.com/repos/stealthly/go_kafka_client/statuses/a3beb7646e867c9d430102d84062aa1528fe51d5","head":{"label":"stealthly:consumer-task","ref":"consumer-task","sha":"a3beb7646e867c9d430102d84062aa1528fe51d5","user":{"login":"stealthly","id":4544083,"avatar_url":"https://avatars.githubusercontent.com/u/4544083?v=3","gravatar_id":"","url":"https://api.github.com/users/stealthly","html_url":"https://github.com/stealthly","followers_url":"https://api.github.com/users/stealthly/followers","following_url":"https://api.github.com/users/stealthly/following{/other_user}","gists_url":"https://api.github.com/users/stealthly/gists{/gist_id}","starred_url":"https://api.github.com/users/stealthly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stealthly/subscriptions","organizations_url":"https://api.github.com/users/stealthly/orgs","repos_url":"https://api.github.com/users/stealthly/repos","events_url":"https://api.github.com/users/stealthly/events{/privacy}","received_events_url":"https://api.github.com/users/stealthly/received_events","type":"Organization","site_admin":false},"repo":{"id":25826611,"name":"go_kafka_client","full_name":"stealthly/go_kafka_client","owner":{"login":"stealthly","id":4544083,"avatar_url":"https://avatars.githubusercontent.com/u/4544083?v=3","gravatar_id":"","url":"https://api.github.com/users/stealthly","html_url":"https://github.com/stealthly","followers_url":"https://api.github.com/users/stealthly/followers","following_url":"https://api.github.com/users/stealthly/following{/other_user}","gists_url":"https://api.github.com/users/stealthly/gists{/gist_id}","starred_url":"https://api.github.com/users/stealthly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stealthly/subscriptions","organizations_url":"https://api.github.com/users/stealthly/orgs","repos_url":"https://api.github.com/users/stealthly/repos","events_url":"https://api.github.com/users/stealthly/events{/privacy}","received_events_url":"https://api.github.com/users/stealthly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stealthly/go_kafka_client","description":"Apache Kafka Client Library for Go","fork":false,"url":"https://api.github.com/repos/stealthly/go_kafka_client","forks_url":"https://api.github.com/repos/stealthly/go_kafka_client/forks","keys_url":"https://api.github.com/repos/stealthly/go_kafka_client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stealthly/go_kafka_client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stealthly/go_kafka_client/teams","hooks_url":"https://api.github.com/repos/stealthly/go_kafka_client/hooks","issue_events_url":"https://api.github.com/repos/stealthly/go_kafka_client/issues/events{/number}","events_url":"https://api.github.com/repos/stealthly/go_kafka_client/events","assignees_url":"https://api.github.com/repos/stealthly/go_kafka_client/assignees{/user}","branches_url":"https://api.github.com/repos/stealthly/go_kafka_client/branches{/branch}","tags_url":"https://api.github.com/repos/stealthly/go_kafka_client/tags","blobs_url":"https://api.github.com/repos/stealthly/go_kafka_client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stealthly/go_kafka_client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stealthly/go_kafka_client/git/refs{/sha}","trees_url":"https://api.github.com/repos/stealthly/go_kafka_client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stealthly/go_kafka_client/statuses/{sha}","languages_url":"https://api.github.com/repos/stealthly/go_kafka_client/languages","stargazers_url":"https://api.github.com/repos/stealthly/go_kafka_client/stargazers","contributors_url":"https://api.github.com/repos/stealthly/go_kafka_client/contributors","subscribers_url":"https://api.github.com/repos/stealthly/go_kafka_client/subscribers","subscription_url":"https://api.github.com/repos/stealthly/go_kafka_client/subscription","commits_url":"https://api.github.com/repos/stealthly/go_kafka_client/commits{/sha}","git_commits_url":"https://api.github.com/repos/stealthly/go_kafka_client/git/commits{/sha}","comments_url":"https://api.github.com/repos/stealthly/go_kafka_client/comments{/number}","issue_comment_url":"https://api.github.com/repos/stealthly/go_kafka_client/issues/comments{/number}","contents_url":"https://api.github.com/repos/stealthly/go_kafka_client/contents/{+path}","compare_url":"https://api.github.com/repos/stealthly/go_kafka_client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stealthly/go_kafka_client/merges","archive_url":"https://api.github.com/repos/stealthly/go_kafka_client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stealthly/go_kafka_client/downloads","issues_url":"https://api.github.com/repos/stealthly/go_kafka_client/issues{/number}","pulls_url":"https://api.github.com/repos/stealthly/go_kafka_client/pulls{/number}","milestones_url":"https://api.github.com/repos/stealthly/go_kafka_client/milestones{/number}","notifications_url":"https://api.github.com/repos/stealthly/go_kafka_client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stealthly/go_kafka_client/labels{/name}","releases_url":"https://api.github.com/repos/stealthly/go_kafka_client/releases{/id}","created_at":"2014-10-27T15:50:18Z","updated_at":"2015-10-14T11:52:48Z","pushed_at":"2015-10-16T16:29:46Z","git_url":"git://github.com/stealthly/go_kafka_client.git","ssh_url":"git@github.com:stealthly/go_kafka_client.git","clone_url":"https://github.com/stealthly/go_kafka_client.git","svn_url":"https://github.com/stealthly/go_kafka_client","homepage":"http://www.stealth.ly","size":4372,"stargazers_count":133,"watchers_count":133,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":22,"forks":32,"open_issues":22,"watchers":133,"default_branch":"master"}},"base":{"label":"stealthly:mesos-framework","ref":"mesos-framework","sha":"9acf64dc2f6bc35dda7fe93f902c0cb083c450df","user":{"login":"stealthly","id":4544083,"avatar_url":"https://avatars.githubusercontent.com/u/4544083?v=3","gravatar_id":"","url":"https://api.github.com/users/stealthly","html_url":"https://github.com/stealthly","followers_url":"https://api.github.com/users/stealthly/followers","following_url":"https://api.github.com/users/stealthly/following{/other_user}","gists_url":"https://api.github.com/users/stealthly/gists{/gist_id}","starred_url":"https://api.github.com/users/stealthly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stealthly/subscriptions","organizations_url":"https://api.github.com/users/stealthly/orgs","repos_url":"https://api.github.com/users/stealthly/repos","events_url":"https://api.github.com/users/stealthly/events{/privacy}","received_events_url":"https://api.github.com/users/stealthly/received_events","type":"Organization","site_admin":false},"repo":{"id":25826611,"name":"go_kafka_client","full_name":"stealthly/go_kafka_client","owner":{"login":"stealthly","id":4544083,"avatar_url":"https://avatars.githubusercontent.com/u/4544083?v=3","gravatar_id":"","url":"https://api.github.com/users/stealthly","html_url":"https://github.com/stealthly","followers_url":"https://api.github.com/users/stealthly/followers","following_url":"https://api.github.com/users/stealthly/following{/other_user}","gists_url":"https://api.github.com/users/stealthly/gists{/gist_id}","starred_url":"https://api.github.com/users/stealthly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stealthly/subscriptions","organizations_url":"https://api.github.com/users/stealthly/orgs","repos_url":"https://api.github.com/users/stealthly/repos","events_url":"https://api.github.com/users/stealthly/events{/privacy}","received_events_url":"https://api.github.com/users/stealthly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stealthly/go_kafka_client","description":"Apache Kafka Client Library for Go","fork":false,"url":"https://api.github.com/repos/stealthly/go_kafka_client","forks_url":"https://api.github.com/repos/stealthly/go_kafka_client/forks","keys_url":"https://api.github.com/repos/stealthly/go_kafka_client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stealthly/go_kafka_client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stealthly/go_kafka_client/teams","hooks_url":"https://api.github.com/repos/stealthly/go_kafka_client/hooks","issue_events_url":"https://api.github.com/repos/stealthly/go_kafka_client/issues/events{/number}","events_url":"https://api.github.com/repos/stealthly/go_kafka_client/events","assignees_url":"https://api.github.com/repos/stealthly/go_kafka_client/assignees{/user}","branches_url":"https://api.github.com/repos/stealthly/go_kafka_client/branches{/branch}","tags_url":"https://api.github.com/repos/stealthly/go_kafka_client/tags","blobs_url":"https://api.github.com/repos/stealthly/go_kafka_client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stealthly/go_kafka_client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stealthly/go_kafka_client/git/refs{/sha}","trees_url":"https://api.github.com/repos/stealthly/go_kafka_client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stealthly/go_kafka_client/statuses/{sha}","languages_url":"https://api.github.com/repos/stealthly/go_kafka_client/languages","stargazers_url":"https://api.github.com/repos/stealthly/go_kafka_client/stargazers","contributors_url":"https://api.github.com/repos/stealthly/go_kafka_client/contributors","subscribers_url":"https://api.github.com/repos/stealthly/go_kafka_client/subscribers","subscription_url":"https://api.github.com/repos/stealthly/go_kafka_client/subscription","commits_url":"https://api.github.com/repos/stealthly/go_kafka_client/commits{/sha}","git_commits_url":"https://api.github.com/repos/stealthly/go_kafka_client/git/commits{/sha}","comments_url":"https://api.github.com/repos/stealthly/go_kafka_client/comments{/number}","issue_comment_url":"https://api.github.com/repos/stealthly/go_kafka_client/issues/comments{/number}","contents_url":"https://api.github.com/repos/stealthly/go_kafka_client/contents/{+path}","compare_url":"https://api.github.com/repos/stealthly/go_kafka_client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stealthly/go_kafka_client/merges","archive_url":"https://api.github.com/repos/stealthly/go_kafka_client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stealthly/go_kafka_client/downloads","issues_url":"https://api.github.com/repos/stealthly/go_kafka_client/issues{/number}","pulls_url":"https://api.github.com/repos/stealthly/go_kafka_client/pulls{/number}","milestones_url":"https://api.github.com/repos/stealthly/go_kafka_client/milestones{/number}","notifications_url":"https://api.github.com/repos/stealthly/go_kafka_client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stealthly/go_kafka_client/labels{/name}","releases_url":"https://api.github.com/repos/stealthly/go_kafka_client/releases{/id}","created_at":"2014-10-27T15:50:18Z","updated_at":"2015-10-14T11:52:48Z","pushed_at":"2015-10-16T16:29:46Z","git_url":"git://github.com/stealthly/go_kafka_client.git","ssh_url":"git@github.com:stealthly/go_kafka_client.git","clone_url":"https://github.com/stealthly/go_kafka_client.git","svn_url":"https://github.com/stealthly/go_kafka_client","homepage":"http://www.stealth.ly","size":4372,"stargazers_count":133,"watchers_count":133,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":22,"forks":32,"open_issues":22,"watchers":133,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stealthly/go_kafka_client/pulls/164"},"html":{"href":"https://github.com/stealthly/go_kafka_client/pull/164"},"issue":{"href":"https://api.github.com/repos/stealthly/go_kafka_client/issues/164"},"comments":{"href":"https://api.github.com/repos/stealthly/go_kafka_client/issues/164/comments"},"review_comments":{"href":"https://api.github.com/repos/stealthly/go_kafka_client/pulls/164/comments"},"review_comment":{"href":"https://api.github.com/repos/stealthly/go_kafka_client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stealthly/go_kafka_client/pulls/164/commits"},"statuses":{"href":"https://api.github.com/repos/stealthly/go_kafka_client/statuses/a3beb7646e867c9d430102d84062aa1528fe51d5"}}}}