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 number of filtered read requests to regions hosted on this region server.
140   */
141  long getFilteredReadRequestsCount();
142
143  /**
144   * Get the number of write requests to regions hosted on this region server.
145   */
146  long getWriteRequestsCount();
147
148  /**
149   * Get the number of CAS operations that failed.
150   */
151  long getCheckAndMutateChecksFailed();
152
153  /**
154   * Get the number of CAS operations that passed.
155   */
156  long getCheckAndMutateChecksPassed();
157
158  /**
159   * Get the Size (in bytes) of indexes in storefiles on disk.
160   */
161  long getStoreFileIndexSize();
162
163  /**
164   * Get the size (in bytes) of of the static indexes including the roots.
165   */
166  long getTotalStaticIndexSize();
167
168  /**
169   * Get the size (in bytes) of the static bloom filters.
170   */
171  long getTotalStaticBloomSize();
172
173  /**
174   * Number of mutations received with WAL explicitly turned off.
175   */
176  long getNumMutationsWithoutWAL();
177
178  /**
179   * Ammount of data in the memstore but not in the WAL because mutations explicitly had their
180   * WAL turned off.
181   */
182  long getDataInMemoryWithoutWAL();
183
184  /**
185   * Get the percent of HFiles' that are local.
186   */
187  double getPercentFileLocal();
188
189  /**
190   * Get the percent of HFiles' that are local for secondary region replicas.
191   */
192  double getPercentFileLocalSecondaryRegions();
193
194  /**
195   * Get the size of the split queue
196   */
197  int getSplitQueueSize();
198
199  /**
200   * Get the size of the compaction queue
201   */
202  int getCompactionQueueSize();
203
204  int getSmallCompactionQueueSize();
205
206  int getLargeCompactionQueueSize();
207
208  /**
209   * Get the size of the flush queue.
210   */
211  int getFlushQueueSize();
212
213  public long getMemStoreLimit();
214  /**
215   * Get the size (in bytes) of the block cache that is free.
216   */
217  long getBlockCacheFreeSize();
218
219  /**
220   * Get the number of items in the block cache.
221   */
222  long getBlockCacheCount();
223
224  /**
225   * Get the total size (in bytes) of the block cache.
226   */
227  long getBlockCacheSize();
228
229  /**
230   * Get the count of hits to the block cache
231   */
232  long getBlockCacheHitCount();
233
234  /**
235   * Get the count of hits to primary replica in the block cache
236   */
237  long getBlockCachePrimaryHitCount();
238
239  /**
240   * Get the count of misses to the block cache.
241   */
242  long getBlockCacheMissCount();
243
244  /**
245   * Get the count of misses to primary replica in the block cache.
246   */
247  long getBlockCachePrimaryMissCount();
248
249  /**
250   * Get the number of items evicted from the block cache.
251   */
252  long getBlockCacheEvictedCount();
253
254  /**
255   * Get the number of items evicted from primary replica in the block cache.
256   */
257  long getBlockCachePrimaryEvictedCount();
258
259
260  /**
261   * Get the percent of all requests that hit the block cache.
262   */
263  double getBlockCacheHitPercent();
264
265  /**
266   * Get the percent of requests with the block cache turned on that hit the block cache.
267   */
268  double getBlockCacheHitCachingPercent();
269
270  /**
271   * Number of cache insertions that failed.
272   */
273  long getBlockCacheFailedInsertions();
274
275  /**
276   * Hit count of L1 cache.
277   */
278  public long getL1CacheHitCount();
279
280  /**
281   * Miss count of L1 cache.
282   */
283  public long getL1CacheMissCount();
284
285  /**
286   * Hit ratio of L1 cache.
287   */
288  public double getL1CacheHitRatio();
289
290  /**
291   * Miss ratio of L1 cache.
292   */
293  public double getL1CacheMissRatio();
294
295  /**
296   * Hit count of L2 cache.
297   */
298  public long getL2CacheHitCount();
299
300  /**
301   * Miss count of L2 cache.
302   */
303  public long getL2CacheMissCount();
304
305  /**
306   * Hit ratio of L2 cache.
307   */
308  public double getL2CacheHitRatio();
309
310  /**
311   * Miss ratio of L2 cache.
312   */
313  public double getL2CacheMissRatio();
314
315  /**
316   * Force a re-computation of the metrics.
317   */
318  void forceRecompute();
319
320  /**
321   * Get the amount of time that updates were blocked.
322   */
323  long getUpdatesBlockedTime();
324
325  /**
326   * Get the number of cells flushed to disk.
327   */
328  long getFlushedCellsCount();
329
330  /**
331   * Get the number of cells processed during minor compactions.
332   */
333  long getCompactedCellsCount();
334
335  /**
336   * Get the number of cells processed during major compactions.
337   */
338  long getMajorCompactedCellsCount();
339
340  /**
341   * Get the total amount of data flushed to disk, in bytes.
342   */
343  long getFlushedCellsSize();
344
345  /**
346   * Get the total amount of data processed during minor compactions, in bytes.
347   */
348  long getCompactedCellsSize();
349
350  /**
351   * Get the total amount of data processed during major compactions, in bytes.
352   */
353  long getMajorCompactedCellsSize();
354
355  /**
356   * Gets the number of cells moved to mob during compaction.
357   */
358  long getCellsCountCompactedToMob();
359
360  /**
361   * Gets the number of cells moved from mob during compaction.
362   */
363  long getCellsCountCompactedFromMob();
364
365  /**
366   * Gets the total amount of cells moved to mob during compaction, in bytes.
367   */
368  long getCellsSizeCompactedToMob();
369
370  /**
371   * Gets the total amount of cells moved from mob during compaction, in bytes.
372   */
373  long getCellsSizeCompactedFromMob();
374
375  /**
376   * Gets the number of the flushes in mob-enabled stores.
377   */
378  long getMobFlushCount();
379
380  /**
381   * Gets the number of mob cells flushed to disk.
382   */
383  long getMobFlushedCellsCount();
384
385  /**
386   * Gets the total amount of mob cells flushed to disk, in bytes.
387   */
388  long getMobFlushedCellsSize();
389
390  /**
391   * Gets the number of scanned mob cells.
392   */
393  long getMobScanCellsCount();
394
395  /**
396   * Gets the total amount of scanned mob cells, in bytes.
397   */
398  long getMobScanCellsSize();
399
400  /**
401   * Gets the count of accesses to the mob file cache.
402   */
403  long getMobFileCacheAccessCount();
404
405  /**
406   * Gets the count of misses to the mob file cache.
407   */
408  long getMobFileCacheMissCount();
409
410  /**
411   * Gets the number of items evicted from the mob file cache.
412   */
413  long getMobFileCacheEvictedCount();
414
415  /**
416   * Gets the count of cached mob files.
417   */
418  long getMobFileCacheCount();
419
420  /**
421   * Gets the hit percent to the mob file cache.
422   */
423  double getMobFileCacheHitPercent();
424
425  /**
426   * @return Count of hedged read operations
427   */
428  long getHedgedReadOps();
429
430  /**
431   * @return Count of times a hedged read beat out the primary read.
432   */
433  long getHedgedReadWins();
434
435  /**
436   * @return Count of requests blocked because the memstore size is larger than blockingMemStoreSize
437   */
438  long getBlockedRequestsCount();
439
440  /**
441   * Get the number of rpc get requests to this region server.
442   */
443  long getRpcGetRequestsCount();
444
445  /**
446   * Get the number of rpc scan requests to this region server.
447   */
448  long getRpcScanRequestsCount();
449
450  /**
451   * Get the number of rpc multi requests to this region server.
452   */
453  long getRpcMultiRequestsCount();
454
455  /**
456   * Get the number of rpc mutate requests to this region server.
457   */
458  long getRpcMutateRequestsCount();
459
460  /**
461   * Get the average region size to this region server.
462   */
463  long getAverageRegionSize();
464
465  long getDataMissCount();
466
467  long getLeafIndexMissCount();
468
469  long getBloomChunkMissCount();
470
471  long getMetaMissCount();
472
473  long getRootIndexMissCount();
474
475  long getIntermediateIndexMissCount();
476
477  long getFileInfoMissCount();
478
479  long getGeneralBloomMetaMissCount();
480
481  long getDeleteFamilyBloomMissCount();
482
483  long getTrailerMissCount();
484
485  long getDataHitCount();
486
487  long getLeafIndexHitCount();
488
489  long getBloomChunkHitCount();
490
491  long getMetaHitCount();
492
493  long getRootIndexHitCount();
494
495  long getIntermediateIndexHitCount();
496
497  long getFileInfoHitCount();
498
499  long getGeneralBloomMetaHitCount();
500
501  long getDeleteFamilyBloomHitCount();
502
503  long getTrailerHitCount();
504
505  long getTotalRowActionRequestCount();
506}