org.apache.hadoop.hbase.tmpl.master.AssignmentManagerStatusTmplImpl Maven / Gradle / Ivy
Show all versions of hbase-server Show documentation
// Autogenerated Jamon implementation
// /home/stack/hbase.git/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/AssignmentManagerStatusTmpl.jamon
package org.apache.hadoop.hbase.tmpl.master;
// 20, 1
import org.apache.hadoop.hbase.master.assignment.AssignmentManager;
// 21, 1
import org.apache.hadoop.hbase.master.assignment.AssignmentManager.RegionInTransitionStat;
// 22, 1
import org.apache.hadoop.hbase.master.assignment.RegionStates.RegionFailedOpen;
// 23, 1
import org.apache.hadoop.hbase.master.RegionState;
// 24, 1
import org.apache.hadoop.conf.Configuration;
// 25, 1
import org.apache.hadoop.hbase.HBaseConfiguration;
// 26, 1
import org.apache.hadoop.hbase.HConstants;
// 27, 1
import org.apache.hadoop.hbase.client.RegionInfoDisplay;
// 28, 1
import java.util.HashSet;
// 29, 1
import java.util.SortedSet;
// 30, 1
import java.util.Map;
// 31, 1
import java.util.concurrent.atomic.AtomicInteger;
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
{
// 38, 1
SortedSet rit = assignmentManager
.getRegionStates().getRegionsInTransitionOrderedByTimestamp();
// 42, 1
if (!rit.isEmpty() )
{
// 42, 23
jamonWriter.write("\n");
// 43, 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);
// 51, 5
jamonWriter.write("\n Regions in Transition
\n ");
// 53, 9
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(numOfRITs), jamonWriter);
// 53, 24
jamonWriter.write(" region(s) in transition.\n ");
// 54, 6
if (ritStat.hasRegionsTwiceOverThreshold() )
{
// 54, 53
jamonWriter.write("\n \n ");
}
// 56, 6
else if (ritStat.hasRegionsOverThreshold() )
{
// 56, 51
jamonWriter.write("\n \n ");
}
// 58, 6
else
{
// 58, 13
jamonWriter.write("\n \n ");
}
// 60, 12
jamonWriter.write("\n ");
// 61, 10
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(ritStat.getTotalRITsOverThreshold()), jamonWriter);
// 61, 51
jamonWriter.write(" region(s) in transition for\n more than ");
// 62, 24
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(ritStat.getRITThreshold()), jamonWriter);
// 62, 55
jamonWriter.write(" milliseconds.\n \n
\n \n \n ");
// 67, 10
int recordItr = 0;
// 68, 10
for (RegionState rs : rit )
{
// 68, 39
jamonWriter.write("\n ");
// 69, 14
if ((recordItr % ritsPerPage) == 0 )
{
// 69, 52
jamonWriter.write("\n ");
// 70, 18
if (recordItr == 0 )
{
// 70, 40
jamonWriter.write("\n \n ");
}
// 72, 18
else
{
// 72, 25
jamonWriter.write("\n \n ");
}
// 74, 24
jamonWriter.write("\n Region \n State RIT time (ms) Retries \n ");
}
// 77, 20
jamonWriter.write("\n\n ");
// 79, 14
if (ritStat.isRegionTwiceOverThreshold(rs.getRegion()) )
{
// 79, 72
jamonWriter.write("\n \n ");
}
// 81, 14
else if (ritStat.isRegionOverThreshold(rs.getRegion()) )
{
// 81, 71
jamonWriter.write("\n \n ");
}
// 83, 13
else
{
// 83, 20
jamonWriter.write("\n \n ");
}
// 85, 19
jamonWriter.write("\n ");
// 86, 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";
}
// 96, 25
jamonWriter.write("");
// 96, 29
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(rs.getRegion().getEncodedName()), jamonWriter);
// 96, 66
jamonWriter.write(" \n ");
// 97, 25
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(RegionInfoDisplay.getDescriptiveNameFromRegionStateForDisplay(rs,
assignmentManager.getConfiguration())), jamonWriter);
// 98, 69
jamonWriter.write(" \n ");
// 99, 29
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf((currentTime - rs.getStamp())), jamonWriter);
// 99, 64
jamonWriter.write(" \n ");
// 100, 30
org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(retryStatus), jamonWriter);
// 100, 47
jamonWriter.write(" \n \n ");
// 102, 22
recordItr++;
// 103, 14
if ((recordItr % ritsPerPage) == 0 )
{
// 103, 52
jamonWriter.write("\n
\n \n ");
}
// 106, 16
jamonWriter.write("\n ");
}
// 107, 17
jamonWriter.write("\n\n ");
// 109, 10
if ((recordItr % ritsPerPage) != 0 )
{
// 109, 48
jamonWriter.write("\n ");
// 110, 14
for (; (recordItr % ritsPerPage) != 0 ; recordItr++ )
{
// 110, 69
jamonWriter.write("\n \n ");
}
// 112, 21
jamonWriter.write("\n \n \n ");
}
// 115, 16
jamonWriter.write("\n \n \n \n \n ");
}
// 131, 8
jamonWriter.write("\n\n");
}
}