All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.hadoop.hbase.tmpl.master.BackupMasterStatusTmplImpl Maven / Gradle / Ivy

There is a newer version: 3.0.0-beta-1
Show newest version
// Autogenerated Jamon implementation
// /Volumes/hbase-1.1.5/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.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();
  }
  
  public void renderNoFlush(@SuppressWarnings({"unused","hiding"}) final java.io.Writer jamonWriter)
    throws java.io.IOException
  {
    // 29, 1
    
Collection masters = null;
MasterAddressTracker masterAddressTracker = master.getMasterAddressTracker();
if (master.isActiveMaster()) {
  ClusterStatus status = master.getClusterStatus();
  masters = status.getBackupMasters();
} else{
  ServerName sn = masterAddressTracker == null ? null
    : masterAddressTracker.getMasterAddress();
  assert sn != null : "Failed to retreive master's ServerName!";
  masters = Collections.singletonList(sn);
}

    // 43, 1
    
ServerName [] serverNames = masters.toArray(new ServerName[masters.size()]);
int infoPort = masterAddressTracker == null ? 0 : masterAddressTracker.getMasterInfoPort();

    // 47, 1
    if ((!master.isActiveMaster()) )
    {
      // 47, 35
      jamonWriter.write("\n    ");
      // 48, 5
      if (serverNames[0] != null )
      {
        // 48, 35
        jamonWriter.write("\n        

Master

\n "); // 51, 54 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverNames[0].getHostname()), jamonWriter); // 52, 42 jamonWriter.write("\n "); } // 53, 5 else { // 53, 12 jamonWriter.write("\n Unable to parse master hostname.\n "); } // 55, 11 jamonWriter.write("\n"); } // 56, 1 else { // 56, 8 jamonWriter.write("\n

Backup Masters

\n\n \n \n \n \n \n \n "); // 65, 5 Arrays.sort(serverNames); for (ServerName serverName : serverNames) { infoPort = masterAddressTracker == null ? 0 : masterAddressTracker.getBackupMasterInfoPort(serverName); // 70, 5 jamonWriter.write("\n \n \n \n \n "); // 78, 5 } // 81, 5 jamonWriter.write("\n
ServerNamePortStart Time
"); // 72, 54 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName.getHostname()), jamonWriter); // 73, 38 jamonWriter.write("\n "); // 75, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(serverName.getPort()), jamonWriter); // 75, 39 jamonWriter.write(""); // 76, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(new Date(serverName.getStartcode())), jamonWriter); // 76, 54 jamonWriter.write("
Total:"); // 81, 19 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf((masters != null) ? masters.size() : 0), jamonWriter); // 81, 63 jamonWriter.write("
\n"); } // 83, 7 jamonWriter.write("\n"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy