GitHub PullRequestReviewCommentEvent at 2014-10-22 22:23:34
Repository: fluo
Actor: keith-turner
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/fluo-io/fluo/pulls/comments/19248755","id":19248755,"diff_hunk":"@@ -0,0 +1,93 @@\n+/*\n+ * Copyright 2014 Fluo authors (see AUTHORS)\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * 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 io.fluo.cluster;\n+\n+import java.io.File;\n+\n+import io.fluo.api.config.FluoConfiguration;\n+import org.apache.twill.api.ResourceSpecification;\n+import org.apache.twill.api.ResourceSpecification.SizeUnit;\n+import org.apache.twill.api.TwillApplication;\n+import org.apache.twill.api.TwillSpecification;\n+import org.apache.twill.api.TwillSpecification.Builder.MoreFile;\n+import org.apache.twill.api.TwillSpecification.Builder.MoreRunnable;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+/**\n+ * Represents Fluo oracle application in Twill\n+ */\n+public class FluoTwillApp implements TwillApplication {\n+  \n+  public static final String FLUO_APP_NAME = \"Fluo\";\n+  \n+  private static final Logger log = LoggerFactory.getLogger(FluoTwillApp.class);\n+  \n+  private final FluoConfiguration config;\n+  private final String fluoConf;\n+  \n+  public FluoTwillApp(FluoConfiguration config, String flouConf) {\n+    this.config = config;\n+    this.fluoConf = flouConf;\n+  }\n+  \n+  private MoreFile addConfigFiles(MoreFile moreFile) {\n+    File confDir = new File(fluoConf);\n+    for (File f : confDir.listFiles()) {\n+      if (f.isFile() && (f.getName().equals(\"fluo.properties\") == false)) {\n+        log.trace(\"Adding config file - \" + f.getName());\n+        moreFile = moreFile.add(String.format(\"./conf/%s\", f.getName()), f);\n+      }\n+    }\n+    return moreFile;\n+  }\n+       \n+  @Override\n+  public TwillSpecification configure() {   \n+    \n+    log.info(\"Configuring a Fluo instance with \" + config.getOracleInstances() + \" Oracle instances and \" + config.getWorkerInstances() + \" Worker instances with following properties:\");\n+    log.info(\"Max memory per oracle = \" + config.getOracleMaxMemory() + \" MB\");\n+    log.info(\"Max memory per worker = \" + config.getWorkerMaxMemory() + \" MB\");\n+    \n+    // Start building Fluo Twill application\n+    MoreRunnable moreRunnable = TwillSpecification.Builder.with() \n+        .setName(FLUO_APP_NAME).withRunnable();\n+    \n+    // Configure Oracle \n+    ResourceSpecification oracleResources = ResourceSpecification.Builder.with()\n+        .setVirtualCores(1)\n+        .setMemory(config.getOracleMaxMemory(), SizeUnit.MEGA)\n+        .setInstances(config.getOracleInstances()).build();\n+    \n+    MoreFile moreFile = moreRunnable.add(OracleRunnable.ORACLE_NAME, new OracleRunnable(), oracleResources)\n+        .withLocalFiles().add(\"./conf/fluo.properties\", new File(String.format(\"%s/fluo.properties\", fluoConf)));","path":"modules/cluster/src/main/java/io/fluo/cluster/FluoTwillApp.java","position":76,"original_position":76,"commit_id":"c4d766f55ef15d38a2320206856b56cf56adea78","original_commit_id":"c4d766f55ef15d38a2320206856b56cf56adea78","user":{"login":"keith-turner","id":1268739,"avatar_url":"https://avatars.githubusercontent.com/u/1268739?v=2","gravatar_id":"","url":"https://api.github.com/users/keith-turner","html_url":"https://github.com/keith-turner","followers_url":"https://api.github.com/users/keith-turner/followers","following_url":"https://api.github.com/users/keith-turner/following{/other_user}","gists_url":"https://api.github.com/users/keith-turner/gists{/gist_id}","starred_url":"https://api.github.com/users/keith-turner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keith-turner/subscriptions","organizations_url":"https://api.github.com/users/keith-turner/orgs","repos_url":"https://api.github.com/users/keith-turner/repos","events_url":"https://api.github.com/users/keith-turner/events{/privacy}","received_events_url":"https://api.github.com/users/keith-turner/received_events","type":"User","site_admin":false},"body":"why not have addConfigFile method add fluo.props?","created_at":"2014-10-22T22:23:34Z","updated_at":"2014-10-22T22:23:34Z","html_url":"https://github.com/fluo-io/fluo/pull/292#discussion_r19248755","pull_request_url":"https://api.github.com/repos/fluo-io/fluo/pulls/292","_links":{"self":{"href":"https://api.github.com/repos/fluo-io/fluo/pulls/comments/19248755"},"html":{"href":"https://github.com/fluo-io/fluo/pull/292#discussion_r19248755"},"pull_request":{"href":"https://api.github.com/repos/fluo-io/fluo/pulls/292"}}},"pull_request":{"url":"https://api.github.com/repos/fluo-io/fluo/pulls/292","id":23191433,"html_url":"https://github.com/fluo-io/fluo/pull/292","diff_url":"https://github.com/fluo-io/fluo/pull/292.diff","patch_url":"https://github.com/fluo-io/fluo/pull/292.patch","issue_url":"https://api.github.com/repos/fluo-io/fluo/issues/292","number":292,"state":"open","locked":false,"title":"Closes #246 #284 #285 #288 #289 #291 - Improved Fluo cluster management.","user":{"login":"mikewalch","id":730698,"avatar_url":"https://avatars.githubusercontent.com/u/730698?v=2","gravatar_id":"","url":"https://api.github.com/users/mikewalch","html_url":"https://github.com/mikewalch","followers_url":"https://api.github.com/users/mikewalch/followers","following_url":"https://api.github.com/users/mikewalch/following{/other_user}","gists_url":"https://api.github.com/users/mikewalch/gists{/gist_id}","starred_url":"https://api.github.com/users/mikewalch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikewalch/subscriptions","organizations_url":"https://api.github.com/users/mikewalch/orgs","repos_url":"https://api.github.com/users/mikewalch/repos","events_url":"https://api.github.com/users/mikewalch/events{/privacy}","received_events_url":"https://api.github.com/users/mikewalch/received_events","type":"User","site_admin":false},"body":"Pull request for  #246 #284 #285 #288 #289 #291","created_at":"2014-10-22T21:31:48Z","updated_at":"2014-10-22T22:23:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c603b56fc3b7b7b4c9701e9f773856024719dfe7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fluo-io/fluo/pulls/292/commits","review_comments_url":"https://api.github.com/repos/fluo-io/fluo/pulls/292/comments","review_comment_url":"https://api.github.com/repos/fluo-io/fluo/pulls/comments/{number}","comments_url":"https://api.github.com/repos/fluo-io/fluo/issues/292/comments","statuses_url":"https://api.github.com/repos/fluo-io/fluo/statuses/c4d766f55ef15d38a2320206856b56cf56adea78","head":{"label":"mikewalch:fluo-246","ref":"fluo-246","sha":"c4d766f55ef15d38a2320206856b56cf56adea78","user":{"login":"mikewalch","id":730698,"avatar_url":"https://avatars.githubusercontent.com/u/730698?v=2","gravatar_id":"","url":"https://api.github.com/users/mikewalch","html_url":"https://github.com/mikewalch","followers_url":"https://api.github.com/users/mikewalch/followers","following_url":"https://api.github.com/users/mikewalch/following{/other_user}","gists_url":"https://api.github.com/users/mikewalch/gists{/gist_id}","starred_url":"https://api.github.com/users/mikewalch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikewalch/subscriptions","organizations_url":"https://api.github.com/users/mikewalch/orgs","repos_url":"https://api.github.com/users/mikewalch/repos","events_url":"https://api.github.com/users/mikewalch/events{/privacy}","received_events_url":"https://api.github.com/users/mikewalch/received_events","type":"User","site_admin":false},"repo":{"id":19742131,"name":"fluo","full_name":"mikewalch/fluo","owner":{"login":"mikewalch","id":730698,"avatar_url":"https://avatars.githubusercontent.com/u/730698?v=2","gravatar_id":"","url":"https://api.github.com/users/mikewalch","html_url":"https://github.com/mikewalch","followers_url":"https://api.github.com/users/mikewalch/followers","following_url":"https://api.github.com/users/mikewalch/following{/other_user}","gists_url":"https://api.github.com/users/mikewalch/gists{/gist_id}","starred_url":"https://api.github.com/users/mikewalch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikewalch/subscriptions","organizations_url":"https://api.github.com/users/mikewalch/orgs","repos_url":"https://api.github.com/users/mikewalch/repos","events_url":"https://api.github.com/users/mikewalch/events{/privacy}","received_events_url":"https://api.github.com/users/mikewalch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mikewalch/fluo","description":"","fork":true,"url":"https://api.github.com/repos/mikewalch/fluo","forks_url":"https://api.github.com/repos/mikewalch/fluo/forks","keys_url":"https://api.github.com/repos/mikewalch/fluo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikewalch/fluo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikewalch/fluo/teams","hooks_url":"https://api.github.com/repos/mikewalch/fluo/hooks","issue_events_url":"https://api.github.com/repos/mikewalch/fluo/issues/events{/number}","events_url":"https://api.github.com/repos/mikewalch/fluo/events","assignees_url":"https://api.github.com/repos/mikewalch/fluo/assignees{/user}","branches_url":"https://api.github.com/repos/mikewalch/fluo/branches{/branch}","tags_url":"https://api.github.com/repos/mikewalch/fluo/tags","blobs_url":"https://api.github.com/repos/mikewalch/fluo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikewalch/fluo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikewalch/fluo/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikewalch/fluo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikewalch/fluo/statuses/{sha}","languages_url":"https://api.github.com/repos/mikewalch/fluo/languages","stargazers_url":"https://api.github.com/repos/mikewalch/fluo/stargazers","contributors_url":"https://api.github.com/repos/mikewalch/fluo/contributors","subscribers_url":"https://api.github.com/repos/mikewalch/fluo/subscribers","subscription_url":"https://api.github.com/repos/mikewalch/fluo/subscription","commits_url":"https://api.github.com/repos/mikewalch/fluo/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikewalch/fluo/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikewalch/fluo/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikewalch/fluo/issues/comments/{number}","contents_url":"https://api.github.com/repos/mikewalch/fluo/contents/{+path}","compare_url":"https://api.github.com/repos/mikewalch/fluo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikewalch/fluo/merges","archive_url":"https://api.github.com/repos/mikewalch/fluo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikewalch/fluo/downloads","issues_url":"https://api.github.com/repos/mikewalch/fluo/issues{/number}","pulls_url":"https://api.github.com/repos/mikewalch/fluo/pulls{/number}","milestones_url":"https://api.github.com/repos/mikewalch/fluo/milestones{/number}","notifications_url":"https://api.github.com/repos/mikewalch/fluo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikewalch/fluo/labels{/name}","releases_url":"https://api.github.com/repos/mikewalch/fluo/releases{/id}","created_at":"2014-05-13T14:25:42Z","updated_at":"2014-07-16T22:12:50Z","pushed_at":"2014-10-22T21:29:22Z","git_url":"git://github.com/mikewalch/fluo.git","ssh_url":"git@github.com:mikewalch/fluo.git","clone_url":"https://github.com/mikewalch/fluo.git","svn_url":"https://github.com/mikewalch/fluo","homepage":null,"size":1707,"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":"fluo-io:master","ref":"master","sha":"6a3b62baf03cb3adaa0a3a4194a011187fd5caa5","user":{"login":"fluo-io","id":8184450,"avatar_url":"https://avatars.githubusercontent.com/u/8184450?v=2","gravatar_id":"","url":"https://api.github.com/users/fluo-io","html_url":"https://github.com/fluo-io","followers_url":"https://api.github.com/users/fluo-io/followers","following_url":"https://api.github.com/users/fluo-io/following{/other_user}","gists_url":"https://api.github.com/users/fluo-io/gists{/gist_id}","starred_url":"https://api.github.com/users/fluo-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fluo-io/subscriptions","organizations_url":"https://api.github.com/users/fluo-io/orgs","repos_url":"https://api.github.com/users/fluo-io/repos","events_url":"https://api.github.com/users/fluo-io/events{/privacy}","received_events_url":"https://api.github.com/users/fluo-io/received_events","type":"Organization","site_admin":false},"repo":{"id":10805187,"name":"fluo","full_name":"fluo-io/fluo","owner":{"login":"fluo-io","id":8184450,"avatar_url":"https://avatars.githubusercontent.com/u/8184450?v=2","gravatar_id":"","url":"https://api.github.com/users/fluo-io","html_url":"https://github.com/fluo-io","followers_url":"https://api.github.com/users/fluo-io/followers","following_url":"https://api.github.com/users/fluo-io/following{/other_user}","gists_url":"https://api.github.com/users/fluo-io/gists{/gist_id}","starred_url":"https://api.github.com/users/fluo-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fluo-io/subscriptions","organizations_url":"https://api.github.com/users/fluo-io/orgs","repos_url":"https://api.github.com/users/fluo-io/repos","events_url":"https://api.github.com/users/fluo-io/events{/privacy}","received_events_url":"https://api.github.com/users/fluo-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fluo-io/fluo","description":"Transaction layer that enables incremental processing on big data","fork":false,"url":"https://api.github.com/repos/fluo-io/fluo","forks_url":"https://api.github.com/repos/fluo-io/fluo/forks","keys_url":"https://api.github.com/repos/fluo-io/fluo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fluo-io/fluo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fluo-io/fluo/teams","hooks_url":"https://api.github.com/repos/fluo-io/fluo/hooks","issue_events_url":"https://api.github.com/repos/fluo-io/fluo/issues/events{/number}","events_url":"https://api.github.com/repos/fluo-io/fluo/events","assignees_url":"https://api.github.com/repos/fluo-io/fluo/assignees{/user}","branches_url":"https://api.github.com/repos/fluo-io/fluo/branches{/branch}","tags_url":"https://api.github.com/repos/fluo-io/fluo/tags","blobs_url":"https://api.github.com/repos/fluo-io/fluo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fluo-io/fluo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fluo-io/fluo/git/refs{/sha}","trees_url":"https://api.github.com/repos/fluo-io/fluo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fluo-io/fluo/statuses/{sha}","languages_url":"https://api.github.com/repos/fluo-io/fluo/languages","stargazers_url":"https://api.github.com/repos/fluo-io/fluo/stargazers","contributors_url":"https://api.github.com/repos/fluo-io/fluo/contributors","subscribers_url":"https://api.github.com/repos/fluo-io/fluo/subscribers","subscription_url":"https://api.github.com/repos/fluo-io/fluo/subscription","commits_url":"https://api.github.com/repos/fluo-io/fluo/commits{/sha}","git_commits_url":"https://api.github.com/repos/fluo-io/fluo/git/commits{/sha}","comments_url":"https://api.github.com/repos/fluo-io/fluo/comments{/number}","issue_comment_url":"https://api.github.com/repos/fluo-io/fluo/issues/comments/{number}","contents_url":"https://api.github.com/repos/fluo-io/fluo/contents/{+path}","compare_url":"https://api.github.com/repos/fluo-io/fluo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fluo-io/fluo/merges","archive_url":"https://api.github.com/repos/fluo-io/fluo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fluo-io/fluo/downloads","issues_url":"https://api.github.com/repos/fluo-io/fluo/issues{/number}","pulls_url":"https://api.github.com/repos/fluo-io/fluo/pulls{/number}","milestones_url":"https://api.github.com/repos/fluo-io/fluo/milestones{/number}","notifications_url":"https://api.github.com/repos/fluo-io/fluo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fluo-io/fluo/labels{/name}","releases_url":"https://api.github.com/repos/fluo-io/fluo/releases{/id}","created_at":"2013-06-19T20:14:05Z","updated_at":"2014-10-22T15:18:30Z","pushed_at":"2014-10-21T13:36:04Z","git_url":"git://github.com/fluo-io/fluo.git","ssh_url":"git@github.com:fluo-io/fluo.git","clone_url":"https://github.com/fluo-io/fluo.git","svn_url":"https://github.com/fluo-io/fluo","homepage":"http://fluo.io/","size":3588,"stargazers_count":16,"watchers_count":16,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":89,"forks":7,"open_issues":89,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fluo-io/fluo/pulls/292"},"html":{"href":"https://github.com/fluo-io/fluo/pull/292"},"issue":{"href":"https://api.github.com/repos/fluo-io/fluo/issues/292"},"comments":{"href":"https://api.github.com/repos/fluo-io/fluo/issues/292/comments"},"review_comments":{"href":"https://api.github.com/repos/fluo-io/fluo/pulls/292/comments"},"review_comment":{"href":"https://api.github.com/repos/fluo-io/fluo/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/fluo-io/fluo/pulls/292/commits"},"statuses":{"href":"https://api.github.com/repos/fluo-io/fluo/statuses/c4d766f55ef15d38a2320206856b56cf56adea78"}}}}