hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecl...@apache.org
Subject svn commit: r1406396 [1/6] - 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/ hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/met...
Date Tue, 06 Nov 2012 23:22:09 GMT
Author: eclark
Date: Tue Nov  6 23:22:01 2012
New Revision: 1406396

URL: http://svn.apache.org/viewvc?rev=1406396&view=rev
Log:
HBASE-6410 Move RegionServer Metrics to metrics2

Added:
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSource.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSourceFactory.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapper.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseSource.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionAggregateSource.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSource.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceFactory.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapper.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSource.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionWrapper.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationSource.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/rest/MetricsRESTSource.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSource.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSourceFactory.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/MetricHistogram.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/MetricsExecutor.java
    hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceFactory.java
    hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/
    hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceFactory.java
    hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceFactory.java
    hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/rest/TestMetricsRESTSource.java
    hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/thrift/TestMetricsThriftServerSourceFactory.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSourceFactoryImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/regionserver/
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionAggregateSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceFactoryImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/rest/MetricsRESTSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSourceFactoryImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/metrics2/impl/
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/metrics2/impl/JmxCacheBuster.java
    hbase/trunk/hbase-hadoop1-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.master.MetricsMasterSourceFactory
    hbase/trunk/hbase-hadoop1-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.regionserver.MetricsRegionServerSourceFactory
    hbase/trunk/hbase-hadoop1-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.replication.regionserver.MetricsReplicationSource
    hbase/trunk/hbase-hadoop1-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.rest.MetricsRESTSource
    hbase/trunk/hbase-hadoop1-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.thrift.MetricsThriftServerSourceFactory
    hbase/trunk/hbase-hadoop1-compat/src/main/resources/META-INF/services/org.apache.hadoop.metrics2.MetricsExecutor
    hbase/trunk/hbase-hadoop1-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/test/java/org/apache/hadoop/hbase/metrics/TestBaseSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/test/java/org/apache/hadoop/hbase/regionserver/
    hbase/trunk/hbase-hadoop1-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/test/java/org/apache/hadoop/hbase/rest/TestRESTMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServerMetricsSourceFactoryImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSourceFactoryImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionAggregateSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceFactoryImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/rest/MetricsRESTSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSourceFactoryImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/impl/
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/impl/JmxCacheBuster.java
    hbase/trunk/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.master.MetricsMasterSourceFactory
    hbase/trunk/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.regionserver.MetricsRegionServerSourceFactory
    hbase/trunk/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.replication.regionserver.MetricsReplicationSource
    hbase/trunk/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.rest.MetricsRESTSource
    hbase/trunk/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.thrift.MetricsThriftServerSourceFactory
    hbase/trunk/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.metrics2.MetricsExecutor
    hbase/trunk/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/metrics/TestBaseSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/regionserver/
    hbase/trunk/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/rest/TestMetricsRESTSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/thrift/TestMetricsThriftServerSourceFactoryImpl.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMaster.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapperImpl.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegion.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServer.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionWrapperImpl.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsSink.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsSource.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/MetricsREST.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetricsWrapper.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperStub.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MetricsRegionWrapperStub.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegion.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServer.java
Removed:
    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/replication/regionserver/metrics/ReplicationMetricsSource.java
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/rest/metrics/RESTMetricsSource.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-hadoop-compat/src/test/java/org/apache/hadoop/hbase/master/metrics/TestMasterMetricsSourceFactory.java
    hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/metrics/TestReplicationMetricsSourceFactory.java
    hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/rest/metrics/TestRESTMetricsSource.java
    hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/thrift/metrics/TestThriftServerMetricsSourceFactory.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceFactoryImpl.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/hbase/replication/regionserver/metrics/ReplicationMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/rest/metrics/RESTMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/thrift/metrics/ThriftServerMetricsSourceFactoryImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/hbase/thrift/metrics/ThriftServerMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.master.metrics.MasterMetricsSourceFactory
    hbase/trunk/hbase-hadoop1-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.replication.regionserver.metrics.ReplicationMetricsSource
    hbase/trunk/hbase-hadoop1-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.rest.metrics.RESTMetricsSource
    hbase/trunk/hbase-hadoop1-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.thrift.metrics.ThriftServerMetricsSourceFactory
    hbase/trunk/hbase-hadoop1-compat/src/test/java/org/apache/hadoop/hbase/master/metrics/TestMasterMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/test/java/org/apache/hadoop/hbase/metrics/TestBaseMetricsSourceImplTest.java
    hbase/trunk/hbase-hadoop1-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/metrics/TestReplicationMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/test/java/org/apache/hadoop/hbase/rest/metrics/TestRESTMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/test/java/org/apache/hadoop/hbase/thrift/metrics/TestThriftServerMetricsSourceFactoryImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsSourceFactoryImpl.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/hbase/replication/regionserver/metrics/ReplicationMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/rest/metrics/RESTMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/thrift/metrics/ThriftServerMetricsSourceFactoryImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/thrift/metrics/ThriftServerMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.master.metrics.MasterMetricsSourceFactory
    hbase/trunk/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.replication.regionserver.metrics.ReplicationMetricsSource
    hbase/trunk/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.rest.metrics.RESTMetricsSource
    hbase/trunk/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.thrift.metrics.ThriftServerMetricsSourceFactory
    hbase/trunk/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/master/metrics/TestMasterMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/metrics/TestBaseMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/metrics/TestReplicationMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/rest/metrics/TestRESTMetricsSourceImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/thrift/metrics/TestThriftServerMetricsSourceFactoryImpl.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetrics.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/metrics/MasterMetricsWrapperImpl.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MXBean.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MXBeanImpl.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/OperationMetrics.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionMetricsStorage.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerDynamicMetrics.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerDynamicStatistics.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerStatistics.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaConfigured.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaMetrics.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/metrics/ReplicationSinkMetrics.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/metrics/ReplicationSourceMetrics.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/metrics/RESTMetrics.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/metrics/TestMasterMetricsWrapper.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMXBean.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/metrics/TestSchemaConfigured.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/metrics/TestSchemaMetrics.java
