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
// /Users/apurtell/tmp/hbase-build-2/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.getClusterStatusWithoutCoprocessor().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);
// 65, 5
jamonWriter.write("\n ");
// 67, 29
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName.getHostname()), jamonWriter);
// 67, 59
jamonWriter.write("\n \n ");
// 69, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName.getPort()), jamonWriter);
// 69, 39
jamonWriter.write(" \n ");
// 70, 13
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(new Date(serverName.getStartcode())), jamonWriter);
// 70, 54
jamonWriter.write(" \n \n ");
// 72, 5
}
// 75, 5
jamonWriter.write("Total:");
// 75, 19
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(backupServerNames.length), jamonWriter);
// 75, 49
jamonWriter.write(" \n
\n");
}
// 77, 7
jamonWriter.write("\n");
}
}