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

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

There is a newer version: 3.0.0-beta-1
Show newest version
// Autogenerated Jamon implementation
// /home/apurtell/tmp/RM/hbase/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/AssignmentManagerStatusTmpl.jamon

package org.apache.hadoop.hbase.tmpl.master;

// 20, 1
import java.util.Map;
// 21, 1
import java.util.Set;
// 22, 1
import java.util.SortedSet;
// 23, 1
import java.util.concurrent.atomic.AtomicInteger;
// 24, 1
import java.util.stream.Collectors;
// 25, 1
import org.apache.hadoop.conf.Configuration;
// 26, 1
import org.apache.hadoop.hbase.HBaseConfiguration;
// 27, 1
import org.apache.hadoop.hbase.HConstants;
// 28, 1
import org.apache.hadoop.hbase.ServerName;
// 29, 1
import org.apache.hadoop.hbase.client.RegionInfo;
// 30, 1
import org.apache.hadoop.hbase.client.RegionInfoDisplay;
// 31, 1
import org.apache.hadoop.hbase.master.RegionState;
// 32, 1
import org.apache.hadoop.hbase.master.assignment.AssignmentManager;
// 33, 1
import org.apache.hadoop.hbase.master.assignment.AssignmentManager.RegionInTransitionStat;
// 34, 1
import org.apache.hadoop.hbase.master.assignment.RegionStates.RegionFailedOpen;
// 35, 1
import org.apache.hadoop.hbase.util.Pair;

public class AssignmentManagerStatusTmplImpl
  extends org.jamon.AbstractTemplateImpl
  implements org.apache.hadoop.hbase.tmpl.master.AssignmentManagerStatusTmpl.Intf

{
  private final AssignmentManager assignmentManager;
  private final int limit;
  protected static org.apache.hadoop.hbase.tmpl.master.AssignmentManagerStatusTmpl.ImplData __jamon_setOptionalArguments(org.apache.hadoop.hbase.tmpl.master.AssignmentManagerStatusTmpl.ImplData p_implData)
  {
    if(! p_implData.getLimit__IsNotDefault())
    {
      p_implData.setLimit(100);
    }
    return p_implData;
  }
  public AssignmentManagerStatusTmplImpl(org.jamon.TemplateManager p_templateManager, org.apache.hadoop.hbase.tmpl.master.AssignmentManagerStatusTmpl.ImplData p_implData)
  {
    super(p_templateManager, __jamon_setOptionalArguments(p_implData));
    assignmentManager = p_implData.getAssignmentManager();
    limit = p_implData.getLimit();
  }
  
  @Override public void renderNoFlush(final java.io.Writer jamonWriter)
    throws java.io.IOException
  {
    // 42, 1
    
SortedSet rit = assignmentManager.getRegionStates()
    .getRegionsInTransitionOrderedByTimestamp();

    // 47, 1
    if (!rit.isEmpty() )
    {
      // 47, 23
      jamonWriter.write("\n");
      // 48, 1
      
long currentTime = System.currentTimeMillis();
RegionInTransitionStat ritStat = assignmentManager.computeRegionInTransitionStat();

int numOfRITs = rit.size();
int ritsPerPage = Math.min(5, numOfRITs);
int numOfPages = (int) Math.ceil(numOfRITs * 1.0 / ritsPerPage);

      // 56, 5
      jamonWriter.write("
\n

Regions in Transition

\n

"); // 58, 29 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(numOfRITs), jamonWriter); // 58, 44 jamonWriter.write(" region(s) in transition.\n "); // 59, 6 if (ritStat.hasRegionsTwiceOverThreshold() ) { // 59, 53 jamonWriter.write("\n \n "); } // 61, 6 else if (ritStat.hasRegionsOverThreshold() ) { // 61, 51 jamonWriter.write("\n \n "); } // 63, 6 else { // 63, 13 jamonWriter.write("\n \n "); } // 65, 12 jamonWriter.write("\n "); // 66, 10 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(ritStat.getTotalRITsOverThreshold()), jamonWriter); // 66, 51 jamonWriter.write(" region(s) in transition for\n more than "); // 67, 24 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(ritStat.getRITThreshold()), jamonWriter); // 67, 55 jamonWriter.write(" milliseconds.\n \n

\n
\n
\n "); // 72, 10 int recordItr = 0; // 73, 10 for (RegionState rs : rit ) { // 73, 39 jamonWriter.write("\n "); // 74, 14 if ((recordItr % ritsPerPage) == 0 ) { // 74, 52 jamonWriter.write("\n "); // 75, 18 if (recordItr == 0 ) { // 75, 40 jamonWriter.write("\n
\n "); } // 77, 18 else { // 77, 25 jamonWriter.write("\n
\n "); } // 79, 24 jamonWriter.write("\n \n \n "); } // 82, 20 jamonWriter.write("\n\n "); // 84, 14 if (ritStat.isRegionTwiceOverThreshold(rs.getRegion()) ) { // 84, 72 jamonWriter.write("\n \n "); } // 86, 14 else if (ritStat.isRegionOverThreshold(rs.getRegion()) ) { // 86, 71 jamonWriter.write("\n \n "); } // 88, 13 else { // 88, 20 jamonWriter.write("\n \n "); } // 90, 19 jamonWriter.write("\n "); // 91, 25 String retryStatus = "0"; RegionFailedOpen regionFailedOpen = assignmentManager .getRegionStates().getFailedOpen(rs.getRegion()); if (regionFailedOpen != null) { retryStatus = Integer.toString(regionFailedOpen.getRetries()); } else if (rs.getState() == RegionState.State.FAILED_OPEN) { retryStatus = "Failed"; } // 101, 25 jamonWriter.write("\n \n \n \n "); // 107, 22 recordItr++; // 108, 14 if ((recordItr % ritsPerPage) == 0 ) { // 108, 52 jamonWriter.write("\n
RegionStateRIT time (ms) Retries
"); // 101, 29 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(rs.getRegion().getEncodedName()), jamonWriter); // 101, 66 jamonWriter.write("\n "); // 102, 25 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(RegionInfoDisplay.getDescriptiveNameFromRegionStateForDisplay(rs, assignmentManager.getConfiguration())), jamonWriter); // 103, 69 jamonWriter.write(""); // 104, 29 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf((currentTime - rs.getStamp())), jamonWriter); // 104, 64 jamonWriter.write(" "); // 105, 30 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(retryStatus), jamonWriter); // 105, 47 jamonWriter.write("
\n
\n "); } // 111, 16 jamonWriter.write("\n "); } // 112, 17 jamonWriter.write("\n\n "); // 114, 10 if ((recordItr % ritsPerPage) != 0 ) { // 114, 48 jamonWriter.write("\n "); // 115, 14 for (; (recordItr % ritsPerPage) != 0 ; recordItr++ ) { // 115, 69 jamonWriter.write("\n \n "); } // 117, 21 jamonWriter.write("\n \n
\n "); } // 120, 16 jamonWriter.write("\n
\n \n \n \n
\n
\n "); } // 127, 8 jamonWriter.write("\n\n"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy