public final class ClientStats extends Object
HBaseClient
usage statistics.
This is an immutable snapshot of usage statistics of the client. Please note that not all the numbers in the snapshot are collected atomically, so although each individual number is up-to-date as of the time this object is created, small inconsistencies between numbers can arise.
Modifier and Type | Method and Description |
---|---|
long |
atomicIncrements()
Number of
AtomicIncrementRequest sent. |
long |
connectionsCreated()
Number of connections created to connect to RegionServers.
|
long |
contendedMetaLookups()
Returns how many lookups in
.META. were performed (contended). |
long |
deletes()
Number calls to
HBaseClient.delete(org.hbase.async.DeleteRequest) . |
long |
flushes()
Number of calls to
HBaseClient.flush() . |
long |
gets()
Number of calls to
HBaseClient.get(org.hbase.async.GetRequest) . |
CacheStats |
incrementBufferStats()
Returns statistics from the buffer used to coalesce increments.
|
long |
noSuchRegionExceptions()
Number of
NoSuchRegionException handled by the client. |
long |
numBatchedRpcSent()
Number of batched RPCs sent to the network.
|
long |
numRpcDelayedDueToNSRE()
Number of RPCs delayed due to
NoSuchRegionException s. |
long |
puts()
Number calls to
HBaseClient.put(org.hbase.async.PutRequest) . |
long |
rootLookups()
Returns how many lookups in
-ROOT- were performed. |
long |
rowLocks()
Number calls to
HBaseClient.lockRow(org.hbase.async.RowLockRequest) . |
long |
scannersOpened()
Number of scanners opened.
|
long |
scans()
Number of times a scanner had to fetch data from HBase.
|
long |
uncontendedMetaLookups()
Returns how many lookups in
.META. were performed (uncontended). |
public long connectionsCreated()
public long rootLookups()
-ROOT-
were performed.
This number should remain low. It will be 1 after the first access to
HBase, and will increase by 1 each time the .META.
region moves
to another server, which should seldom happen.
This isn't to be confused with the number of times we looked up where
the -ROOT-
region itself is located. This happens even more
rarely and a message is logged at the INFO whenever it does.
public long uncontendedMetaLookups()
.META.
were performed (uncontended).
This number indicates how many times we had to lookup in .META.
where a key was located. This only counts "uncontended" lookups, where
the thread was able to acquire a "permit" to do a .META.
lookup.
The majority of the .META.
lookups should fall in this category.
public long contendedMetaLookups()
.META.
were performed (contended).
This number indicates how many times we had to lookup in .META.
where a key was located. This only counts "contended" lookups, where the
thread was unable to acquire a "permit" to do a .META.
lookup,
because there were already too many .META.
lookups in flight.
In this case, the thread was delayed a bit in order to apply a bit of
back-pressure on the caller, to avoid creating .META.
storms.
The minority of the .META.
lookups should fall in this category.
public long flushes()
HBaseClient.flush()
.public long noSuchRegionExceptions()
NoSuchRegionException
handled by the client.
The NoSuchRegionException
is an integral part of the way HBase
work. HBase clients keep a local cache of where they think each region
is in the cluster, but in practice things aren't static, and regions will
move due to load balancing, or get split into two new regions due to
write activity. When this happens, clients find out "the hard way" that
their RPC failed because the region they tried to get to is no longer
there. This causes the client to invalidate its local cache entry for
this region and perform a .META.
lookup to find where this region
has moved, or find the new region to use in case of a split.
While NoSuchRegionException
are expected to happen due to load
balancing or write load, they tend to have a large performance impact as
they force the clients to back off and repeatedly poll the cluster to
find the new location of the region. So it's good to keep an eye on the
rate at which they happen to make sure it remains fairly constant and
low.
In a high write throughput application, if this value increases too quickly it typically indicates that there are too few regions, so splits are happening too often. In this case you should manually split the hot regions in order to better distribute the write load.
This number is a subset of numRpcDelayedDueToNSRE()
, because each
NoSuchRegionException
causes multiple RPCs to be delayed.
public long numRpcDelayedDueToNSRE()
NoSuchRegionException
s.
In a high throughput application, if this value increases too quickly it typically indicates that there are too few regions, or that some regions are too hot, which is causing too many RPCs to back up when a region becomes temporarily unavailable. In this case you should manually split the hot regions in order to better distribute the write load.
noSuchRegionExceptions()
public long numBatchedRpcSent()
While puts()
and deletes()
indicate the number of RPCs
created at the application level, they don't reflect the actual number of
RPCs sent to the network because of batching (see
HBaseClient.setFlushInterval(short)
).
Note that deletes()
can only be batched if you use HBase 0.92 or
above.
public long gets()
HBaseClient.get(org.hbase.async.GetRequest)
.public long scannersOpened()
public long scans()
public long puts()
HBaseClient.put(org.hbase.async.PutRequest)
.
Note that this doesn't necessarily reflect the number of RPCs sent to
HBase due to batching (see HBaseClient.setFlushInterval(short)
).
numBatchedRpcSent()
public long rowLocks()
HBaseClient.lockRow(org.hbase.async.RowLockRequest)
.public long deletes()
HBaseClient.delete(org.hbase.async.DeleteRequest)
.
Note that if you use HBase 0.92 or above, this doesn't necessarily
reflect the number of RPCs sent to HBase due to batching (see
HBaseClient.setFlushInterval(short)
).
numBatchedRpcSent()
public long atomicIncrements()
AtomicIncrementRequest
sent.
This number includes AtomicIncrementRequest
s sent after being
buffered by HBaseClient.bufferAtomicIncrement(org.hbase.async.AtomicIncrementRequest)
. The number of
evictions returned by incrementBufferStats()
is a subset of this
number, and the difference between the two is the number of increments
that were sent directly without being buffered.
public CacheStats incrementBufferStats()