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

@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 Details

  • Constructor Details

  • Method Details

    • 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

      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.
    • applyBatch

      public void applyBatch(long batchSize, long hfileSize)
      Convience method to change metrics when a batch of operations are applied.
      Parameters:
      batchSize - total number of mutations that are applied/replicated
      hfileSize - total number of hfiles that are applied/replicated
    • incrementFailedBatches

      public void incrementFailedBatches()
      Convenience method to update metrics when batch of operations has failed.
    • getFailedBatches

      protected long getFailedBatches()
      Get the count of the failed bathes
    • getAgeOfLastAppliedOp

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

      Get the TimestampOfLastAppliedOp. If no replication Op applied yet, the value is the timestamp at which hbase instance starts
      Returns:
      timeStampsOfLastAppliedOp;
    • getStartTimestamp

      public long getStartTimestamp()
      Gets the time stamp from when the Sink was initialized.
    • getAppliedOps

      public long getAppliedOps()
      Gets the total number of OPs delivered to this sink.