hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1388252 - in /hbase/trunk: dev-support/ hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/ hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/...
Date Thu, 20 Sep 2012 22:51:31 GMT
Author: stack
Date: Thu Sep 20 22:51:30 2012
New Revision: 1388252

URL: http://svn.apache.org/viewvc?rev=1388252&view=rev
Log:
HBASE-6848 Make hbase-hadoop-compat findbugs clean

Modified:
    hbase/trunk/dev-support/findbugs-exclude.xml
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/CompatibilityFactory.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/CompatibilitySingletonFactory.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSource.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceFactory.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsWrapper.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseMetricsSource.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/MBeanSource.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/metrics/ReplicationMetricsSource.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/metrics/ThriftServerMetricsSource.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/metrics/ThriftServerMetricsSourceFactory.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics/MetricHistogram.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics/MetricsExecutor.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/metrics2/util/MetricSampleQuantiles.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/util/MetricSampleQuantiles.java

Modified: hbase/trunk/dev-support/findbugs-exclude.xml
URL: http://svn.apache.org/viewvc/hbase/trunk/dev-support/findbugs-exclude.xml?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/dev-support/findbugs-exclude.xml (original)
+++ hbase/trunk/dev-support/findbugs-exclude.xml Thu Sep 20 22:51:30 2012
@@ -43,6 +43,12 @@
        <Bug pattern="NP_BOOLEAN_RETURN_NULL" />
      </Match>
 
+      <!-- This is read by a thread from hadoop and findbugs never finds it -->
+     <Match>
+       <Bug code="UrF"/>
+       <Class name="org.apache.hadoop.hbase.metrics.BaseMetricsSourceImpl"/>
+     </Match>
+
     <Match>
        <Class name="org.apache.hadoop.hbase.regionserver.StoreFile$Writer" />
        <Bug pattern="NP_NULL_PARAM_DEREF" />

Modified: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/CompatibilityFactory.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/CompatibilityFactory.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/CompatibilityFactory.java
(original)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/CompatibilityFactory.java
Thu Sep 20 22:51:30 2012
@@ -33,6 +33,11 @@ public class CompatibilityFactory {
   public static final String EXCEPTION_START = "Could not create  ";
   public static final String EXCEPTION_END = " Is the hadoop compatibility jar on the classpath?";
 
+  /**
+   * This is a static only class don't let any instance be created.
+   */
+  protected CompatibilityFactory() {}
+
   public static synchronized <T> T getInstance(Class<T> klass) {
     T instance = null;
     try {

Modified: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/CompatibilitySingletonFactory.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/CompatibilitySingletonFactory.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/CompatibilitySingletonFactory.java
(original)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/CompatibilitySingletonFactory.java
Thu Sep 20 22:51:30 2012
@@ -32,10 +32,14 @@ import java.util.ServiceLoader;
  */
 public class CompatibilitySingletonFactory extends CompatibilityFactory {
   private static final Log LOG = LogFactory.getLog(CompatibilitySingletonFactory.class);
-
   private static final Map<Class, Object> instances = new HashMap<Class, Object>();
 
   /**
+   * This is a static only class don't let anyone create an instance.
+   */
+  protected CompatibilitySingletonFactory() {  }
+
+  /**
    * Get the singleton instance of Any classes defined by compatibiliy jar's
    *
    * @return the singleton

Modified: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSource.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSource.java
(original)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSource.java
Thu Sep 20 22:51:30 2012
@@ -28,78 +28,78 @@ public interface MasterMetricsSource ext
   /**
    * The name of the metrics
    */
-  public static final String METRICS_NAME = "HMaster";
+  static final String METRICS_NAME = "HMaster";
 
   /**
    * The context metrics will be under.
    */
-  public static final String METRICS_CONTEXT = "hmaster";
+  static final String METRICS_CONTEXT = "hmaster";
 
   /**
    * The name of the metrics context that metrics will be under in jmx
    */
-  public static final String METRICS_JMX_CONTEXT = "HMaster";
+  static final String METRICS_JMX_CONTEXT = "HMaster";
 
   /**
    * Description
    */
-  public static final String METRICS_DESCRIPTION = "Metrics about HBase master server";
+  static final String METRICS_DESCRIPTION = "Metrics about HBase master server";
 
   // Strings used for exporting to metrics system.
-  public static final String MASTER_ACTIVE_TIME_NAME = "masterActiveTime";
-  public static final String MASTER_START_TIME_NAME = "masterStartTime";
-  public static final String AVERAGE_LOAD_NAME = "averageLoad";
-  public static final String NUM_REGION_SERVERS_NAME = "numRegionServers";
-  public static final String NUM_DEAD_REGION_SERVERS_NAME = "numDeadRegionServers";
-  public static final String ZOOKEEPER_QUORUM_NAME = "zookeeperQuorum";
-  public static final String SERVER_NAME_NAME = "serverName";
-  public static final String CLUSTER_ID_NAME = "clusterId";
-  public static final String IS_ACTIVE_MASTER_NAME = "isActiveMaster";
-  public static final String SPLIT_TIME_NAME = "hlogSplitTime";
-  public static final String SPLIT_SIZE_NAME = "hlogSplitSize";
-  public static final String CLUSTER_REQUESTS_NAME = "clusterRequests";
-  public static final String RIT_COUNT_NAME = "ritCount";
-  public static final String RIT_COUNT_OVER_THRESHOLD_NAME = "ritCountOverThreshold";
-  public static final String RIT_OLDEST_AGE_NAME = "ritOldestAge";
-  public static final String MASTER_ACTIVE_TIME_DESC = "Master Active Time";
-  public static final String MASTER_START_TIME_DESC = "Master Start Time";
-  public static final String AVERAGE_LOAD_DESC = "AverageLoad";
-  public static final String NUMBER_OF_REGION_SERVERS_DESC = "Number of RegionServers";
-  public static final String NUMBER_OF_DEAD_REGION_SERVERS_DESC = "Number of dead RegionServers";
-  public static final String ZOOKEEPER_QUORUM_DESC = "Zookeeper Quorum";
-  public static final String SERVER_NAME_DESC = "Server Name";
-  public static final String CLUSTER_ID_DESC = "Cluster Id";
-  public static final String IS_ACTIVE_MASTER_DESC = "Is Active Master";
-  public static final String SPLIT_TIME_DESC = "Time it takes to finish HLog.splitLog()";
-  public static final String SPLIT_SIZE_DESC = "Size of HLog files being split";
+  static final String MASTER_ACTIVE_TIME_NAME = "masterActiveTime";
+  static final String MASTER_START_TIME_NAME = "masterStartTime";
+  static final String AVERAGE_LOAD_NAME = "averageLoad";
+  static final String NUM_REGION_SERVERS_NAME = "numRegionServers";
+  static final String NUM_DEAD_REGION_SERVERS_NAME = "numDeadRegionServers";
+  static final String ZOOKEEPER_QUORUM_NAME = "zookeeperQuorum";
+  static final String SERVER_NAME_NAME = "serverName";
+  static final String CLUSTER_ID_NAME = "clusterId";
+  static final String IS_ACTIVE_MASTER_NAME = "isActiveMaster";
+  static final String SPLIT_TIME_NAME = "hlogSplitTime";
+  static final String SPLIT_SIZE_NAME = "hlogSplitSize";
+  static final String CLUSTER_REQUESTS_NAME = "clusterRequests";
+  static final String RIT_COUNT_NAME = "ritCount";
+  static final String RIT_COUNT_OVER_THRESHOLD_NAME = "ritCountOverThreshold";
+  static final String RIT_OLDEST_AGE_NAME = "ritOldestAge";
+  static final String MASTER_ACTIVE_TIME_DESC = "Master Active Time";
+  static final String MASTER_START_TIME_DESC = "Master Start Time";
+  static final String AVERAGE_LOAD_DESC = "AverageLoad";
+  static final String NUMBER_OF_REGION_SERVERS_DESC = "Number of RegionServers";
+  static final String NUMBER_OF_DEAD_REGION_SERVERS_DESC = "Number of dead RegionServers";
+  static final String ZOOKEEPER_QUORUM_DESC = "Zookeeper Quorum";
+  static final String SERVER_NAME_DESC = "Server Name";
+  static final String CLUSTER_ID_DESC = "Cluster Id";
+  static final String IS_ACTIVE_MASTER_DESC = "Is Active Master";
+  static final String SPLIT_TIME_DESC = "Time it takes to finish HLog.splitLog()";
+  static final String SPLIT_SIZE_DESC = "Size of HLog files being split";
 
 
   /**
    * Increment the number of requests the cluster has seen.
    * @param inc Ammount to increment the total by.
    */
-  public void incRequests(final int inc);
+  void incRequests(final int inc);
 
   /**
    * Set the number of regions in transition.
    * @param ritCount count of the regions in transition.
    */
-  public void setRIT(int ritCount);
+  void setRIT(int ritCount);
 
   /**
    * Set the count of the number of regions that have been in transition over the threshold
time.
    * @param ritCountOverThreshold number of regions in transition for longer than threshold.
    */
-  public void setRITCountOverThreshold(int ritCountOverThreshold);
+  void setRITCountOverThreshold(int ritCountOverThreshold);
 
   /**
    * Set the oldest region in transition.
    * @param age age of the oldest RIT.
    */
-  public void setRITOldestAge(long age);
+  void setRITOldestAge(long age);
 
-  public void updateSplitTime(long time);
+  void updateSplitTime(long time);
 
-  public void updateSplitSize(long size);
+  void updateSplitSize(long size);
 
 }

Modified: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceFactory.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceFactory.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceFactory.java
(original)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceFactory.java
Thu Sep 20 22:51:30 2012
@@ -23,6 +23,6 @@ package org.apache.hadoop.hbase.master.m
  */
 public interface MasterMetricsSourceFactory {
 
-  public MasterMetricsSource create(MasterMetricsWrapper beanWrapper);
+  MasterMetricsSource create(MasterMetricsWrapper beanWrapper);
 
 }

Modified: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsWrapper.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsWrapper.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsWrapper.java
(original)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsWrapper.java
Thu Sep 20 22:51:30 2012
@@ -27,59 +27,59 @@ public interface MasterMetricsWrapper {
   /**
    * Get ServerName
    */
-  public String getServerName();
+  String getServerName();
 
   /**
    * Get Average Load
    * @return Average Load
    */
-  public double getAverageLoad();
+  double getAverageLoad();
 
   /**
    * Get the Cluster ID
    * @return Cluster ID
    */
-  public String getClusterId();
+  String getClusterId();
 
   /**
    * Get the Zookeeper Quorum Info
    * @return Zookeeper Quorum Info
    */
-  public String getZookeeperQuorum();
+  String getZookeeperQuorum();
 
   /**
    * Get the co-processors
    * @return Co-processors
    */
-  public String[] getCoprocessors();
+  String[] getCoprocessors();
 
   /**
    * Get hbase master start time
    * @return Start time of master in milliseconds
    */
-  public long getMasterStartTime();
+  long getMasterStartTime();
 
   /**
    * Get the hbase master active time
    * @return Time in milliseconds when master became active
    */
-  public long getMasterActiveTime();
+  long getMasterActiveTime();
 
   /**
    * Whether this master is the active master
    * @return True if this is the active master
    */
-  public boolean getIsActiveMaster();
+  boolean getIsActiveMaster();
 
   /**
    * Get the live region servers
    * @return Live region servers
    */
-  public int getRegionServers();
+  int getRegionServers();
 
   /**
    * Get the dead region servers
    * @return Dead region Servers
    */
-  public int getDeadRegionServers();
+  int getDeadRegionServers();
 }

Modified: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseMetricsSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseMetricsSource.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseMetricsSource.java
(original)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseMetricsSource.java
Thu Sep 20 22:51:30 2012
@@ -26,7 +26,7 @@ public interface BaseMetricsSource {
   /**
    * Clear out the metrics and re-prepare the source.
    */
-  public void init();
+  void init();
 
   /**
    * Set a gauge to a specific value.
@@ -34,7 +34,7 @@ public interface BaseMetricsSource {
    * @param gaugeName the name of the gauge
    * @param value     the value
    */
-  public void setGauge(String gaugeName, long value);
+  void setGauge(String gaugeName, long value);
 
   /**
    * Add some amount to a gauge.
@@ -42,7 +42,7 @@ public interface BaseMetricsSource {
    * @param gaugeName the name of the gauge
    * @param delta     the amount to change the gauge by.
    */
-  public void incGauge(String gaugeName, long delta);
+  void incGauge(String gaugeName, long delta);
 
   /**
    * Subtract some amount from a gauge.
@@ -50,14 +50,14 @@ public interface BaseMetricsSource {
    * @param gaugeName the name of the gauge
    * @param delta     the amount to change the gauge by.
    */
-  public void decGauge(String gaugeName, long delta);
+  void decGauge(String gaugeName, long delta);
 
   /**
    * Remove a gauge and no longer announce it.
    *
    * @param key Name of the gauge to remove.
    */
-  public void removeGauge(String key);
+  void removeGauge(String key);
 
   /**
    * Add some amount to a counter.
@@ -65,7 +65,7 @@ public interface BaseMetricsSource {
    * @param counterName the name of the counter
    * @param delta       the amount to change the counter by.
    */
-  public void incCounters(String counterName, long delta);
+  void incCounters(String counterName, long delta);
 
   /**
    * Add some value to a histogram.
@@ -73,7 +73,7 @@ public interface BaseMetricsSource {
    * @param name the name of the histogram
    * @param value the value to add to the histogram
    */
-  public void updateHistogram(String name, long value);
+  void updateHistogram(String name, long value);
 
 
   /**
@@ -82,7 +82,7 @@ public interface BaseMetricsSource {
    * @param name the name of the quantile
    * @param value the value to add to the quantile
    */
-  public void updateQuantile(String name, long value);
+  void updateQuantile(String name, long value);
 
 
   /**
@@ -90,6 +90,6 @@ public interface BaseMetricsSource {
    *
    * @param key
    */
-  public void removeCounter(String key);
+  void removeCounter(String key);
 
 }

Modified: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/MBeanSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/MBeanSource.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/MBeanSource.java
(original)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/MBeanSource.java
Thu Sep 20 22:51:30 2012
@@ -32,7 +32,7 @@ public interface MBeanSource  {
    * @param theMbean the actual MBean
    * @return ObjectName from jmx
    */
-  public ObjectName register(String serviceName, String metricsName,
+  ObjectName register(String serviceName, String metricsName,
                              Object theMbean);
 
 }

Modified: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/metrics/ReplicationMetricsSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/metrics/ReplicationMetricsSource.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/metrics/ReplicationMetricsSource.java
(original)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/metrics/ReplicationMetricsSource.java
Thu Sep 20 22:51:30 2012
@@ -28,21 +28,21 @@ public interface ReplicationMetricsSourc
   /**
    * The name of the metrics
    */
-  public static final String METRICS_NAME = "ReplicationMetrics";
+  static final String METRICS_NAME = "ReplicationMetrics";
 
   /**
    * The name of the metrics context that metrics will be under.
    */
-  public static final String METRICS_CONTEXT = "replicationmetrics";
+  static final String METRICS_CONTEXT = "replicationmetrics";
 
   /**
    * The name of the metrics context that metrics will be under.
    */
-  public static final String METRICS_JMX_CONTEXT = "ReplicationMetrics";
+  static final String METRICS_JMX_CONTEXT = "ReplicationMetrics";
 
   /**
    * A description.
    */
-  public static final String METRICS_DESCRIPTION = "Metrics about HBase replication";
+  static final String METRICS_DESCRIPTION = "Metrics about HBase replication";
 
 }

Modified: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/metrics/ThriftServerMetricsSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/metrics/ThriftServerMetricsSource.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/metrics/ThriftServerMetricsSource.java
(original)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/metrics/ThriftServerMetricsSource.java
Thu Sep 20 22:51:30 2012
@@ -25,54 +25,54 @@ import org.apache.hadoop.hbase.metrics.B
  */
 public interface ThriftServerMetricsSource extends BaseMetricsSource {
 
-  public static final String BATCH_GET_KEY = "batchGet";
-  public static final String BATCH_MUTATE_KEY = "batchMutate";
-  public static final String TIME_IN_QUEUE_KEY = "timeInQueue";
-  public static final String THRIFT_CALL_KEY = "thriftCall";
-  public static final String SLOW_THRIFT_CALL_KEY = "slowThriftCall";
-  public static final String CALL_QUEUE_LEN_KEY = "callQueueLen";
+  static final String BATCH_GET_KEY = "batchGet";
+  static final String BATCH_MUTATE_KEY = "batchMutate";
+  static final String TIME_IN_QUEUE_KEY = "timeInQueue";
+  static final String THRIFT_CALL_KEY = "thriftCall";
+  static final String SLOW_THRIFT_CALL_KEY = "slowThriftCall";
+  static final String CALL_QUEUE_LEN_KEY = "callQueueLen";
 
   /**
    * Add how long an operation was in the queue.
    * @param time
    */
-  public void incTimeInQueue(long time);
+  void incTimeInQueue(long time);
 
   /**
    * Set the call queue length.
    * @param len Time
    */
-  public void setCallQueueLen(int len);
+  void setCallQueueLen(int len);
 
   /**
    * Add how many keys were in a batch get.
    * @param diff Num Keys
    */
-  public void incNumRowKeysInBatchGet(int diff);
+  void incNumRowKeysInBatchGet(int diff);
 
   /**
    * Add how many keys were in a batch mutate.
    * @param diff Num Keys
    */
-  public void incNumRowKeysInBatchMutate(int diff);
+  void incNumRowKeysInBatchMutate(int diff);
 
   /**
    * Add how long a method took
    * @param name Method name
    * @param time Time
    */
-  public void incMethodTime(String name, long time);
+  void incMethodTime(String name, long time);
 
   /**
    * Add how long a call took
    * @param time Time
    */
-  public void incCall(long time);
+  void incCall(long time);
 
   /**
    * Increment how long a slow call took.
    * @param time Time
    */
-  public void incSlowCall(long time);
+  void incSlowCall(long time);
 
 }

Modified: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/metrics/ThriftServerMetricsSourceFactory.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/metrics/ThriftServerMetricsSourceFactory.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/metrics/ThriftServerMetricsSourceFactory.java
(original)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/metrics/ThriftServerMetricsSourceFactory.java
Thu Sep 20 22:51:30 2012
@@ -21,15 +21,15 @@ package org.apache.hadoop.hbase.thrift.m
 /** Factory that will be used to create metrics sources for the two diffent types of thrift
servers. */
 public interface ThriftServerMetricsSourceFactory {
 
-  public static final String METRICS_NAME = "Thrift";
-  public static final String METRICS_DESCRIPTION = "Thrift Server Metrics";
-  public static final String THRIFT_ONE_METRICS_CONTEXT = "thrift-one";
-  public static final String THRIFT_ONE_JMX_CONTEXT = "Thrift,sub=ThriftOne";
-  public static final String THRIFT_TWO_METRICS_CONTEXT = "thrift-two";
-  public static final String THRIFT_TWO_JMX_CONTEXT = "Thrift,sub=ThriftTwo";
+  static final String METRICS_NAME = "Thrift";
+  static final String METRICS_DESCRIPTION = "Thrift Server Metrics";
+  static final String THRIFT_ONE_METRICS_CONTEXT = "thrift-one";
+  static final String THRIFT_ONE_JMX_CONTEXT = "Thrift,sub=ThriftOne";
+  static final String THRIFT_TWO_METRICS_CONTEXT = "thrift-two";
+  static final String THRIFT_TWO_JMX_CONTEXT = "Thrift,sub=ThriftTwo";
 
-  public ThriftServerMetricsSource createThriftOneSource();
+  ThriftServerMetricsSource createThriftOneSource();
 
-  public ThriftServerMetricsSource createThriftTwoSource();
+  ThriftServerMetricsSource createThriftTwoSource();
 
 }

Modified: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics/MetricHistogram.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics/MetricHistogram.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics/MetricHistogram.java
(original)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics/MetricHistogram.java
Thu Sep 20 22:51:30 2012
@@ -23,16 +23,15 @@ package org.apache.hadoop.metrics;
  */
 public interface MetricHistogram {
 
-  public static final String NUM_OPS_METRIC_NAME = "_num_ops";
-  public static final String MIN_METRIC_NAME = "_min";
-  public static final String MAX_METRIC_NAME = "_max";
-  public static final String MEAN_METRIC_NAME = "_mean";
-  public static final String STD_DEV_METRIC_NAME = "_std_dev";
-  public static final String MEDIAN_METRIC_NAME = "_median";
-  public static final String SEVENTY_FIFTH_PERCENTILE_METRIC_NAME = "_75th_percentile";
-  public static final String NINETY_FIFTH_PERCENTILE_METRIC_NAME = "_95th_percentile";
-  public static final String NINETY_NINETH_PERCENTILE_METRIC_NAME = "_99th_percentile";
+  static final String NUM_OPS_METRIC_NAME = "_num_ops";
+  static final String MIN_METRIC_NAME = "_min";
+  static final String MAX_METRIC_NAME = "_max";
+  static final String MEAN_METRIC_NAME = "_mean";
+  static final String MEDIAN_METRIC_NAME = "_median";
+  static final String SEVENTY_FIFTH_PERCENTILE_METRIC_NAME = "_75th_percentile";
+  static final String NINETY_FIFTH_PERCENTILE_METRIC_NAME = "_95th_percentile";
+  static final String NINETY_NINETH_PERCENTILE_METRIC_NAME = "_99th_percentile";
 
-  public void add(long value);
+  void add(long value);
 
 }

Modified: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics/MetricsExecutor.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics/MetricsExecutor.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics/MetricsExecutor.java
(original)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics/MetricsExecutor.java
Thu Sep 20 22:51:30 2012
@@ -25,8 +25,8 @@ import java.util.concurrent.ScheduledExe
  */
 public interface MetricsExecutor {
 
-  public ScheduledExecutorService getExecutor();
+  ScheduledExecutorService getExecutor();
 
-  public void stop();
+  void stop();
 
 }

Modified: hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceImpl.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceImpl.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceImpl.java
(original)
+++ hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceImpl.java
Thu Sep 20 22:51:30 2012
@@ -79,7 +79,7 @@ public class MasterMetricsSourceImpl
   }
 
   public void setRITOldestAge(long ritCount) {
-    ritCountOverThresholdGauge.set(ritCount);
+    ritOldestAgeGauge.set(ritCount);
   }
 
   @Override

Modified: hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseMetricsSourceImpl.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseMetricsSourceImpl.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseMetricsSourceImpl.java
(original)
+++ hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseMetricsSourceImpl.java
Thu Sep 20 22:51:30 2012
@@ -19,35 +19,37 @@
 package org.apache.hadoop.hbase.metrics;
 
 import org.apache.hadoop.metrics2.MetricsBuilder;
-import org.apache.hadoop.metrics2.MetricsException;
-import org.apache.hadoop.metrics2.MetricsRecordBuilder;
 import org.apache.hadoop.metrics2.MetricsSource;
 import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
 import org.apache.hadoop.metrics2.lib.DynamicMetricsRegistry;
-import org.apache.hadoop.metrics2.lib.MetricMutable;
 import org.apache.hadoop.metrics2.lib.MetricMutableCounterLong;
 import org.apache.hadoop.metrics2.lib.MetricMutableGaugeLong;
 import org.apache.hadoop.metrics2.lib.MetricMutableHistogram;
 import org.apache.hadoop.metrics2.lib.MetricMutableQuantiles;
 import org.apache.hadoop.metrics2.source.JvmMetricsSource;
 
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
 /**
  * Hadoop 1 implementation of BaseMetricsSource (using metrics2 framework)
  */
 public class BaseMetricsSourceImpl implements BaseMetricsSource, MetricsSource {
 
+  private static enum DefaultMetricsSystemInitializer {
+    INSTANCE;
+    private boolean inited = false;
+    private JvmMetricsSource jvmMetricsSource;
+
+    synchronized void init(String name) {
+      if (inited) return;
+      inited = true;
+      DefaultMetricsSystem.initialize(HBASE_METRICS_SYSTEM_NAME);
+      jvmMetricsSource = JvmMetricsSource.create(name, "");
+
+    }
+  }
   private static boolean defaultMetricsSystemInited = false;
   public static final String HBASE_METRICS_SYSTEM_NAME = "hbase";
 
   protected final DynamicMetricsRegistry metricsRegistry;
-
-  private JvmMetricsSource jvmMetricsSource;
-
-
   protected final String metricsName;
   protected final String metricsDescription;
   protected final String metricsContext;
@@ -65,15 +67,7 @@ public class BaseMetricsSourceImpl imple
     this.metricsJmxContext = metricsJmxContext;
 
     metricsRegistry = new DynamicMetricsRegistry(metricsName).setContext(metricsContext);
-
-    if (!defaultMetricsSystemInited) {
-      //Not too worried about mutli-threaded here as all it does is spam the logs.
-      defaultMetricsSystemInited = true;
-      DefaultMetricsSystem.initialize(HBASE_METRICS_SYSTEM_NAME);
-
-      //If this is the first time through register a jvm source.
-      jvmMetricsSource = JvmMetricsSource.create(metricsName, "");
-    }
+    DefaultMetricsSystemInitializer.INSTANCE.init(metricsName);
 
     //Register this instance.
     DefaultMetricsSystem.INSTANCE.registerSource(metricsJmxContext, metricsDescription, this);

Modified: hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/metrics2/util/MetricSampleQuantiles.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/metrics2/util/MetricSampleQuantiles.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/metrics2/util/MetricSampleQuantiles.java
(original)
+++ hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/metrics2/util/MetricSampleQuantiles.java
Thu Sep 20 22:51:30 2012
@@ -70,7 +70,7 @@ public class MetricSampleQuantiles {
   private final MetricQuantile quantiles[];
 
   public MetricSampleQuantiles(MetricQuantile[] quantiles) {
-    this.quantiles = quantiles;
+    this.quantiles = Arrays.copyOf(quantiles, quantiles.length);
     this.samples = new LinkedList<SampleItem>();
   }
 

Modified: hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceImpl.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceImpl.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceImpl.java
(original)
+++ hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceImpl.java
Thu Sep 20 22:51:30 2012
@@ -81,7 +81,7 @@ public class MasterMetricsSourceImpl
   }
 
   public void setRITOldestAge(long ritCount) {
-    ritCountOverThresholdGauge.set(ritCount);
+    ritOldestAgeGauge.set(ritCount);
   }
 
   @Override

Modified: hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseMetricsSourceImpl.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseMetricsSourceImpl.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseMetricsSourceImpl.java
(original)
+++ hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseMetricsSourceImpl.java
Thu Sep 20 22:51:30 2012
@@ -33,7 +33,20 @@ import org.apache.hadoop.metrics2.source
  */
 public class BaseMetricsSourceImpl implements BaseMetricsSource, MetricsSource {
 
-  private static boolean defaultMetricsSystemInited = false;
+  private static enum DefaultMetricsSystemInitializer {
+    INSTANCE;
+    private boolean inited = false;
+    private JvmMetrics jvmMetricsSource;
+
+    synchronized void init(String name) {
+      if (inited) return;
+      inited = true;
+      DefaultMetricsSystem.initialize(HBASE_METRICS_SYSTEM_NAME);
+      jvmMetricsSource = JvmMetrics.create(name, "", DefaultMetricsSystem.instance());
+
+    }
+  }
+
   public static final String HBASE_METRICS_SYSTEM_NAME = "hbase";
 
   protected final DynamicMetricsRegistry metricsRegistry;
@@ -42,8 +55,6 @@ public class BaseMetricsSourceImpl imple
   protected final String metricsContext;
   protected final String metricsJmxContext;
 
-  private JvmMetrics jvmMetricsSource;
-
   public BaseMetricsSourceImpl(
       String metricsName,
       String metricsDescription,
@@ -56,15 +67,9 @@ public class BaseMetricsSourceImpl imple
     this.metricsJmxContext = metricsJmxContext;
 
     metricsRegistry = new DynamicMetricsRegistry(metricsName).setContext(metricsContext);
+    DefaultMetricsSystemInitializer.INSTANCE.init(metricsName);
 
-    if (!defaultMetricsSystemInited) {
-      //Not too worried about mutlithread here as all it does is spam the logs.
-      defaultMetricsSystemInited = true;
-
-      DefaultMetricsSystem.initialize(HBASE_METRICS_SYSTEM_NAME);
-      jvmMetricsSource = JvmMetrics.create(metricsName, "", DefaultMetricsSystem.instance());
-    }
-
+    //Register this instance.
     DefaultMetricsSystem.instance().register(metricsJmxContext, metricsDescription, this);
     init();
 

Modified: hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/util/MetricSampleQuantiles.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/util/MetricSampleQuantiles.java?rev=1388252&r1=1388251&r2=1388252&view=diff
==============================================================================
--- hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/util/MetricSampleQuantiles.java
(original)
+++ hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/util/MetricSampleQuantiles.java
Thu Sep 20 22:51:30 2012
@@ -72,7 +72,7 @@ public class MetricSampleQuantiles {
   private final MetricQuantile quantiles[];
 
   public MetricSampleQuantiles(MetricQuantile[] quantiles) {
-    this.quantiles = quantiles;
+    this.quantiles = Arrays.copyOf(quantiles, quantiles.length);
     this.samples = new LinkedList<SampleItem>();
   }
 



Mime
View raw message