Modified:
    hbase/trunk/dev-support/findbugs-exclude.xml
    hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/CompatibilitySingletonFactory.java
    hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/test/MetricsAssertHelper.java
    hbase/trunk/hbase-hadoop1-compat/pom.xml
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/metrics2/lib/DynamicMetricsRegistry.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/metrics2/lib/MetricMutableHistogram.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/metrics2/lib/MetricMutableQuantiles.java
    hbase/trunk/hbase-hadoop1-compat/src/main/java/org/apache/hadoop/metrics2/lib/MetricsExecutorImpl.java
    hbase/trunk/hbase-hadoop1-compat/src/test/java/org/apache/hadoop/hbase/test/MetricsAssertHelperImpl.java
    hbase/trunk/hbase-hadoop2-compat/pom.xml
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/DynamicMetricsRegistry.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/MetricMutableQuantiles.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/MetricsExecutorImpl.java
    hbase/trunk/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/MutableHistogram.java
    hbase/trunk/hbase-hadoop2-compat/src/test/java/org/apache/hadoop/hbase/test/MetricsAssertHelperImpl.java
    hbase/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon
    hbase/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
    hbase/trunk/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/AbstractHFileReader.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/AbstractHFileWriter.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/Cacheable.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileDataBlockEncoderImpl.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV1.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV1.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitRequest.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/CompactionRequest.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RESTServlet.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift/ThriftMetrics.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHeapSize.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/CacheTestUtils.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCachedBlockQueue.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestForceCacheImportantBlocks.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileDataBlockEncoder.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileReaderV1.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestLruBlockCache.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestScannerSelectionUsingTTL.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetrics.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/metrics/TestExactCounterMetric.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/metrics/TestExponentiallyDecayingSample.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/metrics/TestMetricsHistogram.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/metrics/TestMetricsMBeanBase.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCacheOnWriteInSchema.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStore.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreScanner.java

Modified: hbase/trunk/dev-support/findbugs-exclude.xml
URL: http://svn.apache.org/viewvc/hbase/trunk/dev-support/findbugs-exclude.xml?rev=1406396&r1=1406395&r2=1406396&view=diff
==============================================================================
--- hbase/trunk/dev-support/findbugs-exclude.xml (original)
+++ hbase/trunk/dev-support/findbugs-exclude.xml Tue Nov  6 23:22:01 2012
@@ -50,7 +50,7 @@
       <!-- 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"/>
+       <Class name="org.apache.hadoop.hbase.metrics.BaseSourceImpl"/>
      </Match>
 
     <Match>

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=1406396&r1=1406395&r2=1406396&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 Tue Nov  6 23:22:01 2012
@@ -44,6 +44,7 @@ public class CompatibilitySingletonFacto
    *
    * @return the singleton
    */
+  @SuppressWarnings("unchecked")
   public static synchronized <T> T getInstance(Class<T> klass) {
     T instance = (T) instances.get(klass);
     if (instance == null) {

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSource.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSource.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSource.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,109 @@
+/**
+ * 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.master;
+
+import org.apache.hadoop.hbase.metrics.BaseSource;
+
+/**
+ * Interface that classes that expose metrics about the master will implement.
+ */
+public interface MetricsMasterSource extends BaseSource {
+
+  /**
+   * The name of the metrics
+   */
+  static final String METRICS_NAME = "Server";
+
+  /**
+   * The context metrics will be under.
+   */
+  static final String METRICS_CONTEXT = "master";
+
+  /**
+   * The name of the metrics context that metrics will be under in jmx
+   */
+  static final String METRICS_JMX_CONTEXT = "Master,sub=" + METRICS_NAME;
+
+  /**
+   * Description
+   */
+  static final String METRICS_DESCRIPTION = "Metrics about HBase master server";
+
+  // Strings used for exporting to metrics system.
+  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.
+   */
+  void incRequests(final int inc);
+
+  /**
+   * Set the number of regions in transition.
+   *
+   * @param ritCount count of the regions in transition.
+   */
+  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.
+   */
+  void setRITCountOverThreshold(int ritCountOverThreshold);
+
+  /**
+   * Set the oldest region in transition.
+   *
+   * @param age age of the oldest RIT.
+   */
+  void setRITOldestAge(long age);
+
+  void updateSplitTime(long time);
+
+  void updateSplitSize(long size);
+
+}

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSourceFactory.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSourceFactory.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSourceFactory.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterSourceFactory.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,28 @@
+/**
+ * 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.master;
+
+/**
+ * Interface of a factory to create MetricsMasterSource when given a MetricsMasterWrapper
+ */
+public interface MetricsMasterSourceFactory {
+
+  MetricsMasterSource create(MetricsMasterWrapper masterWrapper);
+
+}

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapper.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapper.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapper.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapper.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,94 @@
+/**
+ * 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.master;
+
+/**
+ * This is the interface that will expose information to hadoop1/hadoop2 implementations of the
+ * MetricsMasterSource.
+ */
+public interface MetricsMasterWrapper {
+
+  /**
+   * Get ServerName
+   */
+  String getServerName();
+
+  /**
+   * Get Average Load
+   *
+   * @return Average Load
+   */
+  double getAverageLoad();
+
+  /**
+   * Get the Cluster ID
+   *
+   * @return Cluster ID
+   */
+  String getClusterId();
+
+  /**
+   * Get the Zookeeper Quorum Info
+   *
+   * @return Zookeeper Quorum Info
+   */
+  String getZookeeperQuorum();
+
+  /**
+   * Get the co-processors
+   *
+   * @return Co-processors
+   */
+  String[] getCoprocessors();
+
+  /**
+   * Get hbase master start time
+   *
+   * @return Start time of master in milliseconds
+   */
+  long getStartTime();
+
+  /**
+   * Get the hbase master active time
+   *
+   * @return Time in milliseconds when master became active
+   */
+  long getActiveTime();
+
+  /**
+   * Whether this master is the active master
+   *
+   * @return True if this is the active master
+   */
+  boolean getIsActiveMaster();
+
+  /**
+   * Get the live region servers
+   *
+   * @return Live region servers
+   */
+  int getRegionServers();
+
+  /**
+   * Get the dead region servers
+   *
+   * @return Dead region Servers
+   */
+  int getDeadRegionServers();
+}

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseSource.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseSource.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/metrics/BaseSource.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,89 @@
+/**
+ * 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.metrics;
+
+/**
+ *   BaseSource for dynamic metrics to announce to Metrics2
+ */
+public interface BaseSource {
+
+  public static final String HBASE_METRICS_SYSTEM_NAME = "HBase";
+
+  /**
+   * Clear out the metrics and re-prepare the source.
+   */
+  void init();
+
+  /**
+   * Set a gauge to a specific value.
+   *
+   * @param gaugeName the name of the gauge
+   * @param value     the value
+   */
+  void setGauge(String gaugeName, long value);
+
+  /**
+   * Add some amount to a gauge.
+   *
+   * @param gaugeName the name of the gauge
+   * @param delta     the amount to change the gauge by.
+   */
+  void incGauge(String gaugeName, long delta);
+
+  /**
+   * Subtract some amount from a gauge.
+   *
+   * @param gaugeName the name of the gauge
+   * @param delta     the amount to change the gauge by.
+   */
+  void decGauge(String gaugeName, long delta);
+
+  /**
+   * Remove a metric and no longer announce it.
+   *
+   * @param key Name of the gauge to remove.
+   */
+  void removeMetric(String key);
+
+  /**
+   * Add some amount to a counter.
+   *
+   * @param counterName the name of the counter
+   * @param delta       the amount to change the counter by.
+   */
+  void incCounters(String counterName, long delta);
+
+  /**
+   * Add some value to a histogram.
+   *
+   * @param name the name of the histogram
+   * @param value the value to add to the histogram
+   */
+  void updateHistogram(String name, long value);
+
+
+  /**
+   * Add some value to a Quantile (An accurate histogram).
+   *
+   * @param name the name of the quantile
+   * @param value the value to add to the quantile
+   */
+  void updateQuantile(String name, long value);
+
+}

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionAggregateSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionAggregateSource.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionAggregateSource.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionAggregateSource.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,62 @@
+/**
+ * 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.regionserver;
+
+import org.apache.hadoop.hbase.metrics.BaseSource;
+
+/**
+ * This interface will be implemented by a MetricsSource that will export metrics from
+ * multiple regions into the hadoop metrics system.
+ */
+public interface MetricsRegionAggregateSource extends BaseSource {
+
+  /**
+   * The name of the metrics
+   */
+  static final String METRICS_NAME = "Regions";
+
+  /**
+   * The name of the metrics context that metrics will be under.
+   */
+  static final String METRICS_CONTEXT = "regionserver";
+
+  /**
+   * Description
+   */
+  static final String METRICS_DESCRIPTION = "Metrics about HBase RegionServer regions and tables";
+
+  /**
+   * The name of the metrics context that metrics will be under in jmx
+   */
+  static final String METRICS_JMX_CONTEXT = "RegionServer,sub=" + METRICS_NAME;
+
+  /**
+   * Register a MetricsRegionSource as being open.
+   *
+   * @param source the source for the region being opened.
+   */
+  void register(MetricsRegionSource source);
+
+  /**
+   * Remove a region's source. This is called when a region is closed.
+   *
+   * @param source The region to remove.
+   */
+  void deregister(MetricsRegionSource source);
+}

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSource.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSource.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSource.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,166 @@
+/**
+ * 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.regionserver;
+
+import org.apache.hadoop.hbase.metrics.BaseSource;
+
+/**
+ * Interface for classes that expose metrics about the regionserver.
+ */
+public interface MetricsRegionServerSource extends BaseSource {
+
+  /**
+   * The name of the metrics
+   */
+  static final String METRICS_NAME = "Server";
+
+  /**
+   * The name of the metrics context that metrics will be under.
+   */
+  static final String METRICS_CONTEXT = "regionserver";
+
+  /**
+   * Description
+   */
+  static final String METRICS_DESCRIPTION = "Metrics about HBase RegionServer";
+
+  /**
+   * The name of the metrics context that metrics will be under in jmx
+   */
+  static final String METRICS_JMX_CONTEXT = "RegionServer,sub=" + METRICS_NAME;
+
+  /**
+   * Update the Put time histogram
+   *
+   * @param t time it took
+   */
+  void updatePut(long t);
+
+  /**
+   * Update the Delete time histogram
+   *
+   * @param t time it took
+   */
+  void updateDelete(long t);
+
+  /**
+   * Update the Get time histogram .
+   *
+   * @param t time it took
+   */
+  void updateGet(long t);
+
+  /**
+   * Update the Increment time histogram.
+   *
+   * @param t time it took
+   */
+  void updateIncrement(long t);
+
+  /**
+   * Update the Append time histogram.
+   *
+   * @param t time it took
+   */
+  void updateAppend(long t);
+
+  // Strings used for exporting to metrics system.
+  static final String REGION_COUNT = "regionCount";
+  static final String REGION_COUNT_DESC = "Number of regions";
+  static final String STORE_COUNT = "storeCount";
+  static final String STORE_COUNT_DESC = "Number of Stores";
+  static final String STOREFILE_COUNT = "storeFileCount";
+  static final String STOREFILE_COUNT_DESC = "Number of Store Files";
+  static final String MEMSTORE_SIZE = "memStoreSize";
+  static final String MEMSTORE_SIZE_DESC = "Size of the memstore";
+  static final String STOREFILE_SIZE = "storeFileSize";
+  static final String STOREFILE_SIZE_DESC = "Size of storefiles being served.";
+  static final String TOTAL_REQUEST_COUNT = "totalRequestCount";
+  static final String TOTAL_REQUEST_COUNT_DESC =
+      "Total number of requests this RegionServer has answered.";
+  static final String READ_REQUEST_COUNT = "readRequestCount";
+  static final String READ_REQUEST_COUNT_DESC =
+      "Number of read requests this region server has answered.";
+  static final String WRITE_REQUEST_COUNT = "writeRequestCount";
+  static final String WRITE_REQUEST_COUNT_DESC =
+      "Number of mutation requests this region server has answered.";
+  static final String CHECK_MUTATE_FAILED_COUNT = "checkMutateFailedCount";
+  static final String CHECK_MUTATE_FAILED_COUNT_DESC =
+      "Number of Check and Mutate calls that failed the checks.";
+  static final String CHECK_MUTATE_PASSED_COUNT = "checkMutatePassedCount";
+  static final String CHECK_MUTATE_PASSED_COUNT_DESC =
+      "Number of Check and Mutate calls that passed the checks.";
+  static final String STOREFILE_INDEX_SIZE = "storeFileIndexSize";
+  static final String STOREFILE_INDEX_SIZE_DESC = "Size of indexes in storefiles on disk.";
+  static final String STATIC_INDEX_SIZE = "staticIndexSize";
+  static final String STATIC_INDEX_SIZE_DESC = "Uncompressed size of the static indexes.";
+  static final String STATIC_BLOOM_SIZE = "staticBloomSize";
+  static final String STATIC_BLOOM_SIZE_DESC =
+      "Uncompressed size of the static bloom filters.";
+  static final String NUMBER_OF_PUTS_WITHOUT_WAL = "putsWithoutWALCount";
+  static final String NUMBER_OF_PUTS_WITHOUT_WAL_DESC =
+      "Number of mutations that have been sent by clients with the write ahead logging turned off.";
+  static final String DATA_SIZE_WITHOUT_WAL = "putsWithoutWALSize";
+  static final String DATA_SIZE_WITHOUT_WAL_DESC =
+      "Size of data that has been sent by clients with the write ahead logging turned off.";
+  static final String PERCENT_FILES_LOCAL = "percentFilesLocal";
+  static final String PERCENT_FILES_LOCAL_DESC =
+      "The percent of HFiles that are stored on the local hdfs data node.";
+  static final String COMPACTION_QUEUE_LENGTH = "compactionQueueLength";
+  static final String COMPACTION_QUEUE_LENGTH_DESC = "Length of the queue for compactions.";
+  static final String FLUSH_QUEUE_LENGTH = "flushQueueLength";
+  static final String FLUSH_QUEUE_LENGTH_DESC = "Length of the queue for region flushes";
+  static final String BLOCK_CACHE_FREE_SIZE = "blockCacheFreeSize";
+  static final String BLOCK_CACHE_FREE_DESC =
+      "Size of the block cache that is not occupied.";
+  static final String BLOCK_CACHE_COUNT = "blockCacheCount";
+  static final String BLOCK_CACHE_COUNT_DESC = "Number of block in the block cache.";
+  static final String BLOCK_CACHE_SIZE = "blockCacheSize";
+  static final String BLOCK_CACHE_SIZE_DESC = "Size of the block cache.";
+  static final String BLOCK_CACHE_HIT_COUNT = "blockCacheHitCount";
+  static final String BLOCK_CACHE_HIT_COUNT_DESC = "Count of the hit on the block cache.";
+  static final String BLOCK_CACHE_MISS_COUNT = "blockCacheMissCount";
+  static final String BLOCK_COUNT_MISS_COUNT_DESC =
+      "Number of requests for a block that missed the block cache.";
+  static final String BLOCK_CACHE_EVICTION_COUNT = "blockCacheEvictionCount";
+  static final String BLOCK_CACHE_EVICTION_COUNT_DESC =
+      "Count of the number of blocks evicted from the block cache.";
+  static final String BLOCK_CACHE_HIT_PERCENT = "blockCountHitPercent";
+  static final String BLOCK_CACHE_HIT_PERCENT_DESC =
+      "Percent of block cache requests that are hits";
+  static final String BLOCK_CACHE_EXPRESS_HIT_PERCENT = "blockCacheExpressHitPercent";
+  static final String BLOCK_CACHE_EXPRESS_HIT_PERCENT_DESC =
+      "The percent of the time that requests with the cache turned on hit the cache.";
+  static final String RS_START_TIME_NAME = "regionServerStartTime";
+  static final String ZOOKEEPER_QUORUM_NAME = "zookeeperQuorum";
+  static final String SERVER_NAME_NAME = "serverName";
+  static final String CLUSTER_ID_NAME = "clusterId";
+  static final String RS_START_TIME_DESC = "RegionServer Start Time";
+  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 UPDATES_BLOCKED_TIME = "updatesBlockedTime";
+  static final String UPDATES_BLOCKED_DESC =
+      "Number of MS updates have been blocked so that the memstore can be flushed.";
+  static final String DELETE_KEY = "delete";
+  static final String GET_KEY = "get";
+  static final String INCREMENT_KEY = "increment";
+  static final String PUT_KEY = "multiput";
+  static final String APPEND_KEY = "append";
+}

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceFactory.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceFactory.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceFactory.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerSourceFactory.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,41 @@
+/**
+ * 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.regionserver;
+
+/**
+ * Interface of a factory to create Metrics Sources used inside of regionservers.
+ */
+public interface MetricsRegionServerSourceFactory {
+
+  /**
+   * Given a wrapper create a MetricsRegionServerSource.
+   *
+   * @param regionServerWrapper The wrapped region server
+   * @return a Metrics Source.
+   */
+  MetricsRegionServerSource createServer(MetricsRegionServerWrapper regionServerWrapper);
+
+  /**
+   * Create a MetricsRegionSource from a MetricsRegionWrapper.
+   *
+   * @param wrapper
+   * @return
+   */
+  MetricsRegionSource createRegion(MetricsRegionWrapper wrapper);
+}

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapper.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapper.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapper.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapper.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,205 @@
+/**
+ * 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.regionserver;
+
+/**
+ * This is the interface that will expose RegionServer information to hadoop1/hadoop2
+ * implementations of the MetricsRegionServerSource.
+ */
+public interface MetricsRegionServerWrapper {
+
+  /**
+   * Get ServerName
+   */
+  public String getServerName();
+
+  /**
+   * Get the Cluster ID
+   *
+   * @return Cluster ID
+   */
+  public String getClusterId();
+
+  /**
+   * Get the Zookeeper Quorum Info
+   *
+   * @return Zookeeper Quorum Info
+   */
+  public String getZookeeperQuorum();
+
+  /**
+   * Get the co-processors
+   *
+   * @return Co-processors
+   */
+  public String getCoprocessors();
+
+  /**
+   * Get HRegionServer start time
+   *
+   * @return Start time of RegionServer in milliseconds
+   */
+  public long getStartCode();
+
+  /**
+   * The number of online regions
+   */
+  long getNumOnlineRegions();
+
+  /**
+   * Get the number of stores hosted on this region server.
+   */
+  long getNumStores();
+
+  /**
+   * Get the number of store files hosted on this region server.
+   */
+  long getNumStoreFiles();
+
+  /**
+   * Get the size of the memstore on this region server.
+   */
+  long getMemstoreSize();
+
+  /**
+   * Get the total size of the store files this region server is serving from.
+   */
+  long getStoreFileSize();
+
+  /**
+   * Get the number of requests per second.
+   */
+  double getRequestsPerSecond();
+
+  /**
+   * Get the total number of requests per second.
+   */
+  long getTotalRequestCount();
+
+  /**
+   * Get the number of read requests to regions hosted on this region server.
+   */
+  long getReadRequestsCount();
+
+  /**
+   * Get the number of write requests to regions hosted on this region server.
+   */
+  long getWriteRequestsCount();
+
+  /**
+   * Get the number of CAS operations that failed.
+   */
+  long getCheckAndMutateChecksFailed();
+
+  /**
+   * Get the number of CAS operations that passed.
+   */
+  long getCheckAndMutateChecksPassed();
+
+  /**
+   * Get the Size of indexes in storefiles on disk.
+   */
+  long getStoreFileIndexSize();
+
+  /**
+   * Get the size of of the static indexes including the roots.
+   */
+  long getTotalStaticIndexSize();
+
+  /**
+   * Get the size of the static bloom filters.
+   */
+  long getTotalStaticBloomSize();
+
+  /**
+   * Number of mutations received with WAL explicitly turned off.
+   */
+  long getNumPutsWithoutWAL();
+
+  /**
+   * Ammount of data in the memstore but not in the WAL because mutations explicitly had their
+   * WAL turned off.
+   */
+  long getDataInMemoryWithoutWAL();
+
+  /**
+   * Get the percent of HFiles' that are local.
+   */
+  int getPercentFileLocal();
+
+  /**
+   * Get the size of the compaction queue
+   */
+  int getCompactionQueueSize();
+
+  /**
+   * Get the size of the flush queue.
+   */
+  int getFlushQueueSize();
+
+  /**
+   * Get the size of the block cache that is free.
+   */
+  long getBlockCacheFreeSize();
+
+  /**
+   * Get the number of items in the block cache.
+   */
+  long getBlockCacheCount();
+
+  /**
+   * Get the total size of the block cache.
+   */
+  long getBlockCacheSize();
+
+  /**
+   * Get the count of hits to the block cache
+   */
+  long getBlockCacheHitCount();
+
+  /**
+   * Get the count of misses to the block cache.
+   */
+  long getBlockCacheMissCount();
+
+  /**
+   * Get the number of items evicted from the block cache.
+   */
+  long getBlockCacheEvictedCount();
+
+  /**
+   * Get the percent of all requests that hit the block cache.
+   */
+  int getBlockCacheHitPercent();
+
+  /**
+   * Get the percent of requests with the block cache turned on that hit the block cache.
+   */
+  int getBlockCacheHitCachingPercent();
+
+  /**
+   * Force a re-computation of the metrics.
+   */
+  void forceRecompute();
+
+  /**
+   * Get the amount of time that updates were blocked.
+   */
+  long getUpdatesBlockedTime();
+}

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSource.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSource.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSource.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,62 @@
+/**
+ * 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.regionserver;
+
+
+/**
+ * This interface will be implemented to allow single regions to push metrics into
+ * MetricsRegionAggregateSource that will in turn push data to the Hadoop metrics system.
+ */
+public interface MetricsRegionSource extends Comparable<MetricsRegionSource> {
+
+  /**
+   * Close the region's metrics as this region is closing.
+   */
+  void close();
+
+  /**
+   * Update related counts of puts.
+   */
+  void updatePut();
+
+  /**
+   * Update related counts of deletes.
+   */
+  void updateDelete();
+
+  /**
+   * Update related counts of gets.
+   */
+  void updateGet();
+
+  /**
+   * Update related counts of increments.
+   */
+  void updateIncrement();
+
+  /**
+   * Update related counts of appends.
+   */
+  void updateAppend();
+
+  /**
+   * Get the aggregate source to which this reports.
+   */
+  MetricsRegionAggregateSource getAggregateSource();
+}

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionWrapper.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionWrapper.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionWrapper.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionWrapper.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,71 @@
+/**
+ * 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.regionserver;
+
+/**
+ * Interface of class that will wrap an HRegion and export numbers so they can be
+ * used in MetricsRegionSource
+ */
+public interface MetricsRegionWrapper {
+
+  /**
+   * Get the name of the table the region belongs to.
+   *
+   * @return The string version of the table name.
+   */
+  String getTableName();
+
+  /**
+   * Get the name of the region.
+   *
+   * @return The encoded name of the region.
+   */
+  String getRegionName();
+
+  /**
+   * Get the number of stores hosted on this region server.
+   */
+  long getNumStores();
+
+  /**
+   * Get the number of store files hosted on this region server.
+   */
+  long getNumStoreFiles();
+
+  /**
+   * Get the size of the memstore on this region server.
+   */
+  long getMemstoreSize();
+
+  /**
+   * Get the total size of the store files this region server is serving from.
+   */
+  long getStoreFileSize();
+
+  /**
+   * Get the total number of read requests that have been issued against this region
+   */
+  long getReadRequestCount();
+
+  /**
+   * Get the total number of mutations that have been issued against this region.
+   */
+  long getWriteRequestCount();
+
+}

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationSource.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationSource.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationSource.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,48 @@
+/**
+ * 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.replication.regionserver;
+
+import org.apache.hadoop.hbase.metrics.BaseSource;
+
+/**
+ * Provides access to gauges and counters. Implementers will hide the details of hadoop1 or
+ * hadoop2's metrics2 classes and publishing.
+ */
+public interface MetricsReplicationSource extends BaseSource {
+  /**
+   * The name of the metrics
+   */
+  static final String METRICS_NAME = "Replication";
+
+  /**
+   * The name of the metrics context that metrics will be under.
+   */
+  static final String METRICS_CONTEXT = "regionserver";
+
+  /**
+   * The name of the metrics context that metrics will be under.
+   */
+  static final String METRICS_JMX_CONTEXT = "RegionServer,sub=" + METRICS_NAME;
+
+  /**
+   * A description.
+   */
+  static final String METRICS_DESCRIPTION = "Metrics about HBase replication";
+
+}

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/rest/MetricsRESTSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/rest/MetricsRESTSource.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/rest/MetricsRESTSource.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/rest/MetricsRESTSource.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,98 @@
+/**
+ * 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.rest;
+
+import org.apache.hadoop.hbase.metrics.BaseSource;
+
+/**
+ * Interface of the Metrics Source that will export data to Hadoop's Metrics2 system.
+ */
+public interface MetricsRESTSource extends BaseSource {
+
+  public static String METRICS_NAME = "REST";
+
+  public static String CONTEXT = "rest";
+
+  public static String JMX_CONTEXT = "REST";
+
+  public static String METRICS_DESCRIPTION = "Metrics about the HBase REST server";
+
+  static String REQUEST_KEY = "requests";
+
+  static String SUCCESSFUL_GET_KEY = "successfulGet";
+
+  static String SUCCESSFUL_PUT_KEY = "successfulPut";
+
+  static String SUCCESSFUL_DELETE_KEY = "successfulDelete";
+
+  static String FAILED_GET_KEY = "failedGet";
+
+  static String FAILED_PUT_KEY = "failedPut";
+
+  static String FAILED_DELETE_KEY = "failedDelete";
+
+  /**
+   * Increment the number of requests
+   *
+   * @param inc Ammount to increment by
+   */
+  void incrementRequests(int inc);
+
+  /**
+   * Increment the number of successful Get requests.
+   *
+   * @param inc Number of successful get requests.
+   */
+  void incrementSucessfulGetRequests(int inc);
+
+  /**
+   * Increment the number of successful Put requests.
+   *
+   * @param inc Number of successful put requests.
+   */
+  void incrementSucessfulPutRequests(int inc);
+
+  /**
+   * Increment the number of successful Delete requests.
+   *
+   * @param inc
+   */
+  void incrementSucessfulDeleteRequests(int inc);
+
+  /**
+   * Increment the number of failed Put Requests.
+   *
+   * @param inc Number of failed Put requests.
+   */
+  void incrementFailedPutRequests(int inc);
+
+  /**
+   * Increment the number of failed Get requests.
+   *
+   * @param inc The number of failed Get Requests.
+   */
+  void incrementFailedGetRequests(int inc);
+
+  /**
+   * Increment the number of failed Delete requests.
+   *
+   * @param inc The number of failed delete requests.
+   */
+  void incrementFailedDeleteRequests(int inc);
+}

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSource.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSource.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSource.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,78 @@
+/**
+ * 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.thrift;
+
+import org.apache.hadoop.hbase.metrics.BaseSource;
+
+/**
+ * Inteface of a class that will export metrics about Thrift to hadoop's metrics2.
+ */
+public interface MetricsThriftServerSource extends BaseSource {
+
+  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
+   */
+  void incTimeInQueue(long time);
+
+  /**
+   * Set the call queue length.
+   * @param len Time
+   */
+  void setCallQueueLen(int len);
+
+  /**
+   * Add how many keys were in a batch get.
+   * @param diff Num Keys
+   */
+  void incNumRowKeysInBatchGet(int diff);
+
+  /**
+   * Add how many keys were in a batch mutate.
+   * @param diff Num Keys
+   */
+  void incNumRowKeysInBatchMutate(int diff);
+
+  /**
+   * Add how long a method took
+   * @param name Method name
+   * @param time Time
+   */
+  void incMethodTime(String name, long time);
+
+  /**
+   * Add how long a call took
+   * @param time Time
+   */
+  void incCall(long time);
+
+  /**
+   * Increment how long a slow call took.
+   * @param time Time
+   */
+  void incSlowCall(long time);
+
+}

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSourceFactory.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSourceFactory.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSourceFactory.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/thrift/MetricsThriftServerSourceFactory.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,37 @@
+/**
+ * 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.thrift;
+
+/** Factory that will be used to create metrics sources for the two diffent types of thrift servers. */
+public interface MetricsThriftServerSourceFactory {
+
+  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";
+
+  /** Create a Source for a thrift one server */
+  MetricsThriftServerSource createThriftOneSource();
+
+  /** Create a Source for a thrift two server */
+  MetricsThriftServerSource createThriftTwoSource();
+
+}

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/MetricHistogram.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/MetricHistogram.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/MetricHistogram.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/MetricHistogram.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,43 @@
+/**
+ * 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.metrics2;
+
+/**
+ * Metrics Histogram interface.  Implementing classes will expose computed
+ * quartile values through the metrics system.
+ */
+public interface MetricHistogram {
+
+  //Strings used to create metrics names.
+  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";
+
+  /**
+   * Add a single value to a histogram's stream of values.
+   * @param value
+   */
+  void add(long value);
+
+}

Added: hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/MetricsExecutor.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/MetricsExecutor.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/MetricsExecutor.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/MetricsExecutor.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,32 @@
+/**
+ * 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.metrics2;
+
+import java.util.concurrent.ScheduledExecutorService;
+
+/**
+ * ScheduledExecutorService for metrics.
+ */
+public interface MetricsExecutor {
+
+  ScheduledExecutorService getExecutor();
+
+  void stop();
+
+}

Added: hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceFactory.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceFactory.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceFactory.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/master/TestMetricsMasterSourceFactory.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,36 @@
+/**
+ * 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.master;
+
+import org.apache.hadoop.hbase.CompatibilitySingletonFactory;
+import org.apache.hadoop.hbase.master.MetricsMasterSource;
+import org.junit.Test;
+
+/**
+ *  Test for the CompatibilitySingletonFactory and building MetricsMasterSource
+ */
+public class TestMetricsMasterSourceFactory {
+
+  @Test(expected=RuntimeException.class)
+  public void testGetInstanceNoHadoopCompat() throws Exception {
+    //This should throw an exception because there is no compat lib on the class path.
+    CompatibilitySingletonFactory.getInstance(MetricsMasterSourceFactory.class);
+
+  }
+}

Added: hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceFactory.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceFactory.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceFactory.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/regionserver/TestMetricsRegionServerSourceFactory.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,36 @@
+/**
+ * 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.regionserver;
+
+import org.apache.hadoop.hbase.CompatibilitySingletonFactory;
+import org.apache.hadoop.hbase.regionserver.MetricsRegionServerSourceFactory;
+import org.junit.Test;
+
+/**
+ *  Test for the CompatibilitySingletonFactory and building MetricsRegionServerSource
+ */
+public class TestMetricsRegionServerSourceFactory {
+
+  @Test(expected=RuntimeException.class)
+  public void testGetInstanceNoHadoopCompat() throws Exception {
+    //This should throw an exception because there is no compat lib on the class path.
+    CompatibilitySingletonFactory.getInstance(MetricsRegionServerSourceFactory.class);
+
+  }
+}

Added: hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceFactory.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceFactory.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceFactory.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestMetricsReplicationSourceFactory.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,35 @@
+/**
+ * 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.replication.regionserver;
+
+import org.apache.hadoop.hbase.CompatibilitySingletonFactory;
+import org.apache.hadoop.hbase.replication.regionserver.MetricsReplicationSource;
+import org.junit.Test;
+
+/**
+ *  Test for the CompatibilitySingletonFactory and building MetricsReplicationSource
+ */
+public class TestMetricsReplicationSourceFactory {
+
+  @Test(expected=RuntimeException.class)
+  public void testGetInstanceNoHadoopCompat() throws Exception {
+    //This should throw an exception because there is no compat lib on the class path.
+    CompatibilitySingletonFactory.getInstance(MetricsReplicationSource.class);
+  }
+}

Added: hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/rest/TestMetricsRESTSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/rest/TestMetricsRESTSource.java?rev=1406396&view=auto
==============================================================================
--- hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/rest/TestMetricsRESTSource.java (added)
+++ hbase/trunk/hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/rest/TestMetricsRESTSource.java Tue Nov  6 23:22:01 2012
@@ -0,0 +1,37 @@
+/**
+ * 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.rest;
+
+import org.apache.hadoop.hbase.CompatibilitySingletonFactory;
+import org.apache.hadoop.hbase.rest.MetricsRESTSource;
+import org.junit.Test;
+
+/**
+ *   Test of Rest Metrics Source interface.
+ */
+public class TestMetricsRESTSource {
+
+
+  @Test(expected=RuntimeException.class)
+  public void testGetInstanceNoHadoopCompat() throws Exception {
+    //This should throw an exception because there is no compat lib on the class path.
+    CompatibilitySingletonFactory.getInstance(MetricsRESTSource.class);
+  }
+
+}



Mime
View raw message