org.apache.hadoop.hbase.replication.regionserver
Class ReplicationSourceMetrics

java.lang.Object
  extended by org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceMetrics
All Implemented Interfaces:
org.apache.hadoop.metrics.Updater

public class ReplicationSourceMetrics
extends Object
implements org.apache.hadoop.metrics.Updater

This class is for maintaining the various replication statistics for a source and publishing them through the metrics interfaces.


Field Summary
 MetricsRate logEditsFilteredRate
          Rate of log entries filtered by the source
 MetricsRate logEditsReadRate
          Rate of log entries (can be multiple Puts) read from the logs
 MetricsRate shippedBatchesRate
          Rate of shipped batches by the source
 MetricsRate shippedOpsRate
          Rate of shipped operations by the source
 org.apache.hadoop.metrics.util.MetricsIntValue sizeOfLogQueue
          Current size of the queue of logs to replicate, excluding the one being processed at the moment
 
Constructor Summary
ReplicationSourceMetrics(String id)
          Constructor used to register the metrics
 
Method Summary
 void doUpdates(org.apache.hadoop.metrics.MetricsContext metricsContext)
           
 void refreshAgeOfLastShippedOp()
          Convenience method to use the last given timestamp to refresh the age of the last edit.
 void setAgeOfLastShippedOp(long timestamp)
          Set the age of the last edit that was shipped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shippedOpsRate

public final MetricsRate shippedOpsRate
Rate of shipped operations by the source


shippedBatchesRate

public final MetricsRate shippedBatchesRate
Rate of shipped batches by the source


logEditsReadRate

public final MetricsRate logEditsReadRate
Rate of log entries (can be multiple Puts) read from the logs


logEditsFilteredRate

public final MetricsRate logEditsFilteredRate
Rate of log entries filtered by the source


sizeOfLogQueue

public final org.apache.hadoop.metrics.util.MetricsIntValue sizeOfLogQueue
Current size of the queue of logs to replicate, excluding the one being processed at the moment

Constructor Detail

ReplicationSourceMetrics

public ReplicationSourceMetrics(String id)
Constructor used to register the metrics

Parameters:
id - Name of the source this class is monitoring
Method Detail

setAgeOfLastShippedOp

public void setAgeOfLastShippedOp(long timestamp)
Set the age of the last edit that was shipped

Parameters:
timestamp - write time of the edit

refreshAgeOfLastShippedOp

public void refreshAgeOfLastShippedOp()
Convenience method to use the last given timestamp to refresh the age of the last edit. Used when replication fails and need to keep that metric accurate.


doUpdates

public void doUpdates(org.apache.hadoop.metrics.MetricsContext metricsContext)
Specified by:
doUpdates in interface org.apache.hadoop.metrics.Updater


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.