org.apache.hadoop.hbase.tmpl.master.BackupMasterStatusTmplImpl 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/zhangduo/hbase-rm/output/hbase/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/BackupMasterStatusTmpl.jamon
package org.apache.hadoop.hbase.tmpl.master;
// 23, 1
import java.util.*;
// 24, 1
import org.apache.hadoop.hbase.ServerName;
// 25, 1
import org.apache.hadoop.hbase.ClusterMetrics;
// 26, 1
import org.apache.hadoop.hbase.master.HMaster;
// 27, 1
import org.apache.hbase.thirdparty.com.google.common.base.Preconditions;
public class BackupMasterStatusTmplImpl
extends org.jamon.AbstractTemplateImpl
implements org.apache.hadoop.hbase.tmpl.master.BackupMasterStatusTmpl.Intf
{
private final HMaster master;
protected static org.apache.hadoop.hbase.tmpl.master.BackupMasterStatusTmpl.ImplData __jamon_setOptionalArguments(org.apache.hadoop.hbase.tmpl.master.BackupMasterStatusTmpl.ImplData p_implData)
{
return p_implData;
}
public BackupMasterStatusTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hadoop.hbase.tmpl.master.BackupMasterStatusTmpl.ImplData p_implData)
{
super(p_templateManager, __jamon_setOptionalArguments(p_implData));
master = p_implData.getMaster();
}
@Override public void renderNoFlush(final java.io.Writer jamonWriter)
throws java.io.IOException
{
// 29, 1
if ((!master.isActiveMaster()) )
{
// 29, 35
jamonWriter.write("\n ");
// 30, 5
ServerName active_master = master.getActiveMaster().orElse(null);
Preconditions.checkState(active_master != null, "Failed to retrieve active master's ServerName!");
int activeInfoPort = master.getActiveMasterInfoPort();
// 35, 5
jamonWriter.write("\n \n Backup Master ");
// 37, 38
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(master.getServerName().getHostname()), jamonWriter);
// 37, 80
jamonWriter.write("
\n \n \n Current Active Master: ");
// 41, 25
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(active_master.getHostname()), jamonWriter);
// 41, 58
jamonWriter.write("\n");
}
// 42, 1
else
{
// 42, 8
jamonWriter.write("\n Backup Masters
\n\n
\n \n ServerName \n Port \n Start Time \n \n ");
// 51, 5
Collection backup_masters = master.getBackupMasters();
ServerName [] backupServerNames = backup_masters.toArray(new ServerName[backup_masters.size()]);
Arrays.sort(backupServerNames);
for (ServerName serverName : backupServerNames) {
int infoPort = master.getBackupMasterInfoPort(serverName);
// 58, 5
jamonWriter.write("\n ");
// 60, 29
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName.getHostname()), jamonWriter);
// 60, 59
jamonWriter.write("\n \n ");
// 62, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName.getPort()), jamonWriter);
// 62, 39
jamonWriter.write(" \n ");
// 63, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(new Date(serverName.getStartcode())), jamonWriter);
// 63, 54
jamonWriter.write(" \n \n ");
// 65, 5
}
// 68, 5
jamonWriter.write("Total:");
// 68, 19
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(backupServerNames.length), jamonWriter);
// 68, 49
jamonWriter.write(" \n
\n");
}
// 70, 7
jamonWriter.write("\n");
}
}