|
38 | 38 | <%@ page import="org.apache.hadoop.hbase.master.CatalogJanitor" %> |
39 | 39 | <%@ page import="org.apache.hadoop.hbase.master.CatalogJanitor.Report" %> |
40 | 40 | <% |
| 41 | + final String cacheParameterValue = request.getParameter("cache"); |
41 | 42 | final HMaster master = (HMaster) getServletContext().getAttribute(HMaster.MASTER); |
42 | 43 | pageContext.setAttribute("pageTitle", "HBase Master HBCK Report: " + master.getServerName()); |
| 44 | + if (!Boolean.parseBoolean(cacheParameterValue)) { |
| 45 | + // Run the two reporters inline w/ drawing of the page. If exception, will show in page draw. |
| 46 | + try { |
| 47 | + master.getMasterRpcServices().runHbckChore(null, null); |
| 48 | + } catch (org.apache.hbase.thirdparty.com.google.protobuf.ServiceException se) { |
| 49 | + out.write("Failed generating a new hbck_chore report; using cache; try again or run hbck_chore_run in the shell: " + se.getMessage() + "\n"); |
| 50 | + } |
| 51 | + try { |
| 52 | + master.getMasterRpcServices().runCatalogScan(null, null); |
| 53 | + } catch (org.apache.hbase.thirdparty.com.google.protobuf.ServiceException se) { |
| 54 | + out.write("Failed generating a new catalogjanitor report; using cache; try again or run catalogjanitor_run in the shell: " + se.getMessage() + "\n"); |
| 55 | + } |
| 56 | + } |
43 | 57 | HbckChore hbckChore = master.getHbckChore(); |
44 | 58 | Map<String, Pair<ServerName, List<ServerName>>> inconsistentRegions = null; |
45 | 59 | Map<String, ServerName> orphanRegionsOnRS = null; |
|
79 | 93 |
|
80 | 94 | <div class="row"> |
81 | 95 | <div class="page-header"> |
82 | | - <p><span>This page displays two reports: the <em>HBCK Chore Report</em> and the <em>CatalogJanitor Consistency Issues</em> report. Only report titles show if there are no problems to list. Note some conditions are <strong>transitory</strong> as regions migrate. See below for how to run reports. ServerNames will be links if server is live, italic if dead, and plain if unknown.</span></p> |
| 96 | + <p><span>This page displays two reports: the <em>HBCK Chore Report</em> and |
| 97 | + the <em>CatalogJanitor Consistency Issues</em> report. Only report titles |
| 98 | + show if there are no problems to list. Note some conditions are |
| 99 | + <strong>transitory</strong> as regions migrate. Reports are generated |
| 100 | + when you invoke this page unless you add <em>?cache=true</em> to the URL. Then |
| 101 | + we display the reports cached from the last time the reports were run. |
| 102 | + Reports are run by Chores that are hosted by the Master on a cadence. |
| 103 | + You can also run them on demand from the hbase shell: invoke <em>catalogjanitor_run</em> |
| 104 | + and/or <em>hbck_chore_run</em>. |
| 105 | + ServerNames will be links if server is live, italic if dead, and plain if unknown.</span></p> |
83 | 106 | </div> |
84 | 107 | </div> |
85 | 108 | <div class="row"> |
|
89 | 112 | <% if (hbckChore.isDisabled()) { %> |
90 | 113 | <span>HBCK chore is currently disabled. Set hbase.master.hbck.chore.interval > 0 in the config & do a rolling-restart to enable it.</span> |
91 | 114 | <% } else if (startTimestamp == 0 && endTimestamp == 0){ %> |
92 | | - <span>No report created. Execute <i>hbck_chore_run</i> in hbase shell to generate a new sub-report.</span> |
| 115 | + <span>No report created.</span> |
93 | 116 | <% } else if (startTimestamp > 0 && endTimestamp == 0){ %> |
94 | 117 | <span>Checking started at <%= iso8601start %>. Please wait for checking to generate a new sub-report.</span> |
95 | 118 | <% } else { %> |
96 | | - <span>Checking started at <%= iso8601start %> and generated report at <%= iso8601end %>. Execute <i>hbck_chore_run</i> in hbase shell to generate a new sub-report.</span> |
| 119 | + <span>Checking started at <%= iso8601start %> and generated report at <%= iso8601end %>.</span> |
97 | 120 | <% } %> |
98 | 121 | </p> |
99 | 122 | </div> |
|
204 | 227 | <h1>CatalogJanitor <em>hbase:meta</em> Consistency Issues</h1> |
205 | 228 | <p> |
206 | 229 | <% if (report != null) { %> |
207 | | - <span>Report created: <%= iso8601reportTime %> (now=<%= iso8601Now %>). Run <i>catalogjanitor_run</i> in hbase shell to generate a new sub-report.</span></p> |
| 230 | + <span>Report created: <%= iso8601reportTime %> (now=<%= iso8601Now %>).</span></p> |
208 | 231 | <% } else { %> |
209 | | - <span>No report created. Run <i>catalogjanitor_run</i> in hbase shell to generate a new sub-report.</span> |
| 232 | + <span>No report created.</span> |
210 | 233 | <% } %> |
211 | 234 | </div> |
212 | 235 | </div> |
|
0 commit comments