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