Package org.apache.hadoop.hbase.hql

Examples of org.apache.hadoop.hbase.hql.ShowCommand



  HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
  HBaseConfiguration conf = master.getConfiguration();
  TableFormatter formatter = new HtmlTableFormatter(out);
  ShowCommand show = new ShowCommand(out, formatter, "tables");
  HServerAddress rootLocation = master.getRootRegionLocation();
  Map<Text, MetaRegion> onlineRegions = master.getOnlineMetaRegions();
  Map<String, HServerInfo> serverToServerInfos =
    master.getServersToServerInfo();
  int interval = conf.getInt("hbase.regionserver.msginterval", 6000)/1000;

      out.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \n  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> \n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\"/>\n<title>Hbase Master: ");
      out.print( master.getMasterAddress());
      out.write("</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/hbase.css\" />\n</head>\n\n<body>\n\n<a id=\"logo\" href=\"http://wiki.apache.org/lucene-hadoop/Hbase\"><img src=\"/static/hbase_logo_med.gif\" alt=\"Hbase Logo\" title=\"Hbase Logo\" /></a>\n<h1 id=\"page_title\">Master: ");
      out.print(master.getMasterAddress());
      out.write("</h1>\n<p id=\"links_menu\"><a href=\"/hql.jsp\">HQL</a>, <a href=\"/logs/\">Local logs</a>, <a href=\"/stacks\">Thread Dump</a>, <a href=\"/logLevel\">Log Level</a></p>\n<hr id=\"head_rule\" />\n\n<h2>Master Attributes</h2>\n<table>\n<tr><th>Attribute Name</th><th>Value</th><th>Description</th></tr>\n<tr><td>Version</td><td>");
      out.print( VersionInfo.getVersion() );
      out.write(',');
      out.write(' ');
      out.write('r');
      out.print( VersionInfo.getRevision() );
      out.write("</td><td>Hbase version and svn revision</td></tr>\n<tr><td>Compiled</td><td>");
      out.print( VersionInfo.getDate() );
      out.write(',');
      out.write(' ');
      out.print( VersionInfo.getUser() );
      out.write("</td><td>When this version was compiled and by whom</td></tr>\n<tr><td>Filesystem</td><td>");
      out.print( conf.get("fs.default.name") );
      out.write("</td><td>Filesystem hbase is running on</td></tr>\n<tr><td>Hbase Root Directory</td><td>");
      out.print( master.getRootDir().toString() );
      out.write("</td><td>Location of hbase home directory</td></tr>\n</table>\n\n<h2>Online META Regions</h2>\n");
if (rootLocation != null) {
      out.write("\n<table>\n<tr><th>Name</th><th>Server</th></tr>\n<tr><td>");
      out.print( HConstants.ROOT_TABLE_NAME.toString() );
      out.write("</td><td>");
      out.print( rootLocation.toString() );
      out.write("</td></tr>\n");

  if (onlineRegions != null && onlineRegions.size() > 0) {
      out.write('\n');
      out.write(' ');
      out.write(' ');
for (Map.Entry<Text, HMaster.MetaRegion> e: onlineRegions.entrySet()) {
    MetaRegion meta = e.getValue();
 
      out.write("\n  <tr><td>");
      out.print( meta.getRegionName().toString() );
      out.write("</td><td>");
      out.print( meta.getServer().toString() );
      out.write("</td></tr>\n  ");
}
  }
      out.write("\n</table>\n");
}
      out.write("\n\n<h2>Tables</h2>\n");
ReturnMsg msg = show.execute(conf);
      out.write("\n<p>");
      out.print(msg );
      out.write("</p>\n\n<h2>Region Servers</h2>\n");
if (serverToServerInfos != null && serverToServerInfos.size() > 0) {
      out.write('\n');
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.hql.ShowCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.