001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.hbase.regionserver;
019
020import java.util.List;
021import org.apache.yetus.audience.InterfaceAudience;
022
023/**
024 * This is the interface that will expose RegionServer information to hadoop1/hadoop2
025 * implementations of the MetricsRegionServerSource.
026 */
027@InterfaceAudience.Private
028public interface MetricsRegionServerWrapper {
029
030  /**
031   * Get ServerName
032   */
033  String getServerName();
034
035  /**
036   * Get the Cluster ID
037   * @return Cluster ID
038   */
039  String getClusterId();
040
041  /**
042   * Get the ZooKeeper Quorum Info
043   * @return ZooKeeper Quorum Info
044   */
045  String getZookeeperQuorum();
046
047  /**
048   * Get the co-processors
049   * @return Co-processors
050   */
051  String getCoprocessors();
052
053  /**
054   * Get HRegionServer start time
055   * @return Start time of RegionServer in milliseconds
056   */
057  long getStartCode();
058
059  /**
060   * The number of online regions
061   */
062  long getNumOnlineRegions();
063
064  /**
065   * Get the number of stores hosted on this region server.
066   */
067  long getNumStores();
068
069  /**
070   * Get the number of WAL files of this region server.
071   */
072  long getNumWALFiles();
073
074  /**
075   * Get the size of WAL files of this region server.
076   */
077  long getWALFileSize();
078
079  /**
080   * Get the excluded datanodes in the cache of this region server.
081   */
082  List<String> getWALExcludeDNs();
083
084  /**
085   * Get the number of WAL files with slow appends for this region server.
086   */
087  long getNumWALSlowAppend();
088
089  /**
090   * Get the number of store files hosted on this region server.
091   */
092  long getNumStoreFiles();
093
094  /**
095   * Get the max number of store files across all regions of this region server.
096   */
097  long getMaxStoreFiles();
098
099  /**
100   * Get the size of the memstore on this region server.
101   */
102  long getMemStoreSize();
103
104  /**
105   * Get the size of the on heap memstore on this region server.
106   */
107  long getOnHeapMemStoreSize();
108
109  /**
110   * Get the size of the off heap memstore on this region server.
111   */
112  long getOffHeapMemStoreSize();
113
114  /**
115   * Get the total size of the store files this region server is serving from.
116   */
117  long getStoreFileSize();
118
119  /**
120   * Get the growth rate of the store files this region server is serving from.
121   */
122  double getStoreFileSizeGrowthRate();
123
124  /** Returns Max age of store files hosted on this region server */
125  long getMaxStoreFileAge();
126
127  /** Returns Min age of store files hosted on this region server */
128  long getMinStoreFileAge();
129
130  /** Returns Average age of store files hosted on this region server */
131  long getAvgStoreFileAge();
132
133  /** Returns Number of reference files on this region server */
134  long getNumReferenceFiles();
135
136  /**
137   * Get the number of requests per second.
138   */
139  double getRequestsPerSecond();
140
141  /**
142   * Get the total number of requests per second.
143   */
144  long getTotalRequestCount();
145
146  /**
147   * Get the number of read requests to regions hosted on this region server.
148   */
149  long getReadRequestsCount();
150
151  /**
152   * Get the number of coprocessor requests to regions hosted on this region server.
153   */
154  long getCpRequestsCount();
155
156  /**
157   * Get the rate of read requests per second to regions hosted on this region server.
158   */
159  double getReadRequestsRatePerSecond();
160
161  /**
162   * Get the number of filtered read requests to regions hosted on this region server.
163   */
164  long getFilteredReadRequestsCount();
165
166  /**
167   * Get the number of write requests to regions hosted on this region server.
168   */
169  long getWriteRequestsCount();
170
171  /**
172   * Get the rate of write requests per second to regions hosted on this region server.
173   */
174  double getWriteRequestsRatePerSecond();
175
176  /**
177   * Get the number of CAS operations that failed.
178   */
179  long getCheckAndMutateChecksFailed();
180
181  /**
182   * Get the number of CAS operations that passed.
183   */
184  long getCheckAndMutateChecksPassed();
185
186  /**
187   * Get the Size (in bytes) of indexes in storefiles on disk.
188   */
189  long getStoreFileIndexSize();
190
191  /**
192   * Get the size (in bytes) of of the static indexes including the roots.
193   */
194  long getTotalStaticIndexSize();
195
196  /**
197   * Get the size (in bytes) of the static bloom filters.
198   */
199  long getTotalStaticBloomSize();
200
201  /**
202   * Count of bloom filter requests.
203   */
204  long getBloomFilterRequestsCount();
205
206  /**
207   * Count of bloom filter requests which return a negative result.
208   */
209  long getBloomFilterNegativeResultsCount();
210
211  /**
212   * Count of requests which could have used bloom filters, but they weren't configured or loaded.
213   */
214  long getBloomFilterEligibleRequestsCount();
215
216  /**
217   * Number of mutations received with WAL explicitly turned off.
218   */
219  long getNumMutationsWithoutWAL();
220
221  /**
222   * Ammount of data in the memstore but not in the WAL because mutations explicitly had their WAL
223   * turned off.
224   */
225  long getDataInMemoryWithoutWAL();
226
227  /**
228   * Get the percent of HFiles' that are local.
229   */
230  double getPercentFileLocal();
231
232  /**
233   * Get the percent of HFiles' that are local for primary region replicas.
234   */
235  double getPercentFileLocalPrimaryRegions();
236
237  /**
238   * Get the percent of HFiles' that are local for secondary region replicas.
239   */
240  double getPercentFileLocalSecondaryRegions();
241
242  /**
243   * Get the size of the split queue
244   */
245  int getSplitQueueSize();
246
247  /**
248   * Get the size of the compaction queue
249   */
250  int getCompactionQueueSize();
251
252  int getSmallCompactionQueueSize();
253
254  int getLargeCompactionQueueSize();
255
256  /**
257   * Get the size of the flush queue.
258   */
259  int getFlushQueueSize();
260
261  /**
262   * Get the limit size of the off heap memstore (if enabled), otherwise get the limit size of the
263   * on heap memstore.
264   */
265  long getMemStoreLimit();
266
267  /**
268   * Get the limit size of the on heap memstore.
269   */
270  long getOnHeapMemStoreLimit();
271
272  /**
273   * Get the limit size of the off heap memstore.
274   */
275  long getOffHeapMemStoreLimit();
276
277  /**
278   * Get the size (in bytes) of the block cache that is free.
279   */
280  long getBlockCacheFreeSize();
281
282  /**
283   * Get the number of items in the block cache.
284   */
285  long getBlockCacheCount();
286
287  /**
288   * Get the number of DATA blocks in the block cache.
289   */
290  long getBlockCacheDataBlockCount();
291
292  /**
293   * Get the total size (in bytes) of the block cache.
294   */
295  long getBlockCacheSize();
296
297  /**
298   * Get the count of hits to the block cache
299   */
300  long getBlockCacheHitCount();
301
302  /**
303   * Get the count of hits to primary replica in the block cache
304   */
305  long getBlockCachePrimaryHitCount();
306
307  /**
308   * Get the count of hits to the block cache, for cacheable requests only.
309   */
310  long getBlockCacheHitCachingCount();
311
312  /**
313   * Get the count of misses to the block cache.
314   */
315  long getBlockCacheMissCount();
316
317  /**
318   * Get the count of misses to primary replica in the block cache.
319   */
320  long getBlockCachePrimaryMissCount();
321
322  /**
323   * Get the count of misses to the block cache, for cacheable requests only.
324   */
325  long getBlockCacheMissCachingCount();
326
327  /**
328   * Get the number of items evicted from the block cache.
329   */
330  long getBlockCacheEvictedCount();
331
332  /**
333   * Get the number of items evicted from primary replica in the block cache.
334   */
335  long getBlockCachePrimaryEvictedCount();
336
337  /**
338   * Get the percent of all requests that hit the block cache.
339   */
340  double getBlockCacheHitPercent();
341
342  /**
343   * Get the percent of requests with the block cache turned on that hit the block cache.
344   */
345  double getBlockCacheHitCachingPercent();
346
347  /**
348   * Number of cache insertions that failed.
349   */
350  long getBlockCacheFailedInsertions();
351
352  /**
353   * Cache size (bytes) of L1 cache
354   */
355  long getL1CacheSize();
356
357  /**
358   * Free cache size (bytes) of L1 cache
359   */
360  long getL1CacheFreeSize();
361
362  /**
363   * Number of blocks in L1 cache
364   */
365  long getL1CacheCount();
366
367  /**
368   * Number of blocks evicted from L1 cache
369   */
370  long getL1CacheEvictedCount();
371
372  /**
373   * Hit count of L1 cache.
374   */
375  long getL1CacheHitCount();
376
377  /**
378   * Hit Caching count of L1 cache, for cacheable requests only.
379   */
380  long getL1CacheHitCachingCount();
381
382  /**
383   * Miss count of L1 cache.
384   */
385  long getL1CacheMissCount();
386
387  /**
388   * Miss Caching count of L1 cache, for cacheable requests only.
389   */
390  long getL1CacheMissCachingCount();
391
392  /**
393   * Hit ratio of L1 cache.
394   */
395  double getL1CacheHitRatio();
396
397  /**
398   * Hit Caching ratio of L1 cache.
399   */
400  double getL1CacheHitCachingRatio();
401
402  /**
403   * Miss ratio of L1 cache.
404   */
405  double getL1CacheMissRatio();
406
407  /**
408   * Miss Caching ratio of L1 cache.
409   */
410  double getL1CacheMissCachingRatio();
411
412  /**
413   * Cache size (bytes) of L2 cache
414   */
415  long getL2CacheSize();
416
417  /**
418   * Free cache size (bytes) of L2 cache
419   */
420  long getL2CacheFreeSize();
421
422  /**
423   * Number of blocks in L2 cache
424   */
425  long getL2CacheCount();
426
427  /**
428   * Number of blocks evicted from L2 cache
429   */
430  long getL2CacheEvictedCount();
431
432  /**
433   * Hit count of L2 cache.
434   */
435  long getL2CacheHitCount();
436
437  /**
438   * Hit Caching count of L2 cache, for cacheable requests only.
439   */
440  long getL2CacheHitCachingCount();
441
442  /**
443   * Miss count of L2 cache.
444   */
445  long getL2CacheMissCount();
446
447  /**
448   * Miss Caching count of L2 cache, for cacheable requests only.
449   */
450  long getL2CacheMissCachingCount();
451
452  /**
453   * Hit ratio of L2 cache.
454   */
455  double getL2CacheHitRatio();
456
457  /**
458   * Hit Caching ratio of L2 cache.
459   */
460  double getL2CacheHitCachingRatio();
461
462  /**
463   * Miss ratio of L2 cache.
464   */
465  double getL2CacheMissRatio();
466
467  /**
468   * Miss Caching ratio of L2 cache.
469   */
470  double getL2CacheMissCachingRatio();
471
472  /**
473   * Force a re-computation of the metrics.
474   */
475  void forceRecompute();
476
477  /**
478   * Get the amount of time that updates were blocked.
479   */
480  long getUpdatesBlockedTime();
481
482  /**
483   * Get the number of cells flushed to disk.
484   */
485  long getFlushedCellsCount();
486
487  /**
488   * Get the number of cells processed during minor compactions.
489   */
490  long getCompactedCellsCount();
491
492  /**
493   * Get the number of cells processed during major compactions.
494   */
495  long getMajorCompactedCellsCount();
496
497  /**
498   * Get the total amount of data flushed to disk, in bytes.
499   */
500  long getFlushedCellsSize();
501
502  /**
503   * Get the total amount of data processed during minor compactions, in bytes.
504   */
505  long getCompactedCellsSize();
506
507  /**
508   * Get the total amount of data processed during major compactions, in bytes.
509   */
510  long getMajorCompactedCellsSize();
511
512  /**
513   * Gets the number of cells moved to mob during compaction.
514   */
515  long getCellsCountCompactedToMob();
516
517  /**
518   * Gets the number of cells moved from mob during compaction.
519   */
520  long getCellsCountCompactedFromMob();
521
522  /**
523   * Gets the total amount of cells moved to mob during compaction, in bytes.
524   */
525  long getCellsSizeCompactedToMob();
526
527  /**
528   * Gets the total amount of cells moved from mob during compaction, in bytes.
529   */
530  long getCellsSizeCompactedFromMob();
531
532  /**
533   * Gets the number of the flushes in mob-enabled stores.
534   */
535  long getMobFlushCount();
536
537  /**
538   * Gets the number of mob cells flushed to disk.
539   */
540  long getMobFlushedCellsCount();
541
542  /**
543   * Gets the total amount of mob cells flushed to disk, in bytes.
544   */
545  long getMobFlushedCellsSize();
546
547  /**
548   * Gets the number of scanned mob cells.
549   */
550  long getMobScanCellsCount();
551
552  /**
553   * Gets the total amount of scanned mob cells, in bytes.
554   */
555  long getMobScanCellsSize();
556
557  /**
558   * Gets the count of accesses to the mob file cache.
559   */
560  long getMobFileCacheAccessCount();
561
562  /**
563   * Gets the count of misses to the mob file cache.
564   */
565  long getMobFileCacheMissCount();
566
567  /**
568   * Gets the number of items evicted from the mob file cache.
569   */
570  long getMobFileCacheEvictedCount();
571
572  /**
573   * Gets the count of cached mob files.
574   */
575  long getMobFileCacheCount();
576
577  /**
578   * Gets the hit percent to the mob file cache.
579   */
580  double getMobFileCacheHitPercent();
581
582  /** Returns Count of hedged read operations */
583  long getHedgedReadOps();
584
585  /** Returns Count of times a hedged read beat out the primary read. */
586  long getHedgedReadWins();
587
588  /** Returns Count of times a hedged read executes in current thread */
589  long getHedgedReadOpsInCurThread();
590
591  /** Returns Number of total bytes read from HDFS. */
592  long getTotalBytesRead();
593
594  /** Returns Number of bytes read from the local HDFS DataNode. */
595  long getLocalBytesRead();
596
597  /** Returns Number of bytes read locally through HDFS short circuit. */
598  long getShortCircuitBytesRead();
599
600  /** Returns Number of bytes read locally through HDFS zero copy. */
601  long getZeroCopyBytesRead();
602
603  /**
604   * Returns Count of requests blocked because the memstore size is larger than blockingMemStoreSize
605   */
606  long getBlockedRequestsCount();
607
608  /**
609   * Get the number of rpc get requests to this region server.
610   */
611  long getRpcGetRequestsCount();
612
613  /**
614   * Get the number of rpc scan requests to this region server.
615   */
616  long getRpcScanRequestsCount();
617
618  /**
619   * Get the number of full region rpc scan requests to this region server.
620   */
621  long getRpcFullScanRequestsCount();
622
623  /**
624   * Get the number of rpc multi requests to this region server.
625   */
626  long getRpcMultiRequestsCount();
627
628  /**
629   * Get the number of rpc mutate requests to this region server.
630   */
631  long getRpcMutateRequestsCount();
632
633  /**
634   * Get the average region size to this region server.
635   */
636  long getAverageRegionSize();
637
638  long getDataMissCount();
639
640  long getLeafIndexMissCount();
641
642  long getBloomChunkMissCount();
643
644  long getMetaMissCount();
645
646  long getRootIndexMissCount();
647
648  long getIntermediateIndexMissCount();
649
650  long getFileInfoMissCount();
651
652  long getGeneralBloomMetaMissCount();
653
654  long getDeleteFamilyBloomMissCount();
655
656  long getTrailerMissCount();
657
658  long getDataHitCount();
659
660  long getLeafIndexHitCount();
661
662  long getBloomChunkHitCount();
663
664  long getMetaHitCount();
665
666  long getRootIndexHitCount();
667
668  long getIntermediateIndexHitCount();
669
670  long getFileInfoHitCount();
671
672  long getGeneralBloomMetaHitCount();
673
674  long getDeleteFamilyBloomHitCount();
675
676  long getTrailerHitCount();
677
678  long getTotalRowActionRequestCount();
679
680  long getByteBuffAllocatorHeapAllocationBytes();
681
682  long getByteBuffAllocatorPoolAllocationBytes();
683
684  double getByteBuffAllocatorHeapAllocRatio();
685
686  long getByteBuffAllocatorTotalBufferCount();
687
688  long getByteBuffAllocatorUsedBufferCount();
689
690  int getActiveScanners();
691}