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

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

@InterfaceAudience.Private
public class MetricsSink
extends Object

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


Field Summary
static String SINK_AGE_OF_LAST_APPLIED_OP
           
static String SINK_APPLIED_BATCHES
           
static String SINK_APPLIED_OPS
           
 
Constructor Summary
MetricsSink()
           
 
Method Summary
 void applyBatch(long batchSize)
          Convience method to change metrics when a batch of operations are applied.
 long getAgeOfLastAppliedOp()
          Get the Age of Last Applied Op
 long getTimeStampOfLastAppliedOp()
          Get the TimeStampOfLastAppliedOp.
 long refreshAgeOfLastAppliedOp()
          Refreshing the age makes sure the value returned is the actual one and not the one set a replication time
 long setAgeOfLastAppliedOp(long timestamp)
          Set the age of the last applied operation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINK_AGE_OF_LAST_APPLIED_OP

public static final String SINK_AGE_OF_LAST_APPLIED_OP
See Also:
Constant Field Values

SINK_APPLIED_BATCHES

public static final String SINK_APPLIED_BATCHES
See Also:
Constant Field Values

SINK_APPLIED_OPS

public static final String SINK_APPLIED_OPS
See Also:
Constant Field Values
Constructor Detail

MetricsSink

public MetricsSink()
Method Detail

setAgeOfLastAppliedOp

public long setAgeOfLastAppliedOp(long timestamp)
Set the age of the last applied operation

Parameters:
timestamp - The timestamp of the last operation applied.
Returns:
the age that was set

refreshAgeOfLastAppliedOp

public long refreshAgeOfLastAppliedOp()
Refreshing the age makes sure the value returned is the actual one and not the one set a replication time

Returns:
refreshed age

applyBatch

public void applyBatch(long batchSize)
Convience method to change metrics when a batch of operations are applied.

Parameters:
batchSize -

getAgeOfLastAppliedOp

public long getAgeOfLastAppliedOp()
Get the Age of Last Applied Op

Returns:
ageOfLastAppliedOp

getTimeStampOfLastAppliedOp

public long getTimeStampOfLastAppliedOp()
Get the TimeStampOfLastAppliedOp. If no replication Op applied yet, the value is the timestamp at which hbase instance starts

Returns:
timeStampsOfLastAppliedOp;


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.