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/stack/hbase.git/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.ClusterStatus;
// 26, 1
import org.apache.hadoop.hbase.master.HMaster;
// 27, 1
import org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
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
MasterAddressTracker masterAddressTracker = master.getMasterAddressTracker();
// 33, 1
if ((!master.isActiveMaster()) )
{
// 33, 35
jamonWriter.write("\n ");
// 34, 5
ServerName active_master =
(masterAddressTracker == null) ? null : masterAddressTracker.getMasterAddress();
assert active_master != null : "Failed to retrieve master's ServerName!";
int infoPort = (masterAddressTracker == null) ? 0 : masterAddressTracker.getMasterInfoPort();
// 40, 5
jamonWriter.write("\n \n Backup Master ");
// 42, 38
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(master.getServerName().getHostname()), jamonWriter);
// 42, 80
jamonWriter.write("
\n \n \n Current Active Master: ");
// 46, 25
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(active_master.getHostname()), jamonWriter);
// 46, 58
jamonWriter.write("\n");
}
// 47, 1
else
{
// 47, 8
jamonWriter.write("\n Backup Masters
\n\n
\n \n ServerName \n Port \n Start Time \n \n ");
// 56, 5
Collection backup_masters = master.getClusterStatus().getBackupMasters();
ServerName [] backupServerNames = backup_masters.toArray(new ServerName[backup_masters.size()]);
Arrays.sort(backupServerNames);
for (ServerName serverName : backupServerNames) {
int infoPort = (masterAddressTracker == null) ? 0 : masterAddressTracker
.getBackupMasterInfoPort(serverName);
// 64, 5
jamonWriter.write("\n ");
// 66, 29
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName.getHostname()), jamonWriter);
// 66, 59
jamonWriter.write("\n \n ");
// 68, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName.getPort()), jamonWriter);
// 68, 39
jamonWriter.write(" \n ");
// 69, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(new Date(serverName.getStartcode())), jamonWriter);
// 69, 54
jamonWriter.write(" \n \n ");
// 71, 5
}
// 74, 5
jamonWriter.write("Total:");
// 74, 19
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(backupServerNames.length), jamonWriter);
// 74, 49
jamonWriter.write(" \n
\n");
}
// 76, 7
jamonWriter.write("\n");
}
}