Class MetricsSink
java.lang.Object
org.apache.hadoop.hbase.replication.regionserver.MetricsSink
This class is for maintaining the various replication statistics for a sink and publishing them
through the metrics interfaces.
-
Field Summary
Modifier and TypeFieldDescriptionprivate long
private final MetricsReplicationSinkSource
private long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyBatch
(long batchSize) Convience method to change metrics when a batch of operations are applied.void
applyBatch
(long batchSize, long hfileSize) Convience method to change metrics when a batch of operations are applied.long
Get the Age of Last Applied Oplong
Gets the total number of OPs delivered to this sink.protected long
Get the count of the failed batheslong
Gets the time stamp from when the Sink was initialized.long
Get the TimestampOfLastAppliedOp.void
Convenience method to update metrics when batch of operations has failed.long
Refreshing the age makes sure the value returned is the actual one and not the one set a replication timelong
setAgeOfLastAppliedOp
(long timestamp) Set the age of the last applied operation
-
Field Details
-
lastTimestampForAge
-
startTimestamp
-
mss
-
-
Constructor Details
-
MetricsSink
public MetricsSink()
-
-
Method Details
-
setAgeOfLastAppliedOp
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
Convience method to change metrics when a batch of operations are applied. -
applyBatch
Convience method to change metrics when a batch of operations are applied.- Parameters:
batchSize
- total number of mutations that are applied/replicatedhfileSize
- total number of hfiles that are applied/replicated
-
incrementFailedBatches
Convenience method to update metrics when batch of operations has failed. -
getFailedBatches
Get the count of the failed bathes -
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
Gets the time stamp from when the Sink was initialized. -
getAppliedOps
Gets the total number of OPs delivered to this sink.
-