{"action":"created","comment":{"url":"https://api.github.com/repos/mesos/storm/pulls/comments/30945500","id":30945500,"diff_hunk":"@@ -105,54 +112,65 @@ public String getHostName(Map<String, SupervisorDetails> map, String nodeId) {\n   @Override\n   public void prepare(Map conf, String localDir) {\n     try {\n-      _conf = conf;\n+        initialize(conf,localDir);\n+\n+        MesosSchedulerDriver driver = createMesosDriver();\n+        \n+        driver.start();\n+    \n+        LOG.info(\"Waiting for scheduler driver to register MesosNimbus with mesos-master and complete initialization...\");\n+      \n+        _scheduler.waitUntilRegistered();\n+      \n+        LOG.info(\"Scheduler registration and initialization complete...\");\n+ \n+    } catch (Exception e) {\n+        LOG.error(\"Failed to prepare scheduler \", e);  \n+      throw new RuntimeException(e);\n+    }\n+  }\n+  @SuppressWarnings(\"unchecked\")\n+  protected void initialize(Map conf, String localDir) throws Exception {\n+      _conf  = conf;\n       _state = new LocalState(localDir);\n-      String id = (String) _state.get(FRAMEWORK_ID);\n-\n-      _allowedHosts = listIntoSet((List) _conf.get(CONF_MESOS_ALLOWED_HOSTS));\n-      _disallowedHosts = listIntoSet((List) _conf.get(CONF_MESOS_DISALLOWED_HOSTS));\n-\n+      _allowedHosts = listIntoSet((List<String>)conf.get(CONF_MESOS_ALLOWED_HOSTS));\n+      _disallowedHosts = listIntoSet((List<String>)conf.get(CONF_MESOS_DISALLOWED_HOSTS));\n       _scheduler = new NimbusScheduler();\n+      createLocalServerPort();\n+      setupHttpServer();\n+  }\n+  \n+  protected void createLocalServerPort() {\n+    Integer port = (Integer) _conf.get(CONF_MESOS_LOCAL_FILE_SERVER_PORT);\n+    LOG.debug(\"LocalFileServer configured to listen on port: \" + port);\n+    _localFileServerPort = Optional.fromNullable(port); \n+  }\n \n-      Number failoverTimeout = Optional.fromNullable((Number) conf.get(CONF_MASTER_FAILOVER_TIMEOUT_SECS)).or(3600);\n-      String role = Optional.fromNullable((String) conf.get(CONF_MESOS_ROLE)).or(\"*\");\n-      Boolean checkpoint = Optional.fromNullable((Boolean) conf.get(CONF_MESOS_CHECKPOINT)).or(false);\n-      String framework_name = Optional.fromNullable((String) conf.get(CONF_MESOS_FRAMEWORK_NAME)).or(\"Storm!!!\");\n-\n-      FrameworkInfo.Builder finfo = FrameworkInfo.newBuilder()\n-          .setName(framework_name)\n-          .setFailoverTimeout(failoverTimeout.doubleValue())\n-          .setUser(\"\")\n-          .setRole(role)\n-          .setCheckpoint(checkpoint);\n-\n-      if (id != null) {\n-        finfo.setId(FrameworkID.newBuilder().setValue(id).build());\n-      }\n-\n-      Integer port = (Integer) _conf.get(CONF_MESOS_LOCAL_FILE_SERVER_PORT);\n-      _localFileServerPort = Optional.fromNullable(port);\n-      LOG.debug(\"LocalFileServer configured to listen on port: \" + port);\n-\n+  protected void setupHttpServer() throws Exception {\n       _httpServer = new LocalFileServer();\n       _configUrl = _httpServer.serveDir(\"/conf\", \"conf\", _localFileServerPort);\n+      ","path":"src/storm/mesos/MesosNimbus.java","position":99,"original_position":99,"commit_id":"1de8018e1071511793701f901c159f44dc303173","original_commit_id":"1de8018e1071511793701f901c159f44dc303173","user":{"login":"brndnmtthws","id":3129093,"avatar_url":"https://avatars.githubusercontent.com/u/3129093?v=3","gravatar_id":"","url":"https://api.github.com/users/brndnmtthws","html_url":"https://github.com/brndnmtthws","followers_url":"https://api.github.com/users/brndnmtthws/followers","following_url":"https://api.github.com/users/brndnmtthws/following{/other_user}","gists_url":"https://api.github.com/users/brndnmtthws/gists{/gist_id}","starred_url":"https://api.github.com/users/brndnmtthws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brndnmtthws/subscriptions","organizations_url":"https://api.github.com/users/brndnmtthws/orgs","repos_url":"https://api.github.com/users/brndnmtthws/repos","events_url":"https://api.github.com/users/brndnmtthws/events{/privacy}","received_events_url":"https://api.github.com/users/brndnmtthws/received_events","type":"User","site_admin":false},"body":"Whitespace.","created_at":"2015-05-23T14:59:13Z","updated_at":"2015-05-23T14:59:13Z","html_url":"https://github.com/mesos/storm/pull/37#discussion_r30945500","pull_request_url":"https://api.github.com/repos/mesos/storm/pulls/37","_links":{"self":{"href":"https://api.github.com/repos/mesos/storm/pulls/comments/30945500"},"html":{"href":"https://github.com/mesos/storm/pull/37#discussion_r30945500"},"pull_request":{"href":"https://api.github.com/repos/mesos/storm/pulls/37"}}},"pull_request":{"url":"https://api.github.com/repos/mesos/storm/pulls/37","id":34478644,"html_url":"https://github.com/mesos/storm/pull/37","diff_url":"https://github.com/mesos/storm/pull/37.diff","patch_url":"https://github.com/mesos/storm/pull/37.patch","issue_url":"https://api.github.com/repos/mesos/storm/issues/37","number":37,"state":"open","locked":false,"title":"Mesos authentication","user":{"login":"pdread100","id":11570041,"avatar_url":"https://avatars.githubusercontent.com/u/11570041?v=3","gravatar_id":"","url":"https://api.github.com/users/pdread100","html_url":"https://github.com/pdread100","followers_url":"https://api.github.com/users/pdread100/followers","following_url":"https://api.github.com/users/pdread100/following{/other_user}","gists_url":"https://api.github.com/users/pdread100/gists{/gist_id}","starred_url":"https://api.github.com/users/pdread100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdread100/subscriptions","organizations_url":"https://api.github.com/users/pdread100/orgs","repos_url":"https://api.github.com/users/pdread100/repos","events_url":"https://api.github.com/users/pdread100/events{/privacy}","received_events_url":"https://api.github.com/users/pdread100/received_events","type":"User","site_admin":false},"body":"Coded and tested Mesos authentication to resolve issue [#35] (https://github.com/mesos/storm/issues/35)","created_at":"2015-04-30T16:44:40Z","updated_at":"2015-05-23T14:59:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad44b916ad0304c6bc0abaf60244f492d64fb9c2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mesos/storm/pulls/37/commits","review_comments_url":"https://api.github.com/repos/mesos/storm/pulls/37/comments","review_comment_url":"https://api.github.com/repos/mesos/storm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesos/storm/issues/37/comments","statuses_url":"https://api.github.com/repos/mesos/storm/statuses/1de8018e1071511793701f901c159f44dc303173","head":{"label":"pdread100:mesos-authentication","ref":"mesos-authentication","sha":"1de8018e1071511793701f901c159f44dc303173","user":{"login":"pdread100","id":11570041,"avatar_url":"https://avatars.githubusercontent.com/u/11570041?v=3","gravatar_id":"","url":"https://api.github.com/users/pdread100","html_url":"https://github.com/pdread100","followers_url":"https://api.github.com/users/pdread100/followers","following_url":"https://api.github.com/users/pdread100/following{/other_user}","gists_url":"https://api.github.com/users/pdread100/gists{/gist_id}","starred_url":"https://api.github.com/users/pdread100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdread100/subscriptions","organizations_url":"https://api.github.com/users/pdread100/orgs","repos_url":"https://api.github.com/users/pdread100/repos","events_url":"https://api.github.com/users/pdread100/events{/privacy}","received_events_url":"https://api.github.com/users/pdread100/received_events","type":"User","site_admin":false},"repo":{"id":34727526,"name":"storm","full_name":"pdread100/storm","owner":{"login":"pdread100","id":11570041,"avatar_url":"https://avatars.githubusercontent.com/u/11570041?v=3","gravatar_id":"","url":"https://api.github.com/users/pdread100","html_url":"https://github.com/pdread100","followers_url":"https://api.github.com/users/pdread100/followers","following_url":"https://api.github.com/users/pdread100/following{/other_user}","gists_url":"https://api.github.com/users/pdread100/gists{/gist_id}","starred_url":"https://api.github.com/users/pdread100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdread100/subscriptions","organizations_url":"https://api.github.com/users/pdread100/orgs","repos_url":"https://api.github.com/users/pdread100/repos","events_url":"https://api.github.com/users/pdread100/events{/privacy}","received_events_url":"https://api.github.com/users/pdread100/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pdread100/storm","description":"Storm on Mesos!","fork":true,"url":"https://api.github.com/repos/pdread100/storm","forks_url":"https://api.github.com/repos/pdread100/storm/forks","keys_url":"https://api.github.com/repos/pdread100/storm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pdread100/storm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pdread100/storm/teams","hooks_url":"https://api.github.com/repos/pdread100/storm/hooks","issue_events_url":"https://api.github.com/repos/pdread100/storm/issues/events{/number}","events_url":"https://api.github.com/repos/pdread100/storm/events","assignees_url":"https://api.github.com/repos/pdread100/storm/assignees{/user}","branches_url":"https://api.github.com/repos/pdread100/storm/branches{/branch}","tags_url":"https://api.github.com/repos/pdread100/storm/tags","blobs_url":"https://api.github.com/repos/pdread100/storm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pdread100/storm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pdread100/storm/git/refs{/sha}","trees_url":"https://api.github.com/repos/pdread100/storm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pdread100/storm/statuses/{sha}","languages_url":"https://api.github.com/repos/pdread100/storm/languages","stargazers_url":"https://api.github.com/repos/pdread100/storm/stargazers","contributors_url":"https://api.github.com/repos/pdread100/storm/contributors","subscribers_url":"https://api.github.com/repos/pdread100/storm/subscribers","subscription_url":"https://api.github.com/repos/pdread100/storm/subscription","commits_url":"https://api.github.com/repos/pdread100/storm/commits{/sha}","git_commits_url":"https://api.github.com/repos/pdread100/storm/git/commits{/sha}","comments_url":"https://api.github.com/repos/pdread100/storm/comments{/number}","issue_comment_url":"https://api.github.com/repos/pdread100/storm/issues/comments{/number}","contents_url":"https://api.github.com/repos/pdread100/storm/contents/{+path}","compare_url":"https://api.github.com/repos/pdread100/storm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pdread100/storm/merges","archive_url":"https://api.github.com/repos/pdread100/storm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pdread100/storm/downloads","issues_url":"https://api.github.com/repos/pdread100/storm/issues{/number}","pulls_url":"https://api.github.com/repos/pdread100/storm/pulls{/number}","milestones_url":"https://api.github.com/repos/pdread100/storm/milestones{/number}","notifications_url":"https://api.github.com/repos/pdread100/storm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pdread100/storm/labels{/name}","releases_url":"https://api.github.com/repos/pdread100/storm/releases{/id}","created_at":"2015-04-28T11:50:51Z","updated_at":"2015-05-06T10:40:28Z","pushed_at":"2015-05-19T17:30:55Z","git_url":"git://github.com/pdread100/storm.git","ssh_url":"git@github.com:pdread100/storm.git","clone_url":"https://github.com/pdread100/storm.git","svn_url":"https://github.com/pdread100/storm","homepage":null,"size":216,"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":"mesos:master","ref":"master","sha":"b87b9cd4492b77927118c810959b642c13d7cc64","user":{"login":"mesos","id":229272,"avatar_url":"https://avatars.githubusercontent.com/u/229272?v=3","gravatar_id":"","url":"https://api.github.com/users/mesos","html_url":"https://github.com/mesos","followers_url":"https://api.github.com/users/mesos/followers","following_url":"https://api.github.com/users/mesos/following{/other_user}","gists_url":"https://api.github.com/users/mesos/gists{/gist_id}","starred_url":"https://api.github.com/users/mesos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesos/subscriptions","organizations_url":"https://api.github.com/users/mesos/orgs","repos_url":"https://api.github.com/users/mesos/repos","events_url":"https://api.github.com/users/mesos/events{/privacy}","received_events_url":"https://api.github.com/users/mesos/received_events","type":"Organization","site_admin":false},"repo":{"id":21285858,"name":"storm","full_name":"mesos/storm","owner":{"login":"mesos","id":229272,"avatar_url":"https://avatars.githubusercontent.com/u/229272?v=3","gravatar_id":"","url":"https://api.github.com/users/mesos","html_url":"https://github.com/mesos","followers_url":"https://api.github.com/users/mesos/followers","following_url":"https://api.github.com/users/mesos/following{/other_user}","gists_url":"https://api.github.com/users/mesos/gists{/gist_id}","starred_url":"https://api.github.com/users/mesos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesos/subscriptions","organizations_url":"https://api.github.com/users/mesos/orgs","repos_url":"https://api.github.com/users/mesos/repos","events_url":"https://api.github.com/users/mesos/events{/privacy}","received_events_url":"https://api.github.com/users/mesos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesos/storm","description":"Storm on Mesos!","fork":false,"url":"https://api.github.com/repos/mesos/storm","forks_url":"https://api.github.com/repos/mesos/storm/forks","keys_url":"https://api.github.com/repos/mesos/storm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesos/storm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesos/storm/teams","hooks_url":"https://api.github.com/repos/mesos/storm/hooks","issue_events_url":"https://api.github.com/repos/mesos/storm/issues/events{/number}","events_url":"https://api.github.com/repos/mesos/storm/events","assignees_url":"https://api.github.com/repos/mesos/storm/assignees{/user}","branches_url":"https://api.github.com/repos/mesos/storm/branches{/branch}","tags_url":"https://api.github.com/repos/mesos/storm/tags","blobs_url":"https://api.github.com/repos/mesos/storm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesos/storm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesos/storm/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesos/storm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesos/storm/statuses/{sha}","languages_url":"https://api.github.com/repos/mesos/storm/languages","stargazers_url":"https://api.github.com/repos/mesos/storm/stargazers","contributors_url":"https://api.github.com/repos/mesos/storm/contributors","subscribers_url":"https://api.github.com/repos/mesos/storm/subscribers","subscription_url":"https://api.github.com/repos/mesos/storm/subscription","commits_url":"https://api.github.com/repos/mesos/storm/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesos/storm/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesos/storm/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesos/storm/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesos/storm/contents/{+path}","compare_url":"https://api.github.com/repos/mesos/storm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesos/storm/merges","archive_url":"https://api.github.com/repos/mesos/storm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesos/storm/downloads","issues_url":"https://api.github.com/repos/mesos/storm/issues{/number}","pulls_url":"https://api.github.com/repos/mesos/storm/pulls{/number}","milestones_url":"https://api.github.com/repos/mesos/storm/milestones{/number}","notifications_url":"https://api.github.com/repos/mesos/storm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesos/storm/labels{/name}","releases_url":"https://api.github.com/repos/mesos/storm/releases{/id}","created_at":"2014-06-27T18:51:37Z","updated_at":"2015-05-19T18:49:45Z","pushed_at":"2015-05-19T17:42:46Z","git_url":"git://github.com/mesos/storm.git","ssh_url":"git@github.com:mesos/storm.git","clone_url":"https://github.com/mesos/storm.git","svn_url":"https://github.com/mesos/storm","homepage":null,"size":623,"stargazers_count":55,"watchers_count":55,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":13,"forks":26,"open_issues":13,"watchers":55,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesos/storm/pulls/37"},"html":{"href":"https://github.com/mesos/storm/pull/37"},"issue":{"href":"https://api.github.com/repos/mesos/storm/issues/37"},"comments":{"href":"https://api.github.com/repos/mesos/storm/issues/37/comments"},"review_comments":{"href":"https://api.github.com/repos/mesos/storm/pulls/37/comments"},"review_comment":{"href":"https://api.github.com/repos/mesos/storm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesos/storm/pulls/37/commits"},"statuses":{"href":"https://api.github.com/repos/mesos/storm/statuses/1de8018e1071511793701f901c159f44dc303173"}}}}