HBASE-3940 HBase daemons should log version info at startup and possibly periodically

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1135800 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2011-06-14 21:20:14 +00:00
parent 0a48f15c3b
commit 74eb4dd8b3
6 changed files with 19 additions and 1 deletions

View File

@ -261,6 +261,8 @@ Release 0.91.0 - Unreleased
HBASE-3961 Add Delete.setWriteToWAL functionality (Bruno Dumon)
HBASE-3928 Some potential performance improvements to Bytes/KeyValue
HBASE-3982 Improvements to TestHFileSeek
HBASE-3940 HBase daemons should log version info at startup and possibly
periodically (Li Pi)
TASKS
HBASE-3559 Move report of split to master OFF the heartbeat channel

View File

@ -1437,6 +1437,7 @@ implements HMasterInterface, HMasterRegionInterface, MasterServices, Server {
* @see org.apache.hadoop.hbase.master.HMasterCommandLine
*/
public static void main(String [] args) throws Exception {
VersionInfo.logVersion();
new HMasterCommandLine(HMaster.class).doMain(args);
}
}

View File

@ -125,6 +125,7 @@ import org.apache.hadoop.hbase.util.InfoServer;
import org.apache.hadoop.hbase.util.Pair;
import org.apache.hadoop.hbase.util.Sleeper;
import org.apache.hadoop.hbase.util.Threads;
import org.apache.hadoop.hbase.util.VersionInfo;
import org.apache.hadoop.hbase.zookeeper.ClusterStatusTracker;
import org.apache.hadoop.hbase.zookeeper.ZKUtil;
import org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker;
@ -2949,6 +2950,7 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
* @see org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine
*/
public static void main(String[] args) throws Exception {
VersionInfo.logVersion();
Configuration conf = HBaseConfiguration.create();
@SuppressWarnings("unchecked")
Class<? extends HRegionServer> regionServerClass = (Class<? extends HRegionServer>) conf

View File

@ -31,6 +31,7 @@ import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.rest.filter.GzipFilter;
import org.apache.hadoop.hbase.util.VersionInfo;
import java.util.List;
import java.util.ArrayList;
@ -68,6 +69,7 @@ public class Main implements Constants {
public static void main(String[] args) throws Exception {
Log LOG = LogFactory.getLog("RESTServer");
VersionInfo.logVersion();
Configuration conf = HBaseConfiguration.create();
RESTServlet servlet = RESTServlet.getInstance(conf);

View File

@ -70,6 +70,7 @@ import org.apache.hadoop.hbase.thrift.generated.TRegionInfo;
import org.apache.hadoop.hbase.thrift.generated.TRowResult;
import org.apache.hadoop.hbase.thrift.generated.TScan;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.VersionInfo;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TCompactProtocol;
@ -1022,7 +1023,6 @@ public class ThriftServer {
serverArgs.processor(processor);
serverArgs.protocolFactory(protocolFactory);
serverArgs.transportFactory(transportFactory);
LOG.info("starting HBase ThreadPool Thrift server on " + listenAddress + ":" + Integer.toString(listenPort));
server = new TThreadPoolServer(serverArgs);
}
@ -1035,6 +1035,7 @@ public class ThriftServer {
* @throws Exception
*/
public static void main(String [] args) throws Exception {
VersionInfo.logVersion();
doMain(args);
}
}

View File

@ -20,13 +20,17 @@
package org.apache.hadoop.hbase.util;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hbase.VersionAnnotation;
import org.apache.hadoop.hbase.master.HMaster;
import org.apache.commons.logging.Log;
/**
* This class finds the package info for hbase and the VersionAnnotation
* information. Taken from hadoop. Only name of annotation is different.
*/
public class VersionInfo {
private static final Log LOG = LogFactory.getLog(VersionInfo.class.getName());
private static Package myPackage;
private static VersionAnnotation version;
@ -82,6 +86,12 @@ public class VersionInfo {
public static String getUrl() {
return version != null ? version.url() : "Unknown";
}
public static void logVersion(){
LOG.info("HBase " + getVersion());
LOG.info("Subversion " + getUrl() + " -r " + getRevision());
LOG.info("Compiled by " + getUser() + " on " + getDate());
}
public static void main(String[] args) {
System.out.println("HBase " + getVersion());