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 secondary region replicas.
234   */
235  double getPercentFileLocalSecondaryRegions();
236
237  /**
238   * Get the size of the split queue
239   */
240  int getSplitQueueSize();
241
242  /**
243   * Get the size of the compaction queue
244   */
245  int getCompactionQueueSize();
246
247  int getSmallCompactionQueueSize();
248
249  int getLargeCompactionQueueSize();
250
251  /**
252   * Get the size of the flush queue.
253   */
254  int getFlushQueueSize();
255
256  /**
257   * Get the limit size of the off heap memstore (if enabled), otherwise get the limit size of the
258   * on heap memstore.
259   */
260  long getMemStoreLimit();
261
262  /**
263   * Get the limit size of the on heap memstore.
264   */
265  long getOnHeapMemStoreLimit();
266
267  /**
268   * Get the limit size of the off heap memstore.
269   */
270  long getOffHeapMemStoreLimit();
271
272  /**
273   * Get the size (in bytes) of the block cache that is free.
274   */
275  long getBlockCacheFreeSize();
276
277  /**
278   * Get the number of items in the block cache.
279   */
280  long getBlockCacheCount();
281
282  /**
283   * Get the number of DATA blocks in the block cache.
284   */
285  long getBlockCacheDataBlockCount();
286
287  /**
288   * Get the total size (in bytes) of the block cache.
289   */
290  long getBlockCacheSize();
291
292  /**
293   * Get the count of hits to the block cache
294   */
295  long getBlockCacheHitCount();
296
297  /**
298   * Get the count of hits to primary replica in the block cache
299   */
300  long getBlockCachePrimaryHitCount();
301
302  /**
303   * Get the count of hits to the block cache, for cacheable requests only.
304   */
305  long getBlockCacheHitCachingCount();
306
307  /**
308   * Get the count of misses to the block cache.
309   */
310  long getBlockCacheMissCount();
311
312  /**
313   * Get the count of misses to primary replica in the block cache.
314   */
315  long getBlockCachePrimaryMissCount();
316
317  /**
318   * Get the count of misses to the block cache, for cacheable requests only.
319   */
320  long getBlockCacheMissCachingCount();
321
322  /**
323   * Get the number of items evicted from the block cache.
324   */
325  long getBlockCacheEvictedCount();
326
327  /**
328   * Get the number of items evicted from primary replica in the block cache.
329   */
330  long getBlockCachePrimaryEvictedCount();
331
332  /**
333   * Get the percent of all requests that hit the block cache.
334   */
335  double getBlockCacheHitPercent();
336
337  /**
338   * Get the percent of requests with the block cache turned on that hit the block cache.
339   */
340  double getBlockCacheHitCachingPercent();
341
342  /**
343   * Number of cache insertions that failed.
344   */
345  long getBlockCacheFailedInsertions();
346
347  /**
348   * Cache size (bytes) of L1 cache
349   */
350  long getL1CacheSize();
351
352  /**
353   * Free cache size (bytes) of L1 cache
354   */
355  long getL1CacheFreeSize();
356
357  /**
358   * Number of blocks in L1 cache
359   */
360  long getL1CacheCount();
361
362  /**
363   * Number of blocks evicted from L1 cache
364   */
365  long getL1CacheEvictedCount();
366
367  /**
368   * Hit count of L1 cache.
369   */
370  long getL1CacheHitCount();
371
372  /**
373   * Miss count of L1 cache.
374   */
375  long getL1CacheMissCount();
376
377  /**
378   * Hit ratio of L1 cache.
379   */
380  double getL1CacheHitRatio();
381
382  /**
383   * Miss ratio of L1 cache.
384   */
385  double getL1CacheMissRatio();
386
387  /**
388   * Cache size (bytes) of L2 cache
389   */
390  long getL2CacheSize();
391
392  /**
393   * Free cache size (bytes) of L2 cache
394   */
395  long getL2CacheFreeSize();
396
397  /**
398   * Number of blocks in L2 cache
399   */
400  long getL2CacheCount();
401
402  /**
403   * Number of blocks evicted from L2 cache
404   */
405  long getL2CacheEvictedCount();
406
407  /**
408   * Hit count of L2 cache.
409   */
410  long getL2CacheHitCount();
411
412  /**
413   * Miss count of L2 cache.
414   */
415  long getL2CacheMissCount();
416
417  /**
418   * Hit ratio of L2 cache.
419   */
420  double getL2CacheHitRatio();
421
422  /**
423   * Miss ratio of L2 cache.
424   */
425  double getL2CacheMissRatio();
426
427  /**
428   * Force a re-computation of the metrics.
429   */
430  void forceRecompute();
431
432  /**
433   * Get the amount of time that updates were blocked.
434   */
435  long getUpdatesBlockedTime();
436
437  /**
438   * Get the number of cells flushed to disk.
439   */
440  long getFlushedCellsCount();
441
442  /**
443   * Get the number of cells processed during minor compactions.
444   */
445  long getCompactedCellsCount();
446
447  /**
448   * Get the number of cells processed during major compactions.
449   */
450  long getMajorCompactedCellsCount();
451
452  /**
453   * Get the total amount of data flushed to disk, in bytes.
454   */
455  long getFlushedCellsSize();
456
457  /**
458   * Get the total amount of data processed during minor compactions, in bytes.
459   */
460  long getCompactedCellsSize();
461
462  /**
463   * Get the total amount of data processed during major compactions, in bytes.
464   */
465  long getMajorCompactedCellsSize();
466
467  /**
468   * Gets the number of cells moved to mob during compaction.
469   */
470  long getCellsCountCompactedToMob();
471
472  /**
473   * Gets the number of cells moved from mob during compaction.
474   */
475  long getCellsCountCompactedFromMob();
476
477  /**
478   * Gets the total amount of cells moved to mob during compaction, in bytes.
479   */
480  long getCellsSizeCompactedToMob();
481
482  /**
483   * Gets the total amount of cells moved from mob during compaction, in bytes.
484   */
485  long getCellsSizeCompactedFromMob();
486
487  /**
488   * Gets the number of the flushes in mob-enabled stores.
489   */
490  long getMobFlushCount();
491
492  /**
493   * Gets the number of mob cells flushed to disk.
494   */
495  long getMobFlushedCellsCount();
496
497  /**
498   * Gets the total amount of mob cells flushed to disk, in bytes.
499   */
500  long getMobFlushedCellsSize();
501
502  /**
503   * Gets the number of scanned mob cells.
504   */
505  long getMobScanCellsCount();
506
507  /**
508   * Gets the total amount of scanned mob cells, in bytes.
509   */
510  long getMobScanCellsSize();
511
512  /**
513   * Gets the count of accesses to the mob file cache.
514   */
515  long getMobFileCacheAccessCount();
516
517  /**
518   * Gets the count of misses to the mob file cache.
519   */
520  long getMobFileCacheMissCount();
521
522  /**
523   * Gets the number of items evicted from the mob file cache.
524   */
525  long getMobFileCacheEvictedCount();
526
527  /**
528   * Gets the count of cached mob files.
529   */
530  long getMobFileCacheCount();
531
532  /**
533   * Gets the hit percent to the mob file cache.
534   */
535  double getMobFileCacheHitPercent();
536
537  /** Returns Count of hedged read operations */
538  long getHedgedReadOps();
539
540  /** Returns Count of times a hedged read beat out the primary read. */
541  long getHedgedReadWins();
542
543  /** Returns Count of times a hedged read executes in current thread */
544  long getHedgedReadOpsInCurThread();
545
546  /** Returns Number of total bytes read from HDFS. */
547  long getTotalBytesRead();
548
549  /** Returns Number of bytes read from the local HDFS DataNode. */
550  long getLocalBytesRead();
551
552  /** Returns Number of bytes read locally through HDFS short circuit. */
553  long getShortCircuitBytesRead();
554
555  /** Returns Number of bytes read locally through HDFS zero copy. */
556  long getZeroCopyBytesRead();
557
558  /**
559   * Returns Count of requests blocked because the memstore size is larger than blockingMemStoreSize
560   */
561  long getBlockedRequestsCount();
562
563  /**
564   * Get the number of rpc get requests to this region server.
565   */
566  long getRpcGetRequestsCount();
567
568  /**
569   * Get the number of rpc scan requests to this region server.
570   */
571  long getRpcScanRequestsCount();
572
573  /**
574   * Get the number of full region rpc scan requests to this region server.
575   */
576  long getRpcFullScanRequestsCount();
577
578  /**
579   * Get the number of rpc multi requests to this region server.
580   */
581  long getRpcMultiRequestsCount();
582
583  /**
584   * Get the number of rpc mutate requests to this region server.
585   */
586  long getRpcMutateRequestsCount();
587
588  /**
589   * Get the average region size to this region server.
590   */
591  long getAverageRegionSize();
592
593  long getDataMissCount();
594
595  long getLeafIndexMissCount();
596
597  long getBloomChunkMissCount();
598
599  long getMetaMissCount();
600
601  long getRootIndexMissCount();
602
603  long getIntermediateIndexMissCount();
604
605  long getFileInfoMissCount();
606
607  long getGeneralBloomMetaMissCount();
608
609  long getDeleteFamilyBloomMissCount();
610
611  long getTrailerMissCount();
612
613  long getDataHitCount();
614
615  long getLeafIndexHitCount();
616
617  long getBloomChunkHitCount();
618
619  long getMetaHitCount();
620
621  long getRootIndexHitCount();
622
623  long getIntermediateIndexHitCount();
624
625  long getFileInfoHitCount();
626
627  long getGeneralBloomMetaHitCount();
628
629  long getDeleteFamilyBloomHitCount();
630
631  long getTrailerHitCount();
632
633  long getTotalRowActionRequestCount();
634
635  long getByteBuffAllocatorHeapAllocationBytes();
636
637  long getByteBuffAllocatorPoolAllocationBytes();
638
639  double getByteBuffAllocatorHeapAllocRatio();
640
641  long getByteBuffAllocatorTotalBufferCount();
642
643  long getByteBuffAllocatorUsedBufferCount();
644
645  int getActiveScanners();
646}