From 2455174c07a834e5ed8e19270a4d6357c5c23976 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Sat, 13 Dec 2008 22:02:04 +0000 Subject: [PATCH] HBASE-1055 Better vm stats on startup git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@726278 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + bin/hbase-daemon.sh | 1 - src/java/org/apache/hadoop/hbase/master/HMaster.java | 8 ++++++++ .../apache/hadoop/hbase/regionserver/HRegionServer.java | 7 ++++++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 74706b08568..fc90f804f1e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -172,6 +172,7 @@ Release 0.19.0 - Unreleased (Doğacan Güney via Stack) HBASE-1048 HLog: Found 0 logs to remove out of total 1450; oldest outstanding seqnum is 162297053 fr om region -ROOT-,,0 + HBASE-1055 Better vm stats on startup NEW FEATURES HBASE-875 Use MurmurHash instead of JenkinsHash [in bloomfilters] diff --git a/bin/hbase-daemon.sh b/bin/hbase-daemon.sh index ce08d826333..06b371e0a09 100755 --- a/bin/hbase-daemon.sh +++ b/bin/hbase-daemon.sh @@ -126,7 +126,6 @@ case $startStop in echo starting $command, logging to $logout # Add to the command log file vital stats on our environment. echo "`date` Starting $command on `hostname`" >> $loglog - $JAVA -version >> $loglog 2>&1 echo "ulimit -n `ulimit -n`" >> $loglog 2>&1 nohup nice -n $HBASE_NICENESS "$HBASE_HOME"/bin/hbase \ --config "${HBASE_CONF_DIR}" \ diff --git a/src/java/org/apache/hadoop/hbase/master/HMaster.java b/src/java/org/apache/hadoop/hbase/master/HMaster.java index ffcddac88a1..0098428fa0a 100644 --- a/src/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/src/java/org/apache/hadoop/hbase/master/HMaster.java @@ -20,6 +20,8 @@ package org.apache.hadoop.hbase.master; import java.io.IOException; +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.List; @@ -898,6 +900,12 @@ public class HMaster extends Thread implements HConstants, HMasterInterface, if (cmd.equals("start")) { try { + RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); + if (runtime != null) { + LOG.info("vmName=" + runtime.getVmName() + ", vmVendor=" + + runtime.getVmVendor() + ", vmVersion=" + runtime.getVmVersion()); + LOG.info("vmInputArguments=" + runtime.getInputArguments()); + } // If 'local', defer to LocalHBaseCluster instance. if (LocalHBaseCluster.isLocal(conf)) { (new LocalHBaseCluster(conf)).startup(); diff --git a/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 6f9d8937049..ab694603cf8 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.lang.Thread.UncaughtExceptionHandler; import java.lang.management.ManagementFactory; import java.lang.management.MemoryUsage; +import java.lang.management.RuntimeMXBean; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.net.InetSocketAddress; @@ -2094,6 +2095,10 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable { LOG.warn("Not starting a distinct region server because " + "hbase.master is set to 'local' mode"); } else { + RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); + if (runtime != null) { + LOG.info("vmInputArguments=" + runtime.getInputArguments()); + } Constructor c = regionServerClass.getConstructor(HBaseConfiguration.class); HRegionServer hrs = c.newInstance(conf); @@ -2130,4 +2135,4 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable { .getClass(HConstants.REGION_SERVER_IMPL, HRegionServer.class); doMain(args, regionServerClass); } -} \ No newline at end of file +}