{"action":"created","comment":{"url":"https://api.github.com/repos/AppScale/appscale/pulls/comments/23665157","id":23665157,"diff_hunk":"@@ -0,0 +1,119 @@\n+#!/usr/bin/ruby -w\n+\n+\n+# First-party Ruby libraries\n+require 'timeout'\n+\n+\n+# Imports for AppController libraries\n+$:.unshift File.join(File.dirname(__FILE__))\n+require 'djinn_job_data'\n+require 'helperfunctions'\n+require 'monit_interface'\n+\n+\n+# To implement support for the Google App Engine Search, we use\n+# the open source SOLR. This module provides\n+# methods that automatically configure and deploy SOLR.\n+module Search\n+\n+  # AppScale install directory.\n+  APPSCALE_HOME = ENV[\"APPSCALE_HOME\"]\n+\n+  # The port that SOLR server runs on, by default.\n+  SOLR_SERVER_PORT = 8983\n+ \n+  # The port where the TaskQueue server runs on, by default. \n+  SEARCH_SERVER_PORT = 53423\n+\n+  # The python executable path.\n+  PYTHON_EXEC = \"python\"\n+\n+  # Stop command for search server.\n+  SEARCH_STOP_CMD = \"/bin/kill -9 `ps aux | grep search_server.py | awk {'print $2'}`\"\n+\n+  # Search location file.\n+  SEARCH_LOCATION_FILE = \"/etc/appscale/search_ip\"\n+\n+  # SOLR persistent state location.\n+  SOLR_STATE_DIR = \"/opt/appscale/solr/data\"\n+\n+  # Starts a service that we refer to as a \"search_master\".\n+  #\n+  # Args:\n+  #   clear_data: A boolean that indicates whether or not SOLR state should\n+  #     be erased before starting SOLR.\n+  def self.start_master(clear_data)\n+    Djinn.log_info(\"Starting Search Master.\")\n+\n+    if clear_data\n+      self.erase_local_files()\n+    else\n+      Djinn.log_debug(\"Resuming from previous SOLR state if it exists.\")\n+    end\n+\n+    # First, start up SOLR.\n+    start_solr()\n+    # Start up the search server which handles API calls from applications.\n+    start_search_server()\n+  end\n+\n+  # Start up SOLR.","path":"AppController/lib/search.rb","position":61,"original_position":61,"commit_id":"f4d489eb09e26c801c7c2ddc488be0be480f2f08","original_commit_id":"f4d489eb09e26c801c7c2ddc488be0be480f2f08","user":{"login":"menivaitsi","id":6760257,"avatar_url":"https://avatars.githubusercontent.com/u/6760257?v=3","gravatar_id":"","url":"https://api.github.com/users/menivaitsi","html_url":"https://github.com/menivaitsi","followers_url":"https://api.github.com/users/menivaitsi/followers","following_url":"https://api.github.com/users/menivaitsi/following{/other_user}","gists_url":"https://api.github.com/users/menivaitsi/gists{/gist_id}","starred_url":"https://api.github.com/users/menivaitsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/menivaitsi/subscriptions","organizations_url":"https://api.github.com/users/menivaitsi/orgs","repos_url":"https://api.github.com/users/menivaitsi/repos","events_url":"https://api.github.com/users/menivaitsi/events{/privacy}","received_events_url":"https://api.github.com/users/menivaitsi/received_events","type":"User","site_admin":false},"body":"Start -> Starts","created_at":"2015-01-28T04:27:56Z","updated_at":"2015-01-28T04:27:56Z","html_url":"https://github.com/AppScale/appscale/pull/1662#discussion_r23665157","pull_request_url":"https://api.github.com/repos/AppScale/appscale/pulls/1662","_links":{"self":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/comments/23665157"},"html":{"href":"https://github.com/AppScale/appscale/pull/1662#discussion_r23665157"},"pull_request":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/1662"}}},"pull_request":{"url":"https://api.github.com/repos/AppScale/appscale/pulls/1662","id":26267719,"html_url":"https://github.com/AppScale/appscale/pull/1662","diff_url":"https://github.com/AppScale/appscale/pull/1662.diff","patch_url":"https://github.com/AppScale/appscale/pull/1662.patch","issue_url":"https://api.github.com/repos/AppScale/appscale/issues/1662","number":1662,"state":"open","locked":false,"title":"Search API","user":{"login":"nlake44","id":469387,"avatar_url":"https://avatars.githubusercontent.com/u/469387?v=3","gravatar_id":"","url":"https://api.github.com/users/nlake44","html_url":"https://github.com/nlake44","followers_url":"https://api.github.com/users/nlake44/followers","following_url":"https://api.github.com/users/nlake44/following{/other_user}","gists_url":"https://api.github.com/users/nlake44/gists{/gist_id}","starred_url":"https://api.github.com/users/nlake44/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlake44/subscriptions","organizations_url":"https://api.github.com/users/nlake44/orgs","repos_url":"https://api.github.com/users/nlake44/repos","events_url":"https://api.github.com/users/nlake44/events{/privacy}","received_events_url":"https://api.github.com/users/nlake44/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-12-17T23:59:56Z","updated_at":"2015-01-28T04:27:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e16c9d576465f354e4a8fa3e7bcd81de10758e7f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AppScale/appscale/pulls/1662/commits","review_comments_url":"https://api.github.com/repos/AppScale/appscale/pulls/1662/comments","review_comment_url":"https://api.github.com/repos/AppScale/appscale/pulls/comments/{number}","comments_url":"https://api.github.com/repos/AppScale/appscale/issues/1662/comments","statuses_url":"https://api.github.com/repos/AppScale/appscale/statuses/f4d489eb09e26c801c7c2ddc488be0be480f2f08","head":{"label":"AppScale:search-server","ref":"search-server","sha":"f4d489eb09e26c801c7c2ddc488be0be480f2f08","user":{"login":"AppScale","id":1486044,"avatar_url":"https://avatars.githubusercontent.com/u/1486044?v=3","gravatar_id":"","url":"https://api.github.com/users/AppScale","html_url":"https://github.com/AppScale","followers_url":"https://api.github.com/users/AppScale/followers","following_url":"https://api.github.com/users/AppScale/following{/other_user}","gists_url":"https://api.github.com/users/AppScale/gists{/gist_id}","starred_url":"https://api.github.com/users/AppScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppScale/subscriptions","organizations_url":"https://api.github.com/users/AppScale/orgs","repos_url":"https://api.github.com/users/AppScale/repos","events_url":"https://api.github.com/users/AppScale/events{/privacy}","received_events_url":"https://api.github.com/users/AppScale/received_events","type":"Organization","site_admin":false},"repo":{"id":3803067,"name":"appscale","full_name":"AppScale/appscale","owner":{"login":"AppScale","id":1486044,"avatar_url":"https://avatars.githubusercontent.com/u/1486044?v=3","gravatar_id":"","url":"https://api.github.com/users/AppScale","html_url":"https://github.com/AppScale","followers_url":"https://api.github.com/users/AppScale/followers","following_url":"https://api.github.com/users/AppScale/following{/other_user}","gists_url":"https://api.github.com/users/AppScale/gists{/gist_id}","starred_url":"https://api.github.com/users/AppScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppScale/subscriptions","organizations_url":"https://api.github.com/users/AppScale/orgs","repos_url":"https://api.github.com/users/AppScale/repos","events_url":"https://api.github.com/users/AppScale/events{/privacy}","received_events_url":"https://api.github.com/users/AppScale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AppScale/appscale","description":"The Open Source Implementation of Google App Engine -- Take your apps everywhere.","fork":false,"url":"https://api.github.com/repos/AppScale/appscale","forks_url":"https://api.github.com/repos/AppScale/appscale/forks","keys_url":"https://api.github.com/repos/AppScale/appscale/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AppScale/appscale/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AppScale/appscale/teams","hooks_url":"https://api.github.com/repos/AppScale/appscale/hooks","issue_events_url":"https://api.github.com/repos/AppScale/appscale/issues/events{/number}","events_url":"https://api.github.com/repos/AppScale/appscale/events","assignees_url":"https://api.github.com/repos/AppScale/appscale/assignees{/user}","branches_url":"https://api.github.com/repos/AppScale/appscale/branches{/branch}","tags_url":"https://api.github.com/repos/AppScale/appscale/tags","blobs_url":"https://api.github.com/repos/AppScale/appscale/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AppScale/appscale/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AppScale/appscale/git/refs{/sha}","trees_url":"https://api.github.com/repos/AppScale/appscale/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AppScale/appscale/statuses/{sha}","languages_url":"https://api.github.com/repos/AppScale/appscale/languages","stargazers_url":"https://api.github.com/repos/AppScale/appscale/stargazers","contributors_url":"https://api.github.com/repos/AppScale/appscale/contributors","subscribers_url":"https://api.github.com/repos/AppScale/appscale/subscribers","subscription_url":"https://api.github.com/repos/AppScale/appscale/subscription","commits_url":"https://api.github.com/repos/AppScale/appscale/commits{/sha}","git_commits_url":"https://api.github.com/repos/AppScale/appscale/git/commits{/sha}","comments_url":"https://api.github.com/repos/AppScale/appscale/comments{/number}","issue_comment_url":"https://api.github.com/repos/AppScale/appscale/issues/comments/{number}","contents_url":"https://api.github.com/repos/AppScale/appscale/contents/{+path}","compare_url":"https://api.github.com/repos/AppScale/appscale/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AppScale/appscale/merges","archive_url":"https://api.github.com/repos/AppScale/appscale/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AppScale/appscale/downloads","issues_url":"https://api.github.com/repos/AppScale/appscale/issues{/number}","pulls_url":"https://api.github.com/repos/AppScale/appscale/pulls{/number}","milestones_url":"https://api.github.com/repos/AppScale/appscale/milestones{/number}","notifications_url":"https://api.github.com/repos/AppScale/appscale/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AppScale/appscale/labels{/name}","releases_url":"https://api.github.com/repos/AppScale/appscale/releases{/id}","created_at":"2012-03-22T22:35:50Z","updated_at":"2015-01-26T23:43:44Z","pushed_at":"2015-01-28T00:50:01Z","git_url":"git://github.com/AppScale/appscale.git","ssh_url":"git@github.com:AppScale/appscale.git","clone_url":"https://github.com/AppScale/appscale.git","svn_url":"https://github.com/AppScale/appscale","homepage":"http://www.appscale.com","size":197299,"stargazers_count":1845,"watchers_count":1845,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":187,"mirror_url":null,"open_issues_count":59,"forks":187,"open_issues":59,"watchers":1845,"default_branch":"master"}},"base":{"label":"AppScale:master","ref":"master","sha":"d630ab07882bf213eaff3d194d7862f6063e2cdc","user":{"login":"AppScale","id":1486044,"avatar_url":"https://avatars.githubusercontent.com/u/1486044?v=3","gravatar_id":"","url":"https://api.github.com/users/AppScale","html_url":"https://github.com/AppScale","followers_url":"https://api.github.com/users/AppScale/followers","following_url":"https://api.github.com/users/AppScale/following{/other_user}","gists_url":"https://api.github.com/users/AppScale/gists{/gist_id}","starred_url":"https://api.github.com/users/AppScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppScale/subscriptions","organizations_url":"https://api.github.com/users/AppScale/orgs","repos_url":"https://api.github.com/users/AppScale/repos","events_url":"https://api.github.com/users/AppScale/events{/privacy}","received_events_url":"https://api.github.com/users/AppScale/received_events","type":"Organization","site_admin":false},"repo":{"id":3803067,"name":"appscale","full_name":"AppScale/appscale","owner":{"login":"AppScale","id":1486044,"avatar_url":"https://avatars.githubusercontent.com/u/1486044?v=3","gravatar_id":"","url":"https://api.github.com/users/AppScale","html_url":"https://github.com/AppScale","followers_url":"https://api.github.com/users/AppScale/followers","following_url":"https://api.github.com/users/AppScale/following{/other_user}","gists_url":"https://api.github.com/users/AppScale/gists{/gist_id}","starred_url":"https://api.github.com/users/AppScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppScale/subscriptions","organizations_url":"https://api.github.com/users/AppScale/orgs","repos_url":"https://api.github.com/users/AppScale/repos","events_url":"https://api.github.com/users/AppScale/events{/privacy}","received_events_url":"https://api.github.com/users/AppScale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AppScale/appscale","description":"The Open Source Implementation of Google App Engine -- Take your apps everywhere.","fork":false,"url":"https://api.github.com/repos/AppScale/appscale","forks_url":"https://api.github.com/repos/AppScale/appscale/forks","keys_url":"https://api.github.com/repos/AppScale/appscale/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AppScale/appscale/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AppScale/appscale/teams","hooks_url":"https://api.github.com/repos/AppScale/appscale/hooks","issue_events_url":"https://api.github.com/repos/AppScale/appscale/issues/events{/number}","events_url":"https://api.github.com/repos/AppScale/appscale/events","assignees_url":"https://api.github.com/repos/AppScale/appscale/assignees{/user}","branches_url":"https://api.github.com/repos/AppScale/appscale/branches{/branch}","tags_url":"https://api.github.com/repos/AppScale/appscale/tags","blobs_url":"https://api.github.com/repos/AppScale/appscale/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AppScale/appscale/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AppScale/appscale/git/refs{/sha}","trees_url":"https://api.github.com/repos/AppScale/appscale/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AppScale/appscale/statuses/{sha}","languages_url":"https://api.github.com/repos/AppScale/appscale/languages","stargazers_url":"https://api.github.com/repos/AppScale/appscale/stargazers","contributors_url":"https://api.github.com/repos/AppScale/appscale/contributors","subscribers_url":"https://api.github.com/repos/AppScale/appscale/subscribers","subscription_url":"https://api.github.com/repos/AppScale/appscale/subscription","commits_url":"https://api.github.com/repos/AppScale/appscale/commits{/sha}","git_commits_url":"https://api.github.com/repos/AppScale/appscale/git/commits{/sha}","comments_url":"https://api.github.com/repos/AppScale/appscale/comments{/number}","issue_comment_url":"https://api.github.com/repos/AppScale/appscale/issues/comments/{number}","contents_url":"https://api.github.com/repos/AppScale/appscale/contents/{+path}","compare_url":"https://api.github.com/repos/AppScale/appscale/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AppScale/appscale/merges","archive_url":"https://api.github.com/repos/AppScale/appscale/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AppScale/appscale/downloads","issues_url":"https://api.github.com/repos/AppScale/appscale/issues{/number}","pulls_url":"https://api.github.com/repos/AppScale/appscale/pulls{/number}","milestones_url":"https://api.github.com/repos/AppScale/appscale/milestones{/number}","notifications_url":"https://api.github.com/repos/AppScale/appscale/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AppScale/appscale/labels{/name}","releases_url":"https://api.github.com/repos/AppScale/appscale/releases{/id}","created_at":"2012-03-22T22:35:50Z","updated_at":"2015-01-26T23:43:44Z","pushed_at":"2015-01-28T00:50:01Z","git_url":"git://github.com/AppScale/appscale.git","ssh_url":"git@github.com:AppScale/appscale.git","clone_url":"https://github.com/AppScale/appscale.git","svn_url":"https://github.com/AppScale/appscale","homepage":"http://www.appscale.com","size":197299,"stargazers_count":1845,"watchers_count":1845,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":187,"mirror_url":null,"open_issues_count":59,"forks":187,"open_issues":59,"watchers":1845,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/1662"},"html":{"href":"https://github.com/AppScale/appscale/pull/1662"},"issue":{"href":"https://api.github.com/repos/AppScale/appscale/issues/1662"},"comments":{"href":"https://api.github.com/repos/AppScale/appscale/issues/1662/comments"},"review_comments":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/1662/comments"},"review_comment":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/1662/commits"},"statuses":{"href":"https://api.github.com/repos/AppScale/appscale/statuses/f4d489eb09e26c801c7c2ddc488be0be480f2f08"}}}}