{"action":"created","comment":{"url":"https://api.github.com/repos/apache/accumulo/pulls/comments/93819867","pull_request_review_id":14355959,"id":93819867,"diff_hunk":"@@ -0,0 +1,118 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\n+ * contributor license agreements.  See the NOTICE file distributed with\n+ * this work for additional information regarding copyright ownership.\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\n+ * (the \"License\"); you may not use this file except in compliance with\n+ * the License.  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 org.apache.accumulo.monitor.rest.api;\n+\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+import javax.xml.bind.annotation.XmlAttribute;\n+\n+import org.apache.accumulo.core.master.thrift.RecoveryStatus;\n+import org.apache.accumulo.core.master.thrift.TableInfo;\n+import org.apache.accumulo.core.master.thrift.TabletServerStatus;\n+import org.apache.accumulo.monitor.Monitor;\n+import org.apache.accumulo.server.util.TableInfoUtil;\n+\n+public class TabletServerInformation {\n+\n+  @XmlAttribute(name = \"id\")\n+  public String server;\n+\n+  public String hostname;\n+  public long lastContact;\n+  public double osload;\n+\n+  public CompactionsTypes compactions;\n+\n+  public int tablets;\n+  public double ingest, query, ingestMB, queryMB;\n+  public Integer scans; // For backwards compatibility, has same information as scansRunning\n+  public Double scansessions;\n+  public Double scanssessions; // For backwards compatibility\n+  public long holdtime;\n+\n+  // New variables\n+\n+  public String ip;\n+  private Integer scansRunning, scansQueued, minorRunning, minorQueued, majorRunning, majorQueued;\n+  private CompactionsList scansCompacting, major, minor; // if scans is removed, change scansCompacting to scans\n+  public long entries, lookups, indexCacheHits, indexCacheRequests, dataCacheHits, dataCacheRequests;\n+  public double indexCacheHitRate, dataCacheHitRate;\n+  public List<RecoveryStatusInformation> logRecoveries;\n+\n+  public TabletServerInformation() {}\n+\n+  public TabletServerInformation(TabletServerStatus thriftStatus) {\n+    TableInfo summary = TableInfoUtil.summarizeTableStats(thriftStatus);\n+    updateTabletServerInfo(thriftStatus, summary);\n+  }\n+\n+  public void updateTabletServerInfo(TabletServerStatus thriftStatus, TableInfo summary) {\n+\n+    long now = System.currentTimeMillis();\n+\n+    this.server = this.ip = this.hostname = thriftStatus.name;\n+    this.tablets = summary.tablets;","path":"server/monitor/src/main/java/org/apache/accumulo/monitor/rest/api/TabletServerInformation.java","position":69,"original_position":69,"commit_id":"d84f3ccc4ebb842769195c1f0e029b0644a1e0f9","original_commit_id":"d84f3ccc4ebb842769195c1f0e029b0644a1e0f9","user":{"login":"joshelser","id":67863,"avatar_url":"https://avatars.githubusercontent.com/u/67863?v=3","gravatar_id":"","url":"https://api.github.com/users/joshelser","html_url":"https://github.com/joshelser","followers_url":"https://api.github.com/users/joshelser/followers","following_url":"https://api.github.com/users/joshelser/following{/other_user}","gists_url":"https://api.github.com/users/joshelser/gists{/gist_id}","starred_url":"https://api.github.com/users/joshelser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshelser/subscriptions","organizations_url":"https://api.github.com/users/joshelser/orgs","repos_url":"https://api.github.com/users/joshelser/repos","events_url":"https://api.github.com/users/joshelser/events{/privacy}","received_events_url":"https://api.github.com/users/joshelser/received_events","type":"User","site_admin":false},"body":"Maybe a check that TableInfo is non-null before using it the first time? `Objects.requireNonNull(summary).tablets` would be an easy modification.","created_at":"2016-12-24T18:13:56Z","updated_at":"2016-12-24T18:23:27Z","html_url":"https://github.com/apache/accumulo/pull/194#discussion_r93819867","pull_request_url":"https://api.github.com/repos/apache/accumulo/pulls/194","_links":{"self":{"href":"https://api.github.com/repos/apache/accumulo/pulls/comments/93819867"},"html":{"href":"https://github.com/apache/accumulo/pull/194#discussion_r93819867"},"pull_request":{"href":"https://api.github.com/repos/apache/accumulo/pulls/194"}}},"pull_request":{"url":"https://api.github.com/repos/apache/accumulo/pulls/194","id":99163804,"html_url":"https://github.com/apache/accumulo/pull/194","diff_url":"https://github.com/apache/accumulo/pull/194.diff","patch_url":"https://github.com/apache/accumulo/pull/194.patch","issue_url":"https://api.github.com/repos/apache/accumulo/issues/194","number":194,"state":"open","locked":false,"title":"ACCUMULO-3005 Added REST API calls","user":{"login":"lstav","id":5274788,"avatar_url":"https://avatars.githubusercontent.com/u/5274788?v=3","gravatar_id":"","url":"https://api.github.com/users/lstav","html_url":"https://github.com/lstav","followers_url":"https://api.github.com/users/lstav/followers","following_url":"https://api.github.com/users/lstav/following{/other_user}","gists_url":"https://api.github.com/users/lstav/gists{/gist_id}","starred_url":"https://api.github.com/users/lstav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lstav/subscriptions","organizations_url":"https://api.github.com/users/lstav/orgs","repos_url":"https://api.github.com/users/lstav/repos","events_url":"https://api.github.com/users/lstav/events{/privacy}","received_events_url":"https://api.github.com/users/lstav/received_events","type":"User","site_admin":false},"body":"This pull request is to serve as a code review for the REST API (rest/api and rest/resources) code. \r\nThis listens on a separate port from the current monitor.\r\nI will be working on the client side of the monitor next to use these calls. \r\n\r\nSome of the code was written to be able to run it from a separate port and will be removed when the UI is completed.\r\n","created_at":"2016-12-22T20:17:32Z","updated_at":"2016-12-24T18:23:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7f5d96c28c0fd5e38c7bf33e5ac78e4ff19a1e5c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/accumulo/pulls/194/commits","review_comments_url":"https://api.github.com/repos/apache/accumulo/pulls/194/comments","review_comment_url":"https://api.github.com/repos/apache/accumulo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/accumulo/issues/194/comments","statuses_url":"https://api.github.com/repos/apache/accumulo/statuses/d84f3ccc4ebb842769195c1f0e029b0644a1e0f9","head":{"label":"lstav:ACCUMULO-3005","ref":"ACCUMULO-3005","sha":"d84f3ccc4ebb842769195c1f0e029b0644a1e0f9","user":{"login":"lstav","id":5274788,"avatar_url":"https://avatars.githubusercontent.com/u/5274788?v=3","gravatar_id":"","url":"https://api.github.com/users/lstav","html_url":"https://github.com/lstav","followers_url":"https://api.github.com/users/lstav/followers","following_url":"https://api.github.com/users/lstav/following{/other_user}","gists_url":"https://api.github.com/users/lstav/gists{/gist_id}","starred_url":"https://api.github.com/users/lstav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lstav/subscriptions","organizations_url":"https://api.github.com/users/lstav/orgs","repos_url":"https://api.github.com/users/lstav/repos","events_url":"https://api.github.com/users/lstav/events{/privacy}","received_events_url":"https://api.github.com/users/lstav/received_events","type":"User","site_admin":false},"repo":{"id":69255954,"name":"accumulo","full_name":"lstav/accumulo","owner":{"login":"lstav","id":5274788,"avatar_url":"https://avatars.githubusercontent.com/u/5274788?v=3","gravatar_id":"","url":"https://api.github.com/users/lstav","html_url":"https://github.com/lstav","followers_url":"https://api.github.com/users/lstav/followers","following_url":"https://api.github.com/users/lstav/following{/other_user}","gists_url":"https://api.github.com/users/lstav/gists{/gist_id}","starred_url":"https://api.github.com/users/lstav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lstav/subscriptions","organizations_url":"https://api.github.com/users/lstav/orgs","repos_url":"https://api.github.com/users/lstav/repos","events_url":"https://api.github.com/users/lstav/events{/privacy}","received_events_url":"https://api.github.com/users/lstav/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lstav/accumulo","description":"Mirror of Apache Accumulo","fork":true,"url":"https://api.github.com/repos/lstav/accumulo","forks_url":"https://api.github.com/repos/lstav/accumulo/forks","keys_url":"https://api.github.com/repos/lstav/accumulo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lstav/accumulo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lstav/accumulo/teams","hooks_url":"https://api.github.com/repos/lstav/accumulo/hooks","issue_events_url":"https://api.github.com/repos/lstav/accumulo/issues/events{/number}","events_url":"https://api.github.com/repos/lstav/accumulo/events","assignees_url":"https://api.github.com/repos/lstav/accumulo/assignees{/user}","branches_url":"https://api.github.com/repos/lstav/accumulo/branches{/branch}","tags_url":"https://api.github.com/repos/lstav/accumulo/tags","blobs_url":"https://api.github.com/repos/lstav/accumulo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lstav/accumulo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lstav/accumulo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lstav/accumulo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lstav/accumulo/statuses/{sha}","languages_url":"https://api.github.com/repos/lstav/accumulo/languages","stargazers_url":"https://api.github.com/repos/lstav/accumulo/stargazers","contributors_url":"https://api.github.com/repos/lstav/accumulo/contributors","subscribers_url":"https://api.github.com/repos/lstav/accumulo/subscribers","subscription_url":"https://api.github.com/repos/lstav/accumulo/subscription","commits_url":"https://api.github.com/repos/lstav/accumulo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lstav/accumulo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lstav/accumulo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lstav/accumulo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lstav/accumulo/contents/{+path}","compare_url":"https://api.github.com/repos/lstav/accumulo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lstav/accumulo/merges","archive_url":"https://api.github.com/repos/lstav/accumulo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lstav/accumulo/downloads","issues_url":"https://api.github.com/repos/lstav/accumulo/issues{/number}","pulls_url":"https://api.github.com/repos/lstav/accumulo/pulls{/number}","milestones_url":"https://api.github.com/repos/lstav/accumulo/milestones{/number}","notifications_url":"https://api.github.com/repos/lstav/accumulo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lstav/accumulo/labels{/name}","releases_url":"https://api.github.com/repos/lstav/accumulo/releases{/id}","deployments_url":"https://api.github.com/repos/lstav/accumulo/deployments","created_at":"2016-09-26T14:01:57Z","updated_at":"2016-11-09T15:50:10Z","pushed_at":"2016-12-23T15:31:28Z","git_url":"git://github.com/lstav/accumulo.git","ssh_url":"git@github.com:lstav/accumulo.git","clone_url":"https://github.com/lstav/accumulo.git","svn_url":"https://github.com/lstav/accumulo","homepage":"","size":52721,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"apache:master","ref":"master","sha":"315ccd921cd72409a2eb11fad5c2b045e43567de","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":2524488,"name":"accumulo","full_name":"apache/accumulo","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/accumulo","description":"Mirror of Apache Accumulo","fork":false,"url":"https://api.github.com/repos/apache/accumulo","forks_url":"https://api.github.com/repos/apache/accumulo/forks","keys_url":"https://api.github.com/repos/apache/accumulo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/accumulo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/accumulo/teams","hooks_url":"https://api.github.com/repos/apache/accumulo/hooks","issue_events_url":"https://api.github.com/repos/apache/accumulo/issues/events{/number}","events_url":"https://api.github.com/repos/apache/accumulo/events","assignees_url":"https://api.github.com/repos/apache/accumulo/assignees{/user}","branches_url":"https://api.github.com/repos/apache/accumulo/branches{/branch}","tags_url":"https://api.github.com/repos/apache/accumulo/tags","blobs_url":"https://api.github.com/repos/apache/accumulo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/accumulo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/accumulo/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/accumulo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/accumulo/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/accumulo/languages","stargazers_url":"https://api.github.com/repos/apache/accumulo/stargazers","contributors_url":"https://api.github.com/repos/apache/accumulo/contributors","subscribers_url":"https://api.github.com/repos/apache/accumulo/subscribers","subscription_url":"https://api.github.com/repos/apache/accumulo/subscription","commits_url":"https://api.github.com/repos/apache/accumulo/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/accumulo/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/accumulo/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/accumulo/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/accumulo/contents/{+path}","compare_url":"https://api.github.com/repos/apache/accumulo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/accumulo/merges","archive_url":"https://api.github.com/repos/apache/accumulo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/accumulo/downloads","issues_url":"https://api.github.com/repos/apache/accumulo/issues{/number}","pulls_url":"https://api.github.com/repos/apache/accumulo/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/accumulo/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/accumulo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/accumulo/labels{/name}","releases_url":"https://api.github.com/repos/apache/accumulo/releases{/id}","deployments_url":"https://api.github.com/repos/apache/accumulo/deployments","created_at":"2011-10-06T07:00:09Z","updated_at":"2016-12-22T12:50:07Z","pushed_at":"2016-12-23T15:03:48Z","git_url":"git://github.com/apache/accumulo.git","ssh_url":"git@github.com:apache/accumulo.git","clone_url":"https://github.com/apache/accumulo.git","svn_url":"https://github.com/apache/accumulo","homepage":"","size":71059,"stargazers_count":268,"watchers_count":268,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":145,"mirror_url":"git://git.apache.org/accumulo.git","open_issues_count":9,"forks":145,"open_issues":9,"watchers":268,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/accumulo/pulls/194"},"html":{"href":"https://github.com/apache/accumulo/pull/194"},"issue":{"href":"https://api.github.com/repos/apache/accumulo/issues/194"},"comments":{"href":"https://api.github.com/repos/apache/accumulo/issues/194/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/accumulo/pulls/194/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/accumulo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/accumulo/pulls/194/commits"},"statuses":{"href":"https://api.github.com/repos/apache/accumulo/statuses/d84f3ccc4ebb842769195c1f0e029b0644a1e0f9"}}}}
{"actor":{"display_login":"joshelser"}}