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

java.lang.Object
  extended by org.apache.hadoop.hbase.replication.regionserver.MetricsSource

@InterfaceAudience.Private
public class MetricsSource
extends Object

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


Field Summary
static org.apache.commons.logging.Log LOG
           
static String SOURCE_AGE_OF_LAST_SHIPPED_OP
           
static String SOURCE_LOG_EDITS_FILTERED
           
static String SOURCE_LOG_EDITS_READ
           
static String SOURCE_SHIPPED_BATCHES
           
static String SOURCE_SHIPPED_OPS
           
static String SOURCE_SIZE_OF_LOG_QUEUE
           
 
Constructor Summary
MetricsSource(String id)
          Constructor used to register the metrics
 
Method Summary
 void clear()
          Removes all metrics about this Source.
 void incrLogEditsFiltered()
          The number of log edits filtered out.
 void incrLogEditsRead()
          Increment the number of log edits read by one.
 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
 void setSizeOfLogQueue(int size)
          Set the size of the log queue
 void shipBatch(long batchSize)
          Convience method to apply changes to metrics do to shipping a batch of logs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCE_SIZE_OF_LOG_QUEUE

public static final String SOURCE_SIZE_OF_LOG_QUEUE
See Also:
Constant Field Values

SOURCE_AGE_OF_LAST_SHIPPED_OP

public static final String SOURCE_AGE_OF_LAST_SHIPPED_OP
See Also:
Constant Field Values

SOURCE_LOG_EDITS_READ

public static final String SOURCE_LOG_EDITS_READ
See Also:
Constant Field Values

SOURCE_LOG_EDITS_FILTERED

public static final String SOURCE_LOG_EDITS_FILTERED
See Also:
Constant Field Values

SOURCE_SHIPPED_BATCHES

public static final String SOURCE_SHIPPED_BATCHES
See Also:
Constant Field Values

SOURCE_SHIPPED_OPS

public static final String SOURCE_SHIPPED_OPS
See Also:
Constant Field Values

LOG

public static final org.apache.commons.logging.Log LOG
Constructor Detail

MetricsSource

public MetricsSource(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.


setSizeOfLogQueue

public void setSizeOfLogQueue(int size)
Set the size of the log queue

Parameters:
size - the size.

incrLogEditsRead

public void incrLogEditsRead()
Increment the number of log edits read by one.


incrLogEditsFiltered

public void incrLogEditsFiltered()
The number of log edits filtered out.


shipBatch

public void shipBatch(long batchSize)
Convience method to apply changes to metrics do to shipping a batch of logs.

Parameters:
batchSize - the size of the batch that was shipped to sinks.

clear

public void clear()
Removes all metrics about this Source.



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