{"action":"created","comment":{"url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/comments/77745157","id":77745157,"diff_hunk":"@@ -0,0 +1,46 @@\n+package org.apache.mesos.specification;\n+\n+import java.util.List;\n+\n+/**\n+ * This class is a default implementation of the ServiceSpecification interface.\n+ */\n+public class DefaultServiceSpecification implements ServiceSpecification {\n+    private final String name;\n+    private final List<TaskTypeSpecification> taskTypeSpecifications;\n+\n+    public DefaultServiceSpecification(String name, List<TaskTypeSpecification> taskTypeSpecifications) {\n+        this.name = name;\n+        this.taskTypeSpecifications = taskTypeSpecifications;\n+    }\n+\n+    @Override\n+    public String getName() {\n+        return name;\n+    }\n+\n+    @Override\n+    public List<TaskTypeSpecification> getTaskSpecifications() {\n+        return taskTypeSpecifications;\n+    }\n+\n+    @Override\n+    @SuppressWarnings(\"PMD.IfStmtsMustUseBraces\")\n+    public boolean equals(Object o) {\n+        if (this == o) return true;\n+        if (o == null || getClass() != o.getClass()) return false;\n+\n+        DefaultServiceSpecification that = (DefaultServiceSpecification) o;\n+\n+        if (!name.equals(that.name)) return false;\n+        return taskTypeSpecifications.equals(that.taskTypeSpecifications);\n+\n+    }\n+\n+    @Override","path":"src/main/java/org/apache/mesos/specification/DefaultServiceSpecification.java","position":40,"original_position":40,"commit_id":"e42d180acdbfe3951e834123bfa24594f529a248","original_commit_id":"e42d180acdbfe3951e834123bfa24594f529a248","user":{"login":"gabrielhartmann","id":567111,"avatar_url":"https://avatars.githubusercontent.com/u/567111?v=3","gravatar_id":"","url":"https://api.github.com/users/gabrielhartmann","html_url":"https://github.com/gabrielhartmann","followers_url":"https://api.github.com/users/gabrielhartmann/followers","following_url":"https://api.github.com/users/gabrielhartmann/following{/other_user}","gists_url":"https://api.github.com/users/gabrielhartmann/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielhartmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielhartmann/subscriptions","organizations_url":"https://api.github.com/users/gabrielhartmann/orgs","repos_url":"https://api.github.com/users/gabrielhartmann/repos","events_url":"https://api.github.com/users/gabrielhartmann/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielhartmann/received_events","type":"User","site_admin":false},"body":"Spoke away from keyboard.","created_at":"2016-09-07T00:53:01Z","updated_at":"2016-09-07T00:53:01Z","html_url":"https://github.com/mesosphere/dcos-commons/pull/104#discussion_r77745157","pull_request_url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/104","_links":{"self":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/comments/77745157"},"html":{"href":"https://github.com/mesosphere/dcos-commons/pull/104#discussion_r77745157"},"pull_request":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/104"}}},"pull_request":{"url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/104","id":83187934,"html_url":"https://github.com/mesosphere/dcos-commons/pull/104","diff_url":"https://github.com/mesosphere/dcos-commons/pull/104.diff","patch_url":"https://github.com/mesosphere/dcos-commons/pull/104.patch","issue_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues/104","number":104,"state":"open","locked":false,"title":"DefaultScheduler","user":{"login":"gabrielhartmann","id":567111,"avatar_url":"https://avatars.githubusercontent.com/u/567111?v=3","gravatar_id":"","url":"https://api.github.com/users/gabrielhartmann","html_url":"https://github.com/gabrielhartmann","followers_url":"https://api.github.com/users/gabrielhartmann/followers","following_url":"https://api.github.com/users/gabrielhartmann/following{/other_user}","gists_url":"https://api.github.com/users/gabrielhartmann/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielhartmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielhartmann/subscriptions","organizations_url":"https://api.github.com/users/gabrielhartmann/orgs","repos_url":"https://api.github.com/users/gabrielhartmann/repos","events_url":"https://api.github.com/users/gabrielhartmann/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielhartmann/received_events","type":"User","site_admin":false},"body":"The private repository here: https://github.com/mesosphere/sdk-reference-framework, consumes the changes made here and works as described below.  This PR changes code coverage from 79.4% to 78.3%.  https://github.com/mesosphere/dcos-commons/pull/109 pays this debt.\r\n\r\nUse https://github.com/mesosphere/dcos-commons/pull/104/files?w=0 to view non-whitespace changes.  \r\n\r\n# Goal:\r\nProvide a general implementation of a Scheduler which can deploy, scale, update, and recover Tasks.  One should be able to specify that they would like to deploy a service with 2 Tasks of type Foo, 3 of type Bar.  Then one should be able to change this specification later and have the appropriate scaling (up) operation complete.  So if the `ServiceSpecification` is later changed to indicate that 3 Task of type Foo are desired, then an additional Foo Task should be launched.\r\n\r\nIf the specification of a Task type changes, then a rolling configuration update should occur to meet this new service specification.  e.g. If Foo Tasks used to consume 1.0 CPU, but now should consume 2.0 CPU, then a rolling restart of all Foo Tasks should occur to meet this requirement.  \r\n\r\nFinally, crashed Tasks should be restarted or replaced depending on how long a Task has not been running.  This is the generalized normal behavior of `dcos-kafka-service`, `dcos-cassandra-service`, and `dcos-hdfs-service` today.\r\n\r\nThe overall flow of control is as follows.  A user should provide a `ServiceSpecification` which should be provided to the DefaultScheduler which should do the rest of the work.  Given a `ServiceSpecification` a `PlanSpecification` should be generated to deploy the Service.  The `PlanSpecification` is then further instantiated into an actual implementation of the `Plan` interface.  This can then be executed using the normal `PlanManager` and `PlanScheduler` interfaces.\r\n\r\n# Broad categorization of changes:\r\n* DefaultScheduler with attendant (`ServiceSpecification`, `TaskSpecification`, `ResourceSpecification`, `PlanSpecification`, `PhaseSpecification`, `BlockSpecification`)\r\n* Change of ConfigStore and StateStore interfaces to return Optional objects.\r\n* Rename Stage to Plan\r\n\r\n# Notable omissions (because it's already 3000+ lines):\r\n* Handling of Persistent volumes is not yet covered by the DefaultScheduler.  This work should entail a minor extension of the ResourceSpecification interface.\r\n* A web server for serving the API endpoints\r\n* Scaling down of TaskTypes\r\n* Configuration management","created_at":"2016-08-29T23:58:10Z","updated_at":"2016-09-07T00:53:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"964aa872126127607007a7fcb2c1e6f4d7acd455","assignee":{"login":"nickbp","id":35933,"avatar_url":"https://avatars.githubusercontent.com/u/35933?v=3","gravatar_id":"","url":"https://api.github.com/users/nickbp","html_url":"https://github.com/nickbp","followers_url":"https://api.github.com/users/nickbp/followers","following_url":"https://api.github.com/users/nickbp/following{/other_user}","gists_url":"https://api.github.com/users/nickbp/gists{/gist_id}","starred_url":"https://api.github.com/users/nickbp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickbp/subscriptions","organizations_url":"https://api.github.com/users/nickbp/orgs","repos_url":"https://api.github.com/users/nickbp/repos","events_url":"https://api.github.com/users/nickbp/events{/privacy}","received_events_url":"https://api.github.com/users/nickbp/received_events","type":"User","site_admin":false},"assignees":[{"login":"nickbp","id":35933,"avatar_url":"https://avatars.githubusercontent.com/u/35933?v=3","gravatar_id":"","url":"https://api.github.com/users/nickbp","html_url":"https://github.com/nickbp","followers_url":"https://api.github.com/users/nickbp/followers","following_url":"https://api.github.com/users/nickbp/following{/other_user}","gists_url":"https://api.github.com/users/nickbp/gists{/gist_id}","starred_url":"https://api.github.com/users/nickbp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickbp/subscriptions","organizations_url":"https://api.github.com/users/nickbp/orgs","repos_url":"https://api.github.com/users/nickbp/repos","events_url":"https://api.github.com/users/nickbp/events{/privacy}","received_events_url":"https://api.github.com/users/nickbp/received_events","type":"User","site_admin":false},{"login":"triclambert","id":19239758,"avatar_url":"https://avatars.githubusercontent.com/u/19239758?v=3","gravatar_id":"","url":"https://api.github.com/users/triclambert","html_url":"https://github.com/triclambert","followers_url":"https://api.github.com/users/triclambert/followers","following_url":"https://api.github.com/users/triclambert/following{/other_user}","gists_url":"https://api.github.com/users/triclambert/gists{/gist_id}","starred_url":"https://api.github.com/users/triclambert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/triclambert/subscriptions","organizations_url":"https://api.github.com/users/triclambert/orgs","repos_url":"https://api.github.com/users/triclambert/repos","events_url":"https://api.github.com/users/triclambert/events{/privacy}","received_events_url":"https://api.github.com/users/triclambert/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/104/commits","review_comments_url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/104/comments","review_comment_url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues/104/comments","statuses_url":"https://api.github.com/repos/mesosphere/dcos-commons/statuses/e42d180acdbfe3951e834123bfa24594f529a248","head":{"label":"mesosphere:reference2","ref":"reference2","sha":"e42d180acdbfe3951e834123bfa24594f529a248","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":60286497,"name":"dcos-commons","full_name":"mesosphere/dcos-commons","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/dcos-commons","description":"","fork":false,"url":"https://api.github.com/repos/mesosphere/dcos-commons","forks_url":"https://api.github.com/repos/mesosphere/dcos-commons/forks","keys_url":"https://api.github.com/repos/mesosphere/dcos-commons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/dcos-commons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/dcos-commons/teams","hooks_url":"https://api.github.com/repos/mesosphere/dcos-commons/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/dcos-commons/events","assignees_url":"https://api.github.com/repos/mesosphere/dcos-commons/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/dcos-commons/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/dcos-commons/tags","blobs_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/dcos-commons/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/dcos-commons/languages","stargazers_url":"https://api.github.com/repos/mesosphere/dcos-commons/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/dcos-commons/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/dcos-commons/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/dcos-commons/subscription","commits_url":"https://api.github.com/repos/mesosphere/dcos-commons/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/dcos-commons/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/dcos-commons/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/dcos-commons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/dcos-commons/merges","archive_url":"https://api.github.com/repos/mesosphere/dcos-commons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/dcos-commons/downloads","issues_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/dcos-commons/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/dcos-commons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/dcos-commons/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/dcos-commons/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/dcos-commons/deployments","created_at":"2016-06-02T18:09:08Z","updated_at":"2016-08-29T13:59:53Z","pushed_at":"2016-09-06T23:51:10Z","git_url":"git://github.com/mesosphere/dcos-commons.git","ssh_url":"git@github.com:mesosphere/dcos-commons.git","clone_url":"https://github.com/mesosphere/dcos-commons.git","svn_url":"https://github.com/mesosphere/dcos-commons","homepage":null,"size":15590,"stargazers_count":18,"watchers_count":18,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":6,"forks":9,"open_issues":6,"watchers":18,"default_branch":"master"}},"base":{"label":"mesosphere:master","ref":"master","sha":"2caeff92899eb434cbd09b3f2d78c40269cb9f28","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":60286497,"name":"dcos-commons","full_name":"mesosphere/dcos-commons","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/dcos-commons","description":"","fork":false,"url":"https://api.github.com/repos/mesosphere/dcos-commons","forks_url":"https://api.github.com/repos/mesosphere/dcos-commons/forks","keys_url":"https://api.github.com/repos/mesosphere/dcos-commons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/dcos-commons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/dcos-commons/teams","hooks_url":"https://api.github.com/repos/mesosphere/dcos-commons/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/dcos-commons/events","assignees_url":"https://api.github.com/repos/mesosphere/dcos-commons/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/dcos-commons/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/dcos-commons/tags","blobs_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/dcos-commons/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/dcos-commons/languages","stargazers_url":"https://api.github.com/repos/mesosphere/dcos-commons/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/dcos-commons/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/dcos-commons/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/dcos-commons/subscription","commits_url":"https://api.github.com/repos/mesosphere/dcos-commons/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/dcos-commons/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/dcos-commons/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/dcos-commons/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/dcos-commons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/dcos-commons/merges","archive_url":"https://api.github.com/repos/mesosphere/dcos-commons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/dcos-commons/downloads","issues_url":"https://api.github.com/repos/mesosphere/dcos-commons/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/dcos-commons/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/dcos-commons/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/dcos-commons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/dcos-commons/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/dcos-commons/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/dcos-commons/deployments","created_at":"2016-06-02T18:09:08Z","updated_at":"2016-08-29T13:59:53Z","pushed_at":"2016-09-06T23:51:10Z","git_url":"git://github.com/mesosphere/dcos-commons.git","ssh_url":"git@github.com:mesosphere/dcos-commons.git","clone_url":"https://github.com/mesosphere/dcos-commons.git","svn_url":"https://github.com/mesosphere/dcos-commons","homepage":null,"size":15590,"stargazers_count":18,"watchers_count":18,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":6,"forks":9,"open_issues":6,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/104"},"html":{"href":"https://github.com/mesosphere/dcos-commons/pull/104"},"issue":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/issues/104"},"comments":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/issues/104/comments"},"review_comments":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/104/comments"},"review_comment":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/pulls/104/commits"},"statuses":{"href":"https://api.github.com/repos/mesosphere/dcos-commons/statuses/e42d180acdbfe3951e834123bfa24594f529a248"}}}}
{"actor":{"display_login":"gabrielhartmann"}}