@InterfaceAudience.LimitedPrivate(value="Replication") public class MetricsSource extends Object implements BaseSource
Modifier and Type | Field and Description |
---|---|
private Map<String,Long> |
ageOfLastShippedOp |
private MetricsReplicationGlobalSourceSource |
globalSourceSource |
private String |
id |
private long |
lastHFileRefsQueueSize |
private Map<String,Long> |
lastShippedTimeStamps |
private static org.slf4j.Logger |
LOG |
private MetricsReplicationSourceSource |
singleSourceSource |
private Map<String,MetricsReplicationTableSource> |
singleSourceSourceByTable |
private long |
timeStampNextToReplicate |
HBASE_METRICS_SYSTEM_NAME
Constructor and Description |
---|
MetricsSource(String id)
Constructor used to register the metrics
|
MetricsSource(String id,
MetricsReplicationSourceSource singleSourceSource,
MetricsReplicationGlobalSourceSource globalSourceSource,
Map<String,MetricsReplicationTableSource> singleSourceSourceByTable)
Constructor for injecting custom (or test) MetricsReplicationSourceSources
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all metrics about this Source.
|
void |
decGauge(String gaugeName,
long delta)
Subtract some amount from a gauge.
|
void |
decrSizeOfHFileRefsQueue(int size) |
void |
decrSizeOfLogQueue() |
void |
decrSourceInitializing()
Decrement the count for initializing sources
|
Long |
getAgeOfLastShippedOp()
Get AgeOfLastShippedOp n
|
long |
getAgeOfLastShippedOp(String walGroup)
get age of last shipped op of given wal group.
|
long |
getEditsFiltered()
Gets the number of edits not eligible for replication this source queue logs so far.
|
String |
getMetricsContext()
Get the metrics context.
|
String |
getMetricsDescription()
Get the description of what this source exposes.
|
String |
getMetricsJmxContext()
Get the name of the context in JMX that this source will be exposed through.
|
String |
getMetricsName()
Get the name of the metrics that are being exported by this source.
|
long |
getOldestWalAge() |
long |
getOpsShipped()
Gets the number of OPs shipped by this source queue to target cluster.
|
String |
getPeerID()
Get the slave peer ID n
|
long |
getReplicableEdits()
Gets the number of edits eligible for replication read from this source queue logs so far.
|
long |
getReplicationDelay() |
Map<String,MetricsReplicationTableSource> |
getSingleSourceSourceByTable() |
int |
getSizeOfLogQueue()
Get the sizeOfLogQueue n
|
int |
getSourceInitializing()
Get the source initializing counts
|
long |
getTimeStampNextToReplicate()
TimeStamp of next edit to be replicated.
|
long |
getTimestampOfLastShippedOp()
Get the timestampsOfLastShippedOp, if there are multiple groups, return the latest one n
|
long |
getTimeStampOfLastShippedOp()
Deprecated.
|
long |
getUncleanlyClosedWALs()
Get the value of uncleanlyClosedWAL counter n
|
long |
getWALReaderEditsBufferUsage()
Returns the amount of memory in bytes used in this RegionServer by edits pending replication.
|
void |
incCounters(String counterName,
long delta)
Add some amount to a counter.
|
void |
incGauge(String gaugeName,
long delta)
Add some amount to a gauge.
|
void |
incrBytesSkippedInUncleanlyClosedWALs(long bytes) |
void |
incrCompletedRecoveryQueue() |
void |
incrCompletedWAL() |
void |
incrementFailedBatches()
Convenience method to update metrics when batch of operations has failed.
|
void |
incrFailedRecoveryQueue() |
void |
incrLogEditsFiltered()
The number of log edits filtered out.
|
void |
incrLogEditsFiltered(long delta)
Add on the number of log edits filtered
|
void |
incrLogEditsRead()
Increment the number of log edits read by one.
|
private void |
incrLogEditsRead(long delta)
Add on the the number of log edits read
|
void |
incrLogReadInBytes(long readInBytes)
increase the byte number read by source from log file
|
void |
incrRepeatedFileBytes(long bytes) |
void |
incrRestartedWALReading() |
void |
incrSizeOfHFileRefsQueue(long size) |
void |
incrSizeOfLogQueue()
Increment size of the log queue.
|
void |
incrSourceInitializing()
Increment the count for initializing sources
|
void |
incrUncleanlyClosedWALs() |
void |
incrUnknownFileLengthForClosedWAL() |
void |
init()
Clear out the metrics and re-prepare the source.
|
void |
refreshAgeOfLastShippedOp(String walGroupId)
Convenience method to use the last given timestamp to refresh the age of the last edit.
|
void |
removeMetric(String key)
Remove a metric and no longer announce it.
|
void |
setAgeOfLastShippedOp(long timestamp,
String walGroup)
Set the age of the last edit that was shipped
|
void |
setAgeOfLastShippedOpByTable(long timestamp,
String tableName)
Set the age of the last edit that was shipped group by table
|
void |
setGauge(String gaugeName,
long value)
Set a gauge to a specific value.
|
void |
setOldestWalAge(long age) |
void |
setTimeStampNextToReplicate(long timeStampNextToReplicate)
TimeStamp of next edit targeted for replication.
|
void |
setWALReaderEditsBufferUsage(long usageInBytes)
Sets the amount of memory in bytes used in this RegionServer by edits pending replication.
|
void |
shipBatch(long batchSize,
int sizeInBytes)
Convience method to apply changes to metrics do to shipping a batch of logs.
|
void |
shipBatch(long batchSize,
int sizeInBytes,
long hfiles)
Convience method to apply changes to metrics do to shipping a batch of logs.
|
void |
updateHistogram(String name,
long value)
Add some value to a histogram.
|
void |
updateTableLevelMetrics(List<Pair<WAL.Entry,Long>> walEntries)
Update the table level replication metrics per table
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMetricRegistryInfo
private static final org.slf4j.Logger LOG
private Map<String,Long> lastShippedTimeStamps
private Map<String,Long> ageOfLastShippedOp
private long lastHFileRefsQueueSize
private long timeStampNextToReplicate
private final MetricsReplicationSourceSource singleSourceSource
private final MetricsReplicationGlobalSourceSource globalSourceSource
private Map<String,MetricsReplicationTableSource> singleSourceSourceByTable
public MetricsSource(String id)
id
- Name of the source this class is monitoringpublic MetricsSource(String id, MetricsReplicationSourceSource singleSourceSource, MetricsReplicationGlobalSourceSource globalSourceSource, Map<String,MetricsReplicationTableSource> singleSourceSourceByTable)
id
- Name of the source this class is monitoringsingleSourceSource
- Class to monitor id-scoped metricsglobalSourceSource
- Class to monitor global-scoped metricspublic void setAgeOfLastShippedOp(long timestamp, String walGroup)
timestamp
- target write time of the editwalGroup
- which group we are settingpublic void updateTableLevelMetrics(List<Pair<WAL.Entry,Long>> walEntries)
walEntries
- List of pairs of WAL entry and it's sizepublic void setAgeOfLastShippedOpByTable(long timestamp, String tableName)
timestamp
- write time of the edittableName
- String as group and tableNamepublic long getAgeOfLastShippedOp(String walGroup)
walGroup
- which group we are getting npublic void refreshAgeOfLastShippedOp(String walGroupId)
walGroupId
- id of the group to updatepublic void incrSizeOfLogQueue()
public void decrSizeOfLogQueue()
public void incrSourceInitializing()
public void decrSourceInitializing()
private void incrLogEditsRead(long delta)
delta
- the number of log edits read.public void incrLogEditsRead()
public void incrLogEditsFiltered(long delta)
delta
- the number filtered.public void incrLogEditsFiltered()
public void shipBatch(long batchSize, int sizeInBytes)
batchSize
- the size of the batch that was shipped to sinks.public void incrementFailedBatches()
public long getEditsFiltered()
public long getReplicableEdits()
public long getOpsShipped()
public void shipBatch(long batchSize, int sizeInBytes, long hfiles)
batchSize
- the size of the batch that was shipped to sinks.hfiles
- total number of hfiles shipped to sinks.public void incrLogReadInBytes(long readInBytes)
public void clear()
public Long getAgeOfLastShippedOp()
public int getSizeOfLogQueue()
@Deprecated public long getTimeStampOfLastShippedOp()
getTimestampOfLastShippedOp()
public long getUncleanlyClosedWALs()
public long getTimestampOfLastShippedOp()
public long getTimeStampNextToReplicate()
public void setTimeStampNextToReplicate(long timeStampNextToReplicate)
timeStampNextToReplicate
- timestamp of next edit in the queue that should be replicated.public long getReplicationDelay()
public int getSourceInitializing()
public void incrSizeOfHFileRefsQueue(long size)
public void decrSizeOfHFileRefsQueue(int size)
public void incrUnknownFileLengthForClosedWAL()
public void incrUncleanlyClosedWALs()
public void incrBytesSkippedInUncleanlyClosedWALs(long bytes)
public void incrRestartedWALReading()
public void incrRepeatedFileBytes(long bytes)
public void incrCompletedWAL()
public void incrCompletedRecoveryQueue()
public void incrFailedRecoveryQueue()
public void setOldestWalAge(long age)
public long getOldestWalAge()
public void init()
BaseSource
init
in interface BaseSource
public void setGauge(String gaugeName, long value)
BaseSource
setGauge
in interface BaseSource
gaugeName
- the name of the gaugevalue
- the valuepublic void incGauge(String gaugeName, long delta)
BaseSource
incGauge
in interface BaseSource
gaugeName
- the name of the gaugedelta
- the amount to change the gauge by.public void decGauge(String gaugeName, long delta)
BaseSource
decGauge
in interface BaseSource
gaugeName
- the name of the gaugedelta
- the amount to change the gauge by.public void removeMetric(String key)
BaseSource
removeMetric
in interface BaseSource
key
- Name of the gauge to remove.public void incCounters(String counterName, long delta)
BaseSource
incCounters
in interface BaseSource
counterName
- the name of the counterdelta
- the amount to change the counter by.public void updateHistogram(String name, long value)
BaseSource
updateHistogram
in interface BaseSource
name
- the name of the histogramvalue
- the value to add to the histogrampublic String getMetricsContext()
BaseSource
getMetricsContext
in interface BaseSource
public String getMetricsDescription()
BaseSource
getMetricsDescription
in interface BaseSource
public String getMetricsJmxContext()
BaseSource
getMetricsJmxContext
in interface BaseSource
public String getMetricsName()
BaseSource
getMetricsName
in interface BaseSource
@InterfaceAudience.Private public Map<String,MetricsReplicationTableSource> getSingleSourceSourceByTable()
public void setWALReaderEditsBufferUsage(long usageInBytes)
public long getWALReaderEditsBufferUsage()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.