commit 17cf250fb58abf653198017e27a46c73193db0bc Author: todd Date: Tue Apr 13 16:06:07 2010 -0700 HBASE-2440. Add warning to master web UI when running on an unstable JVM diff --git src/java/org/apache/hadoop/hbase/util/JvmVersion.java src/java/org/apache/hadoop/hbase/util/JvmVersion.java new file mode 100644 index 0000000..b7eb7e5 --- /dev/null +++ src/java/org/apache/hadoop/hbase/util/JvmVersion.java @@ -0,0 +1,43 @@ +/** + * Copyright 2007 The Apache Software Foundation + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.util; + +import java.util.HashSet; +import java.util.Set; + +/** + * Certain JVM versions are known to be unstable with HBase. This + * class has a utility function to determine whether the current JVM + * is known to be unstable. + */ +public abstract class JvmVersion { + private static Set BAD_JVM_VERSIONS = new HashSet(); + static { + BAD_JVM_VERSIONS.add("1.6.0_18"); + } + + /** + * Return true if the current JVM is known to be unstable. + */ + public static boolean isBadJvmVersion() { + String version = System.getProperty("java.version"); + return version != null && BAD_JVM_VERSIONS.contains(version); + } +} diff --git src/webapps/master/master.jsp src/webapps/master/master.jsp index 2dbd275..ab8406f 100644 --- src/webapps/master/master.jsp +++ src/webapps/master/master.jsp @@ -3,6 +3,7 @@ import="java.net.URLEncoder" import="org.apache.hadoop.io.Text" import="org.apache.hadoop.hbase.util.Bytes" + import="org.apache.hadoop.hbase.util.JvmVersion" import="org.apache.hadoop.hbase.master.HMaster" import="org.apache.hadoop.hbase.HConstants" import="org.apache.hadoop.hbase.master.MetaRegion" @@ -32,10 +33,19 @@ -

Master: <%=master.getMasterAddress().getHostname()%>:<%=master.getMasterAddress().getPort()%>

+ +<% if (JvmVersion.isBadJvmVersion()) { %> +
+ Your current JVM version <%= System.getProperty("java.version") %> is known to be + unstable with HBase. Please see the + HBase wiki + for details. +
+<% } %> +

Master Attributes

diff --git src/webapps/static/hbase.css src/webapps/static/hbase.css index ffa2584..16307ef 100644 --- src/webapps/static/hbase.css +++ src/webapps/static/hbase.css @@ -6,3 +6,10 @@ th { border: thin solid DodgerBlue } #logo {float: left;} #logo img {border: none;} #page_title {padding-top: 27px;} + +div.warning { + border: 1px solid #666; + background-color: #fcc; + font-size: 110%; + font-weight: bold; +}