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
FieldsModifier and TypeFieldDescriptionprivate longprivate final MetricsReplicationSinkSourceprivate long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyBatch(long batchSize) Convience method to change metrics when a batch of operations are applied.voidapplyBatch(long batchSize, long hfileSize) Convience method to change metrics when a batch of operations are applied.longGet the Age of Last Applied OplongGets the total number of OPs delivered to this sink.protected longGet the count of the failed batheslongGets the time stamp from when the Sink was initialized.longGet the TimestampOfLastAppliedOp.longDeprecated.Since 2.0.0.voidConvenience method to update metrics when batch of operations has failed.longRefreshing the age makes sure the value returned is the actual one and not the one set a replication timelongsetAgeOfLastAppliedOp(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
Deprecated.Since 2.0.0. Will be removed in 3.0.0.Get the TimeStampOfLastAppliedOp. If no replication Op applied yet, the value is the timestamp at which hbase instance starts- Returns:
- timeStampsOfLastAppliedOp;
- See Also:
-
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.
-