HBASE-18737 Display configured max size of memstore and cache on RS UI
Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
parent
bd219c0fb8
commit
7e1517545c
|
@ -198,6 +198,11 @@ public class MemcachedBlockCache implements BlockCache {
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxSize() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getFreeSize() {
|
||||
return 0;
|
||||
|
|
|
@ -207,6 +207,7 @@ public interface MetricsRegionServerWrapper {
|
|||
*/
|
||||
int getFlushQueueSize();
|
||||
|
||||
public long getMemstoreLimit();
|
||||
/**
|
||||
* Get the size (in bytes) of the block cache that is free.
|
||||
*/
|
||||
|
|
|
@ -326,25 +326,30 @@ are combined counts. Request count is sum of hits and misses.</p>
|
|||
</tr>
|
||||
</%if>
|
||||
<tr>
|
||||
<td>Count</td>
|
||||
<td>Cache Size Limit</td>
|
||||
<td><% TraditionalBinaryPrefix.long2String(bc.getMaxSize(), "B", 1) %></td>
|
||||
<td>Max size of cache</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Block Count</td>
|
||||
<td><% String.format("%,d", bc.getBlockCount()) %></td>
|
||||
<td>Count of Blocks</td>
|
||||
</tr>
|
||||
<%if !bucketCache %>
|
||||
<tr>
|
||||
<td>Count</td>
|
||||
<td>Data Block Count</td>
|
||||
<td><% String.format("%,d", bc.getDataBlockCount()) %></td>
|
||||
<td>Count of DATA Blocks</td>
|
||||
</tr>
|
||||
</%if>
|
||||
<tr>
|
||||
<td>Size</td>
|
||||
<td>Size of Blocks</td>
|
||||
<td><% TraditionalBinaryPrefix.long2String(bc.getCurrentSize(), "B", 1) %></td>
|
||||
<td>Size of Blocks</td>
|
||||
</tr>
|
||||
<%if !bucketCache %>
|
||||
<tr>
|
||||
<td>Size</td>
|
||||
<td>Size of Data Blocks</td>
|
||||
<td><% TraditionalBinaryPrefix.long2String(bc.getCurrentDataSize(), "B", 1) %></td>
|
||||
<td>Size of DATA Blocks</td>
|
||||
</tr>
|
||||
|
|
|
@ -108,12 +108,12 @@ org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
|
|||
</section>
|
||||
|
||||
<section>
|
||||
<& ../common/TaskMonitorTmpl; filter = filter &>
|
||||
<h2>Block Cache</h2>
|
||||
<& BlockCacheTmpl; cacheConfig = regionServer.getCacheConfig(); config = regionServer.getConfiguration() &>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Block Cache</h2>
|
||||
<& BlockCacheTmpl; cacheConfig = regionServer.getCacheConfig(); config = regionServer.getConfiguration() &>
|
||||
<& ../common/TaskMonitorTmpl; filter = filter &>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
|
|
@ -112,6 +112,7 @@ MetricsRegionServerWrapper mWrap;
|
|||
<th>Direct Memory Used</th>
|
||||
<th>Direct Memory Configured</th>
|
||||
<th>Memstore Size</th>
|
||||
<th>Memstore Limit</th>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -127,7 +128,12 @@ MetricsRegionServerWrapper mWrap;
|
|||
<td>
|
||||
<% TraditionalBinaryPrefix.long2String(DirectMemoryUtils.getDirectMemorySize(), "B", 1) %>
|
||||
</td>
|
||||
<td><% TraditionalBinaryPrefix.long2String(mWrap.getMemstoreSize(), "B", 1) %></td>
|
||||
<td>
|
||||
<% TraditionalBinaryPrefix.long2String(mWrap.getMemstoreSize(), "B", 1) %>
|
||||
</td>
|
||||
<td>
|
||||
<% TraditionalBinaryPrefix.long2String(mWrap.getMemstoreLimit(), "B", 1) %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</%def>
|
||||
|
|
|
@ -90,6 +90,12 @@ public interface BlockCache extends Iterable<CachedBlock> {
|
|||
*/
|
||||
long size();
|
||||
|
||||
/**
|
||||
* Returns the Max size of the block cache, in bytes.
|
||||
* @return size of cache, in bytes
|
||||
*/
|
||||
long getMaxSize();
|
||||
|
||||
/**
|
||||
* Returns the free size of the block cache, in bytes.
|
||||
* @return free space in cache, in bytes
|
||||
|
|
|
@ -113,6 +113,11 @@ public class CombinedBlockCache implements ResizableBlockCache, HeapSize {
|
|||
return lruCache.size() + l2Cache.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxSize() {
|
||||
return lruCache.getMaxSize() + l2Cache.getMaxSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getCurrentDataSize() {
|
||||
return lruCache.getCurrentDataSize() + l2Cache.getCurrentDataSize();
|
||||
|
|
|
@ -840,6 +840,8 @@ public class LruBlockCache implements ResizableBlockCache, HeapSize {
|
|||
*
|
||||
* @return max size in bytes
|
||||
*/
|
||||
|
||||
@Override
|
||||
public long getMaxSize() {
|
||||
return this.maxSize;
|
||||
}
|
||||
|
|
|
@ -353,6 +353,7 @@ public class BucketCache implements BlockCache, HeapSize {
|
|||
return this.cacheEnabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxSize() {
|
||||
return this.cacheCapacity;
|
||||
}
|
||||
|
|
|
@ -281,6 +281,11 @@ class MetricsRegionServerWrapperImpl
|
|||
return this.blockCache.getBlockCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMemstoreLimit() {
|
||||
return this.regionServer.getRegionServerAccounting().getGlobalMemstoreLimit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getBlockCacheSize() {
|
||||
if (this.blockCache == null) {
|
||||
|
|
|
@ -205,6 +205,11 @@ public class MetricsRegionServerWrapperStub implements MetricsRegionServerWrappe
|
|||
return 412;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMemstoreLimit() {
|
||||
return 419;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getBlockCacheFreeSize() {
|
||||
return 413;
|
||||
|
|
|
@ -737,6 +737,11 @@ public class TestHeapMemoryManager {
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxSize() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getFreeSize() {
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue