org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmplImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hbase-server Show documentation
Show all versions of hbase-server Show documentation
Server functionality for HBase
// Autogenerated Jamon implementation
// /home/taklwu/hbase-rm/output/hbase/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon
package org.apache.hadoop.hbase.tmpl.regionserver;
// 27, 1
import java.util.*;
// 28, 1
import org.apache.hadoop.hbase.regionserver.HRegionServer;
// 29, 1
import org.apache.hadoop.hbase.client.RegionInfo;
// 30, 1
import org.apache.hadoop.hbase.ServerName;
// 31, 1
import org.apache.hadoop.hbase.HBaseConfiguration;
// 32, 1
import org.apache.hadoop.hbase.io.hfile.CacheConfig;
// 33, 1
import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
// 34, 1
import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ServerInfo;
// 35, 1
import org.apache.hadoop.hbase.util.JvmVersion;
// 36, 1
import org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
public class RSStatusTmplImpl
extends org.jamon.AbstractTemplateImpl
implements org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl.Intf
{
private final HRegionServer regionServer;
private final String bcn;
private final String bcv;
private final String filter;
private final String format;
// 56, 1
public String formatZKString() {
StringBuilder quorums = new StringBuilder();
String zkQuorum = regionServer.getZooKeeper().getQuorum();
if (null == zkQuorum) {
return quorums.toString();
}
String[] zks = zkQuorum.split(",");
if (zks.length == 0) {
return quorums.toString();
}
for(int i = 0; i < zks.length; ++i) {
quorums.append(zks[i].trim());
if (i != (zks.length - 1)) {
quorums.append("
");
}
}
return quorums.toString();
}
protected static org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl.ImplData __jamon_setOptionalArguments(org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl.ImplData p_implData)
{
if(! p_implData.getBcn__IsNotDefault())
{
p_implData.setBcn("");
}
if(! p_implData.getBcv__IsNotDefault())
{
p_implData.setBcv("");
}
if(! p_implData.getFilter__IsNotDefault())
{
p_implData.setFilter("general");
}
if(! p_implData.getFormat__IsNotDefault())
{
p_implData.setFormat("html");
}
return p_implData;
}
public RSStatusTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl.ImplData p_implData)
{
super(p_templateManager, __jamon_setOptionalArguments(p_implData));
regionServer = p_implData.getRegionServer();
bcn = p_implData.getBcn();
bcv = p_implData.getBcv();
filter = p_implData.getFilter();
format = p_implData.getFormat();
}
@Override public void renderNoFlush(final java.io.Writer jamonWriter)
throws java.io.IOException
{
// 39, 1
if (format.equals("json") && bcn != null && bcn.length() > 0 )
{
// 39, 66
jamonWriter.write("\n ");
// 40, 3
{
org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheViewTmpl __jamon__var_8 = new org.apache.hadoop.hbase.tmpl.regionserver.BlockCacheViewTmpl(this.getTemplateManager());
__jamon__var_8.renderNoFlush(jamonWriter, new CacheConfig(regionServer.getConfiguration()), regionServer.getConfiguration(), bcn, bcv, regionServer.getBlockCache().orElse(null) );
}
// 40, 210
jamonWriter.write("\n ");
// 41, 3
return;
}
// 42, 1
else if (format.equals("json") )
{
// 42, 34
jamonWriter.write("\n ");
// 43, 3
{
org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl __jamon__var_9 = new org.apache.hadoop.hbase.tmpl.common.TaskMonitorTmpl(this.getTemplateManager());
__jamon__var_9.setFilter(filter);
__jamon__var_9.setFormat("json" );
__jamon__var_9.renderNoFlush(jamonWriter);
}
// 43, 68
jamonWriter.write("\n ");
// 44, 3
return;
}
// 45, 7
jamonWriter.write("\n");
// 46, 1
ServerInfo serverInfo = ProtobufUtil.getServerInfo(null, regionServer.getRSRpcServices());
ServerName serverName = ProtobufUtil.toServerName(serverInfo.getServerName());
List onlineRegions = ProtobufUtil.getOnlineRegions(regionServer.getRSRpcServices());
MasterAddressTracker masterAddressTracker = regionServer.getMasterAddressTracker();
ServerName masterServerName = masterAddressTracker == null ? null
: masterAddressTracker.getMasterAddress();
int infoPort = masterAddressTracker == null ? 0 : masterAddressTracker.getMasterInfoPort();
// 83, 1
jamonWriter.write("\n\n\n \n \n HBase Region Server: ");
// 88, 33
org.jamon.escaping.Escaping.NONE.write(org.jamon.emit.StandardEmitter.valueOf(serverName.getHostname()), jamonWriter);
// 88, 63
jamonWriter.write(" \n \n \n\n \n \n \n \n\n \n\n \n