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  /** Returns Max age of store files hosted on this region server */
120  long getMaxStoreFileAge();
121
122  /** Returns Min age of store files hosted on this region server */
123  long getMinStoreFileAge();
124
125  /** Returns Average age of store files hosted on this region server */
126  long getAvgStoreFileAge();
127
128  /** Returns Number of reference files on this region server */
129  long getNumReferenceFiles();
130
131  /**
132   * Get the number of requests per second.
133   */
134  double getRequestsPerSecond();
135
136  /**
137   * Get the total number of requests per second.
138   */
139  long getTotalRequestCount();
140
141  /**
142   * Get the number of read requests to regions hosted on this region server.
143   */
144  long getReadRequestsCount();
145
146  /**
147   * Get the rate of read requests per second to regions hosted on this region server.
148   */
149  double getReadRequestsRatePerSecond();
150
151  /**
152   * Get the number of filtered read requests to regions hosted on this region server.
153   */
154  long getFilteredReadRequestsCount();
155
156  /**
157   * Get the number of write requests to regions hosted on this region server.
158   */
159  long getWriteRequestsCount();
160
161  /**
162   * Get the rate of write requests per second to regions hosted on this region server.
163   */
164  double getWriteRequestsRatePerSecond();
165
166  /**
167   * Get the number of CAS operations that failed.
168   */
169  long getCheckAndMutateChecksFailed();
170
171  /**
172   * Get the number of CAS operations that passed.
173   */
174  long getCheckAndMutateChecksPassed();
175
176  /**
177   * Get the Size (in bytes) of indexes in storefiles on disk.
178   */
179  long getStoreFileIndexSize();
180
181  /**
182   * Get the size (in bytes) of of the static indexes including the roots.
183   */
184  long getTotalStaticIndexSize();
185
186  /**
187   * Get the size (in bytes) of the static bloom filters.
188   */
189  long getTotalStaticBloomSize();
190
191  /**
192   * Count of bloom filter requests.
193   */
194  long getBloomFilterRequestsCount();
195
196  /**
197   * Count of bloom filter requests which return a negative result.
198   */
199  long getBloomFilterNegativeResultsCount();
200
201  /**
202   * Count of requests which could have used bloom filters, but they weren't configured or loaded.
203   */
204  long getBloomFilterEligibleRequestsCount();
205
206  /**
207   * Number of mutations received with WAL explicitly turned off.
208   */
209  long getNumMutationsWithoutWAL();
210
211  /**
212   * Ammount of data in the memstore but not in the WAL because mutations explicitly had their WAL
213   * turned off.
214   */
215  long getDataInMemoryWithoutWAL();
216
217  /**
218   * Get the percent of HFiles' that are local.
219   */
220  double getPercentFileLocal();
221
222  /**
223   * Get the percent of HFiles' that are local for secondary region replicas.
224   */
225  double getPercentFileLocalSecondaryRegions();
226
227  /**
228   * Get the size of the split queue
229   */
230  int getSplitQueueSize();
231
232  /**
233   * Get the size of the compaction queue
234   */
235  int getCompactionQueueSize();
236
237  int getSmallCompactionQueueSize();
238
239  int getLargeCompactionQueueSize();
240
241  /**
242   * Get the size of the flush queue.
243   */
244  int getFlushQueueSize();
245
246  /**
247   * Get the limit size of the off heap memstore (if enabled), otherwise get the limit size of the
248   * on heap memstore.
249   */
250  long getMemStoreLimit();
251
252  /**
253   * Get the limit size of the on heap memstore.
254   */
255  long getOnHeapMemStoreLimit();
256
257  /**
258   * Get the limit size of the off heap memstore.
259   */
260  long getOffHeapMemStoreLimit();
261
262  /**
263   * Get the size (in bytes) of the block cache that is free.
264   */
265  long getBlockCacheFreeSize();
266
267  /**
268   * Get the number of items in the block cache.
269   */
270  long getBlockCacheCount();
271
272  /**
273   * Get the number of DATA blocks in the block cache.
274   */
275  long getBlockCacheDataBlockCount();
276
277  /**
278   * Get the total size (in bytes) of the block cache.
279   */
280  long getBlockCacheSize();
281
282  /**
283   * Get the count of hits to the block cache
284   */
285  long getBlockCacheHitCount();
286
287  /**
288   * Get the count of hits to primary replica in the block cache
289   */
290  long getBlockCachePrimaryHitCount();
291
292  /**
293   * Get the count of hits to the block cache, for cacheable requests only.
294   */
295  long getBlockCacheHitCachingCount();
296
297  /**
298   * Get the count of misses to the block cache.
299   */
300  long getBlockCacheMissCount();
301
302  /**
303   * Get the count of misses to primary replica in the block cache.
304   */
305  long getBlockCachePrimaryMissCount();
306
307  /**
308   * Get the count of misses to the block cache, for cacheable requests only.
309   */
310  long getBlockCacheMissCachingCount();
311
312  /**
313   * Get the number of items evicted from the block cache.
314   */
315  long getBlockCacheEvictedCount();
316
317  /**
318   * Get the number of items evicted from primary replica in the block cache.
319   */
320  long getBlockCachePrimaryEvictedCount();
321
322  /**
323   * Get the percent of all requests that hit the block cache.
324   */
325  double getBlockCacheHitPercent();
326
327  /**
328   * Get the percent of requests with the block cache turned on that hit the block cache.
329   */
330  double getBlockCacheHitCachingPercent();
331
332  /**
333   * Number of cache insertions that failed.
334   */
335  long getBlockCacheFailedInsertions();
336
337  /**
338   * Cache size (bytes) of L1 cache
339   */
340  long getL1CacheSize();
341
342  /**
343   * Free cache size (bytes) of L1 cache
344   */
345  long getL1CacheFreeSize();
346
347  /**
348   * Number of blocks in L1 cache
349   */
350  long getL1CacheCount();
351
352  /**
353   * Number of blocks evicted from L1 cache
354   */
355  long getL1CacheEvictedCount();
356
357  /**
358   * Hit count of L1 cache.
359   */
360  long getL1CacheHitCount();
361
362  /**
363   * Miss count of L1 cache.
364   */
365  long getL1CacheMissCount();
366
367  /**
368   * Hit ratio of L1 cache.
369   */
370  double getL1CacheHitRatio();
371
372  /**
373   * Miss ratio of L1 cache.
374   */
375  double getL1CacheMissRatio();
376
377  /**
378   * Cache size (bytes) of L2 cache
379   */
380  long getL2CacheSize();
381
382  /**
383   * Free cache size (bytes) of L2 cache
384   */
385  long getL2CacheFreeSize();
386
387  /**
388   * Number of blocks in L2 cache
389   */
390  long getL2CacheCount();
391
392  /**
393   * Number of blocks evicted from L2 cache
394   */
395  long getL2CacheEvictedCount();
396
397  /**
398   * Hit count of L2 cache.
399   */
400  long getL2CacheHitCount();
401
402  /**
403   * Miss count of L2 cache.
404   */
405  long getL2CacheMissCount();
406
407  /**
408   * Hit ratio of L2 cache.
409   */
410  double getL2CacheHitRatio();
411
412  /**
413   * Miss ratio of L2 cache.
414   */
415  double getL2CacheMissRatio();
416
417  /**
418   * Force a re-computation of the metrics.
419   */
420  void forceRecompute();
421
422  /**
423   * Get the amount of time that updates were blocked.
424   */
425  long getUpdatesBlockedTime();
426
427  /**
428   * Get the number of cells flushed to disk.
429   */
430  long getFlushedCellsCount();
431
432  /**
433   * Get the number of cells processed during minor compactions.
434   */
435  long getCompactedCellsCount();
436
437  /**
438   * Get the number of cells processed during major compactions.
439   */
440  long getMajorCompactedCellsCount();
441
442  /**
443   * Get the total amount of data flushed to disk, in bytes.
444   */
445  long getFlushedCellsSize();
446
447  /**
448   * Get the total amount of data processed during minor compactions, in bytes.
449   */
450  long getCompactedCellsSize();
451
452  /**
453   * Get the total amount of data processed during major compactions, in bytes.
454   */
455  long getMajorCompactedCellsSize();
456
457  /**
458   * Gets the number of cells moved to mob during compaction.
459   */
460  long getCellsCountCompactedToMob();
461
462  /**
463   * Gets the number of cells moved from mob during compaction.
464   */
465  long getCellsCountCompactedFromMob();
466
467  /**
468   * Gets the total amount of cells moved to mob during compaction, in bytes.
469   */
470  long getCellsSizeCompactedToMob();
471
472  /**
473   * Gets the total amount of cells moved from mob during compaction, in bytes.
474   */
475  long getCellsSizeCompactedFromMob();
476
477  /**
478   * Gets the number of the flushes in mob-enabled stores.
479   */
480  long getMobFlushCount();
481
482  /**
483   * Gets the number of mob cells flushed to disk.
484   */
485  long getMobFlushedCellsCount();
486
487  /**
488   * Gets the total amount of mob cells flushed to disk, in bytes.
489   */
490  long getMobFlushedCellsSize();
491
492  /**
493   * Gets the number of scanned mob cells.
494   */
495  long getMobScanCellsCount();
496
497  /**
498   * Gets the total amount of scanned mob cells, in bytes.
499   */
500  long getMobScanCellsSize();
501
502  /**
503   * Gets the count of accesses to the mob file cache.
504   */
505  long getMobFileCacheAccessCount();
506
507  /**
508   * Gets the count of misses to the mob file cache.
509   */
510  long getMobFileCacheMissCount();
511
512  /**
513   * Gets the number of items evicted from the mob file cache.
514   */
515  long getMobFileCacheEvictedCount();
516
517  /**
518   * Gets the count of cached mob files.
519   */
520  long getMobFileCacheCount();
521
522  /**
523   * Gets the hit percent to the mob file cache.
524   */
525  double getMobFileCacheHitPercent();
526
527  /** Returns Count of hedged read operations */
528  long getHedgedReadOps();
529
530  /** Returns Count of times a hedged read beat out the primary read. */
531  long getHedgedReadWins();
532
533  /** Returns Count of times a hedged read executes in current thread */
534  long getHedgedReadOpsInCurThread();
535
536  /** Returns Number of total bytes read from HDFS. */
537  long getTotalBytesRead();
538
539  /** Returns Number of bytes read from the local HDFS DataNode. */
540  long getLocalBytesRead();
541
542  /** Returns Number of bytes read locally through HDFS short circuit. */
543  long getShortCircuitBytesRead();
544
545  /** Returns Number of bytes read locally through HDFS zero copy. */
546  long getZeroCopyBytesRead();
547
548  /**
549   * Returns Count of requests blocked because the memstore size is larger than blockingMemStoreSize
550   */
551  long getBlockedRequestsCount();
552
553  /**
554   * Get the number of rpc get requests to this region server.
555   */
556  long getRpcGetRequestsCount();
557
558  /**
559   * Get the number of rpc scan requests to this region server.
560   */
561  long getRpcScanRequestsCount();
562
563  /**
564   * Get the number of full region rpc scan requests to this region server.
565   */
566  long getRpcFullScanRequestsCount();
567
568  /**
569   * Get the number of rpc multi requests to this region server.
570   */
571  long getRpcMultiRequestsCount();
572
573  /**
574   * Get the number of rpc mutate requests to this region server.
575   */
576  long getRpcMutateRequestsCount();
577
578  /**
579   * Get the average region size to this region server.
580   */
581  long getAverageRegionSize();
582
583  long getDataMissCount();
584
585  long getLeafIndexMissCount();
586
587  long getBloomChunkMissCount();
588
589  long getMetaMissCount();
590
591  long getRootIndexMissCount();
592
593  long getIntermediateIndexMissCount();
594
595  long getFileInfoMissCount();
596
597  long getGeneralBloomMetaMissCount();
598
599  long getDeleteFamilyBloomMissCount();
600
601  long getTrailerMissCount();
602
603  long getDataHitCount();
604
605  long getLeafIndexHitCount();
606
607  long getBloomChunkHitCount();
608
609  long getMetaHitCount();
610
611  long getRootIndexHitCount();
612
613  long getIntermediateIndexHitCount();
614
615  long getFileInfoHitCount();
616
617  long getGeneralBloomMetaHitCount();
618
619  long getDeleteFamilyBloomHitCount();
620
621  long getTrailerHitCount();
622
623  long getTotalRowActionRequestCount();
624
625  long getByteBuffAllocatorHeapAllocationBytes();
626
627  long getByteBuffAllocatorPoolAllocationBytes();
628
629  double getByteBuffAllocatorHeapAllocRatio();
630
631  long getByteBuffAllocatorTotalBufferCount();
632
633  long getByteBuffAllocatorUsedBufferCount();
634
635  int getActiveScanners();
636}