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 */
018
019package org.apache.hadoop.hbase.regionserver;
020
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   *
038   * @return Cluster ID
039   */
040  String getClusterId();
041
042  /**
043   * Get the ZooKeeper Quorum Info
044   *
045   * @return ZooKeeper Quorum Info
046   */
047  String getZookeeperQuorum();
048
049  /**
050   * Get the co-processors
051   *
052   * @return Co-processors
053   */
054  String getCoprocessors();
055
056  /**
057   * Get HRegionServer start time
058   *
059   * @return Start time of RegionServer in milliseconds
060   */
061  long getStartCode();
062
063  /**
064   * The number of online regions
065   */
066  long getNumOnlineRegions();
067
068  /**
069   * Get the number of stores hosted on this region server.
070   */
071  long getNumStores();
072
073  /**
074   * Get the number of WAL files of this region server.
075   */
076  long getNumWALFiles();
077
078  /**
079   * Get the size of WAL files of this region server.
080   */
081  long getWALFileSize();
082
083  /**
084   * Get the number of WAL files with slow appends for this region server.
085   */
086  long getNumWALSlowAppend();
087
088    /**
089     * Get the number of store files hosted on this region server.
090     */
091  long getNumStoreFiles();
092
093  /**
094   * Get the size of the memstore on this region server.
095   */
096  long getMemStoreSize();
097
098  /**
099   * Get the total size of the store files this region server is serving from.
100   */
101  long getStoreFileSize();
102
103  /**
104   * @return Max age of store files hosted on this region server
105   */
106  long getMaxStoreFileAge();
107
108  /**
109   * @return Min age of store files hosted on this region server
110   */
111  long getMinStoreFileAge();
112
113  /**
114   *  @return Average age of store files hosted on this region server
115   */
116  long getAvgStoreFileAge();
117
118  /**
119   *  @return Number of reference files on this region server
120   */
121  long getNumReferenceFiles();
122
123  /**
124   * Get the number of requests per second.
125   */
126  double getRequestsPerSecond();
127
128  /**
129   * Get the total number of requests per second.
130   */
131  long getTotalRequestCount();
132
133  /**
134   * Get the number of read requests to regions hosted on this region server.
135   */
136  long getReadRequestsCount();
137
138  /**
139   * Get the rate of read requests per second to regions hosted on this region server.
140   */
141  double getReadRequestsRatePerSecond();
142
143  /**
144   * Get the number of filtered read requests to regions hosted on this region server.
145   */
146  long getFilteredReadRequestsCount();
147
148  /**
149   * Get the number of write requests to regions hosted on this region server.
150   */
151  long getWriteRequestsCount();
152
153  /**
154   * Get the rate of write requests per second to regions hosted on this region server.
155   */
156  double getWriteRequestsRatePerSecond();
157
158  /**
159   * Get the number of CAS operations that failed.
160   */
161  long getCheckAndMutateChecksFailed();
162
163  /**
164   * Get the number of CAS operations that passed.
165   */
166  long getCheckAndMutateChecksPassed();
167
168  /**
169   * Get the Size (in bytes) of indexes in storefiles on disk.
170   */
171  long getStoreFileIndexSize();
172
173  /**
174   * Get the size (in bytes) of of the static indexes including the roots.
175   */
176  long getTotalStaticIndexSize();
177
178  /**
179   * Get the size (in bytes) of the static bloom filters.
180   */
181  long getTotalStaticBloomSize();
182
183  /**
184   * Number of mutations received with WAL explicitly turned off.
185   */
186  long getNumMutationsWithoutWAL();
187
188  /**
189   * Ammount of data in the memstore but not in the WAL because mutations explicitly had their
190   * WAL turned off.
191   */
192  long getDataInMemoryWithoutWAL();
193
194  /**
195   * Get the percent of HFiles' that are local.
196   */
197  double getPercentFileLocal();
198
199  /**
200   * Get the percent of HFiles' that are local for secondary region replicas.
201   */
202  double getPercentFileLocalSecondaryRegions();
203
204  /**
205   * Get the size of the split queue
206   */
207  int getSplitQueueSize();
208
209  /**
210   * Get the size of the compaction queue
211   */
212  int getCompactionQueueSize();
213
214  int getSmallCompactionQueueSize();
215
216  int getLargeCompactionQueueSize();
217
218  /**
219   * Get the size of the flush queue.
220   */
221  int getFlushQueueSize();
222
223  long getMemStoreLimit();
224  /**
225   * Get the size (in bytes) of the block cache that is free.
226   */
227  long getBlockCacheFreeSize();
228
229  /**
230   * Get the number of items in the block cache.
231   */
232  long getBlockCacheCount();
233
234  /**
235   * Get the total size (in bytes) of the block cache.
236   */
237  long getBlockCacheSize();
238
239  /**
240   * Get the count of hits to the block cache
241   */
242  long getBlockCacheHitCount();
243
244  /**
245   * Get the count of hits to primary replica in the block cache
246   */
247  long getBlockCachePrimaryHitCount();
248
249  /**
250   * Get the count of misses to the block cache.
251   */
252  long getBlockCacheMissCount();
253
254  /**
255   * Get the count of misses to primary replica in the block cache.
256   */
257  long getBlockCachePrimaryMissCount();
258
259  /**
260   * Get the number of items evicted from the block cache.
261   */
262  long getBlockCacheEvictedCount();
263
264  /**
265   * Get the number of items evicted from primary replica in the block cache.
266   */
267  long getBlockCachePrimaryEvictedCount();
268
269
270  /**
271   * Get the percent of all requests that hit the block cache.
272   */
273  double getBlockCacheHitPercent();
274
275  /**
276   * Get the percent of requests with the block cache turned on that hit the block cache.
277   */
278  double getBlockCacheHitCachingPercent();
279
280  /**
281   * Number of cache insertions that failed.
282   */
283  long getBlockCacheFailedInsertions();
284
285  /**
286   * Hit count of L1 cache.
287   */
288  long getL1CacheHitCount();
289
290  /**
291   * Miss count of L1 cache.
292   */
293  long getL1CacheMissCount();
294
295  /**
296   * Hit ratio of L1 cache.
297   */
298  double getL1CacheHitRatio();
299
300  /**
301   * Miss ratio of L1 cache.
302   */
303  double getL1CacheMissRatio();
304
305  /**
306   * Hit count of L2 cache.
307   */
308  long getL2CacheHitCount();
309
310  /**
311   * Miss count of L2 cache.
312   */
313  long getL2CacheMissCount();
314
315  /**
316   * Hit ratio of L2 cache.
317   */
318  double getL2CacheHitRatio();
319
320  /**
321   * Miss ratio of L2 cache.
322   */
323  double getL2CacheMissRatio();
324
325  /**
326   * Force a re-computation of the metrics.
327   */
328  void forceRecompute();
329
330  /**
331   * Get the amount of time that updates were blocked.
332   */
333  long getUpdatesBlockedTime();
334
335  /**
336   * Get the number of cells flushed to disk.
337   */
338  long getFlushedCellsCount();
339
340  /**
341   * Get the number of cells processed during minor compactions.
342   */
343  long getCompactedCellsCount();
344
345  /**
346   * Get the number of cells processed during major compactions.
347   */
348  long getMajorCompactedCellsCount();
349
350  /**
351   * Get the total amount of data flushed to disk, in bytes.
352   */
353  long getFlushedCellsSize();
354
355  /**
356   * Get the total amount of data processed during minor compactions, in bytes.
357   */
358  long getCompactedCellsSize();
359
360  /**
361   * Get the total amount of data processed during major compactions, in bytes.
362   */
363  long getMajorCompactedCellsSize();
364
365  /**
366   * Gets the number of cells moved to mob during compaction.
367   */
368  long getCellsCountCompactedToMob();
369
370  /**
371   * Gets the number of cells moved from mob during compaction.
372   */
373  long getCellsCountCompactedFromMob();
374
375  /**
376   * Gets the total amount of cells moved to mob during compaction, in bytes.
377   */
378  long getCellsSizeCompactedToMob();
379
380  /**
381   * Gets the total amount of cells moved from mob during compaction, in bytes.
382   */
383  long getCellsSizeCompactedFromMob();
384
385  /**
386   * Gets the number of the flushes in mob-enabled stores.
387   */
388  long getMobFlushCount();
389
390  /**
391   * Gets the number of mob cells flushed to disk.
392   */
393  long getMobFlushedCellsCount();
394
395  /**
396   * Gets the total amount of mob cells flushed to disk, in bytes.
397   */
398  long getMobFlushedCellsSize();
399
400  /**
401   * Gets the number of scanned mob cells.
402   */
403  long getMobScanCellsCount();
404
405  /**
406   * Gets the total amount of scanned mob cells, in bytes.
407   */
408  long getMobScanCellsSize();
409
410  /**
411   * Gets the count of accesses to the mob file cache.
412   */
413  long getMobFileCacheAccessCount();
414
415  /**
416   * Gets the count of misses to the mob file cache.
417   */
418  long getMobFileCacheMissCount();
419
420  /**
421   * Gets the number of items evicted from the mob file cache.
422   */
423  long getMobFileCacheEvictedCount();
424
425  /**
426   * Gets the count of cached mob files.
427   */
428  long getMobFileCacheCount();
429
430  /**
431   * Gets the hit percent to the mob file cache.
432   */
433  double getMobFileCacheHitPercent();
434
435  /**
436   * @return Count of hedged read operations
437   */
438  long getHedgedReadOps();
439
440  /**
441   * @return Count of times a hedged read beat out the primary read.
442   */
443  long getHedgedReadWins();
444
445  /**
446   * @return Number of total bytes read from HDFS.
447   */
448  long getTotalBytesRead();
449
450  /**
451   * @return Number of bytes read from the local HDFS DataNode.
452   */
453  long getLocalBytesRead();
454
455  /**
456   * @return Number of bytes read locally through HDFS short circuit.
457   */
458  long getShortCircuitBytesRead();
459
460  /**
461   * @return Number of bytes read locally through HDFS zero copy.
462   */
463  long getZeroCopyBytesRead();
464
465  /**
466   * @return Count of requests blocked because the memstore size is larger than blockingMemStoreSize
467   */
468  long getBlockedRequestsCount();
469
470  /**
471   * Get the number of rpc get requests to this region server.
472   */
473  long getRpcGetRequestsCount();
474
475  /**
476   * Get the number of rpc scan requests to this region server.
477   */
478  long getRpcScanRequestsCount();
479
480  /**
481   * Get the number of rpc multi requests to this region server.
482   */
483  long getRpcMultiRequestsCount();
484
485  /**
486   * Get the number of rpc mutate requests to this region server.
487   */
488  long getRpcMutateRequestsCount();
489
490  /**
491   * Get the average region size to this region server.
492   */
493  long getAverageRegionSize();
494
495  long getDataMissCount();
496
497  long getLeafIndexMissCount();
498
499  long getBloomChunkMissCount();
500
501  long getMetaMissCount();
502
503  long getRootIndexMissCount();
504
505  long getIntermediateIndexMissCount();
506
507  long getFileInfoMissCount();
508
509  long getGeneralBloomMetaMissCount();
510
511  long getDeleteFamilyBloomMissCount();
512
513  long getTrailerMissCount();
514
515  long getDataHitCount();
516
517  long getLeafIndexHitCount();
518
519  long getBloomChunkHitCount();
520
521  long getMetaHitCount();
522
523  long getRootIndexHitCount();
524
525  long getIntermediateIndexHitCount();
526
527  long getFileInfoHitCount();
528
529  long getGeneralBloomMetaHitCount();
530
531  long getDeleteFamilyBloomHitCount();
532
533  long getTrailerHitCount();
534
535  long getTotalRowActionRequestCount();
536
537  long getByteBuffAllocatorHeapAllocationBytes();
538
539  long getByteBuffAllocatorPoolAllocationBytes();
540
541  double getByteBuffAllocatorHeapAllocRatio();
542
543  long getByteBuffAllocatorTotalBufferCount();
544
545  long getByteBuffAllocatorUsedBufferCount();
546}