blob: ba183d1a17cd68463cc1aa0975f0bfca2ac1c4f1 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>BucketAllocator (Apache HBase 3.0.0-alpha-2-SNAPSHOT API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="BucketAllocator (Apache HBase 3.0.0-alpha-2-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/BucketAllocator.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.Bucket.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html" target="_top">Frames</a></li>
<li><a href="BucketAllocator.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.hadoop.hbase.io.hfile.bucket</div>
<h2 title="Class BucketAllocator" class="title">Class BucketAllocator</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>@InterfaceAudience.Private
public final class <a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.49">BucketAllocator</a>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">This class is used to allocate a block with specified size and free the block when evicting. It
manages an array of buckets, each bucket is associated with a size and caches elements up to this
size. For a completely empty bucket, this size could be re-specified dynamically.
<p/>
This class is not thread safe.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.Bucket.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.Bucket</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>(package private) class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.BucketSizeInfo.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.BucketSizeInfo</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>(package private) static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.IndexStatistics.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.IndexStatistics</a></span></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#bigItemSize">bigItemSize</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#bucketCapacity">bucketCapacity</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private <a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.Bucket.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.Bucket</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#buckets">buckets</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private <a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.BucketSizeInfo.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.BucketSizeInfo</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#bucketSizeInfos">bucketSizeInfos</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private int[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#bucketSizes">bucketSizes</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static int[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#DEFAULT_BUCKET_SIZES">DEFAULT_BUCKET_SIZES</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#FEWEST_ITEMS_IN_BUCKET">FEWEST_ITEMS_IN_BUCKET</a></span></code>
<div class="block">So, what is the minimum amount of items we'll tolerate in a single bucket?</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static org.slf4j.Logger</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#LOG">LOG</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#totalSize">totalSize</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#usedSize">usedSize</a></span></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#BucketAllocator-long-int:A-">BucketAllocator</a></span>(long&nbsp;availableSpace,
int[]&nbsp;bucketSizes)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#BucketAllocator-long-int:A-java.util.Map-java.util.concurrent.atomic.LongAdder-">BucketAllocator</a></span>(long&nbsp;availableSpace,
int[]&nbsp;bucketSizes,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/BlockCacheKey.html" title="class in org.apache.hadoop.hbase.io.hfile">BlockCacheKey</a>,<a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketEntry.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketEntry</a>&gt;&nbsp;map,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/LongAdder.html?is-external=true" title="class or interface in java.util.concurrent.atomic">LongAdder</a>&nbsp;realCacheSize)</code>
<div class="block">Rebuild the allocator's data structures from a persisted map.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#allocateBlock-int-">allocateBlock</a></span>(int&nbsp;blockSize)</code>
<div class="block">Allocate a block with specified size.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#freeBlock-long-">freeBlock</a></span>(long&nbsp;offset)</code>
<div class="block">Free a block with the offset</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#freeBlock-long:A-">freeBlock</a></span>(long[]&nbsp;freeList)</code>&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#getBucketIndex-long-">getBucketIndex</a></span>(long&nbsp;offset)</code>&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.Bucket.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.Bucket</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#getBuckets--">getBuckets</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#getFreeSize--">getFreeSize</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>(package private) <a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.IndexStatistics.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.IndexStatistics</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#getIndexStatistics--">getIndexStatistics</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>(package private) <a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.IndexStatistics.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.IndexStatistics</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#getIndexStatistics-org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.IndexStatistics-">getIndexStatistics</a></span>(<a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.IndexStatistics.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.IndexStatistics</a>&nbsp;grandTotal)</code>&nbsp;</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#getLeastFilledBuckets-java.util.Set-int-">getLeastFilledBuckets</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;&nbsp;excludedBuckets,
int&nbsp;bucketCount)</code>
<div class="block">Returns a set of indices of the buckets that are least filled
excluding the offsets, we also the fully free buckets for the
BucketSizes where everything is empty and they only have one
completely free bucket as a reserved</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#getTotalSize--">getTotalSize</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#getUsedSize--">getUsedSize</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>private <a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.Bucket.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.Bucket</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#grabGlobalCompletelyFreeBucket--">grabGlobalCompletelyFreeBucket</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>(package private) void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#logStatistics--">logStatistics</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.BucketSizeInfo.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.BucketSizeInfo</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#roundUpToBucketSizeInfo-int-">roundUpToBucketSizeInfo</a></span>(int&nbsp;blockSize)</code>
<div class="block">Round up the given block size to bucket size, and get the corresponding
BucketSizeInfo</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#sizeIndexOfAllocation-long-">sizeIndexOfAllocation</a></span>(long&nbsp;offset)</code>&nbsp;</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#sizeOfAllocation-long-">sizeOfAllocation</a></span>(long&nbsp;offset)</code>&nbsp;</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#toString--">toString</a></span>()</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="LOG">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>LOG</h4>
<pre>private static final&nbsp;org.slf4j.Logger <a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.50">LOG</a></pre>
</li>
</ul>
<a name="DEFAULT_BUCKET_SIZES">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DEFAULT_BUCKET_SIZES</h4>
<pre>private static final&nbsp;int[] <a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.275">DEFAULT_BUCKET_SIZES</a></pre>
</li>
</ul>
<a name="FEWEST_ITEMS_IN_BUCKET">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>FEWEST_ITEMS_IN_BUCKET</h4>
<pre>public static final&nbsp;int <a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.295">FEWEST_ITEMS_IN_BUCKET</a></pre>
<div class="block">So, what is the minimum amount of items we'll tolerate in a single bucket?</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../../constant-values.html#org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.FEWEST_ITEMS_IN_BUCKET">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="bucketSizes">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>bucketSizes</h4>
<pre>private final&nbsp;int[] <a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.297">bucketSizes</a></pre>
</li>
</ul>
<a name="bigItemSize">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>bigItemSize</h4>
<pre>private final&nbsp;int <a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.298">bigItemSize</a></pre>
</li>
</ul>
<a name="bucketCapacity">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>bucketCapacity</h4>
<pre>private final&nbsp;long <a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.300">bucketCapacity</a></pre>
</li>
</ul>
<a name="buckets">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>buckets</h4>
<pre>private&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.Bucket.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.Bucket</a>[] <a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.301">buckets</a></pre>
</li>
</ul>
<a name="bucketSizeInfos">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>bucketSizeInfos</h4>
<pre>private&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.BucketSizeInfo.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.BucketSizeInfo</a>[] <a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.302">bucketSizeInfos</a></pre>
</li>
</ul>
<a name="totalSize">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>totalSize</h4>
<pre>private final&nbsp;long <a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.303">totalSize</a></pre>
</li>
</ul>
<a name="usedSize">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>usedSize</h4>
<pre>private transient&nbsp;long <a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.304">usedSize</a></pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="BucketAllocator-long-int:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>BucketAllocator</h4>
<pre><a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.306">BucketAllocator</a>(long&nbsp;availableSpace,
int[]&nbsp;bucketSizes)
throws <a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocatorException.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocatorException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocatorException.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocatorException</a></code></dd>
</dl>
</li>
</ul>
<a name="BucketAllocator-long-int:A-java.util.Map-java.util.concurrent.atomic.LongAdder-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>BucketAllocator</h4>
<pre><a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.342">BucketAllocator</a>(long&nbsp;availableSpace,
int[]&nbsp;bucketSizes,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/BlockCacheKey.html" title="class in org.apache.hadoop.hbase.io.hfile">BlockCacheKey</a>,<a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketEntry.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketEntry</a>&gt;&nbsp;map,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/LongAdder.html?is-external=true" title="class or interface in java.util.concurrent.atomic">LongAdder</a>&nbsp;realCacheSize)
throws <a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocatorException.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocatorException</a></pre>
<div class="block">Rebuild the allocator's data structures from a persisted map.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>availableSpace</code> - capacity of cache</dd>
<dd><code>map</code> - A map stores the block key and BucketEntry(block's meta data
like offset, length)</dd>
<dd><code>realCacheSize</code> - cached data size statistics for bucket cache</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocatorException.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocatorException</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="roundUpToBucketSizeInfo-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>roundUpToBucketSizeInfo</h4>
<pre>public&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.BucketSizeInfo.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.BucketSizeInfo</a>&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.285">roundUpToBucketSizeInfo</a>(int&nbsp;blockSize)</pre>
<div class="block">Round up the given block size to bucket size, and get the corresponding
BucketSizeInfo</div>
</li>
</ul>
<a name="toString--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.411">toString</a>()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
</dl>
</li>
</ul>
<a name="getUsedSize--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUsedSize</h4>
<pre>public&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.422">getUsedSize</a>()</pre>
</li>
</ul>
<a name="getFreeSize--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFreeSize</h4>
<pre>public&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.426">getFreeSize</a>()</pre>
</li>
</ul>
<a name="getTotalSize--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTotalSize</h4>
<pre>public&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.430">getTotalSize</a>()</pre>
</li>
</ul>
<a name="allocateBlock-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>allocateBlock</h4>
<pre>public&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.441">allocateBlock</a>(int&nbsp;blockSize)
throws <a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/CacheFullException.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">CacheFullException</a>,
<a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocatorException.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocatorException</a></pre>
<div class="block">Allocate a block with specified size. Return the offset</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>blockSize</code> - size of block</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the offset in the IOEngine</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocatorException.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocatorException</a></code></dd>
<dd><code><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/CacheFullException.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">CacheFullException</a></code></dd>
</dl>
</li>
</ul>
<a name="grabGlobalCompletelyFreeBucket--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>grabGlobalCompletelyFreeBucket</h4>
<pre>private&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.Bucket.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.Bucket</a>&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.459">grabGlobalCompletelyFreeBucket</a>()</pre>
</li>
</ul>
<a name="freeBlock-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>freeBlock</h4>
<pre>public&nbsp;int&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.472">freeBlock</a>(long&nbsp;offset)</pre>
<div class="block">Free a block with the offset</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>offset</code> - block's offset</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>size freed</dd>
</dl>
</li>
</ul>
<a name="sizeIndexOfAllocation-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sizeIndexOfAllocation</h4>
<pre>public&nbsp;int&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.481">sizeIndexOfAllocation</a>(long&nbsp;offset)</pre>
</li>
</ul>
<a name="sizeOfAllocation-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sizeOfAllocation</h4>
<pre>public&nbsp;int&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.488">sizeOfAllocation</a>(long&nbsp;offset)</pre>
</li>
</ul>
<a name="getBuckets--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBuckets</h4>
<pre>public&nbsp;<a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.Bucket.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.Bucket</a>[]&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.542">getBuckets</a>()</pre>
</li>
</ul>
<a name="logStatistics--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>logStatistics</h4>
<pre>void&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.546">logStatistics</a>()</pre>
</li>
</ul>
<a name="getIndexStatistics-org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.IndexStatistics-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIndexStatistics</h4>
<pre><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.IndexStatistics.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.IndexStatistics</a>[]&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.558">getIndexStatistics</a>(<a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.IndexStatistics.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.IndexStatistics</a>&nbsp;grandTotal)</pre>
</li>
</ul>
<a name="getIndexStatistics--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIndexStatistics</h4>
<pre><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.IndexStatistics.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket">BucketAllocator.IndexStatistics</a>[]&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.569">getIndexStatistics</a>()</pre>
</li>
</ul>
<a name="freeBlock-long:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>freeBlock</h4>
<pre>public&nbsp;long&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.576">freeBlock</a>(long[]&nbsp;freeList)</pre>
</li>
</ul>
<a name="getBucketIndex-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBucketIndex</h4>
<pre>public&nbsp;int&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.583">getBucketIndex</a>(long&nbsp;offset)</pre>
</li>
</ul>
<a name="getLeastFilledBuckets-java.util.Set-int-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getLeastFilledBuckets</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;&nbsp;<a href="../../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html#line.598">getLeastFilledBuckets</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;&nbsp;excludedBuckets,
int&nbsp;bucketCount)</pre>
<div class="block">Returns a set of indices of the buckets that are least filled
excluding the offsets, we also the fully free buckets for the
BucketSizes where everything is empty and they only have one
completely free bucket as a reserved</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>excludedBuckets</code> - the buckets that need to be excluded due to
currently being in used</dd>
<dd><code>bucketCount</code> - max Number of buckets to return</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>set of bucket indices which could be used for eviction</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/BucketAllocator.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li><a href="../../../../../../../org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.Bucket.html" title="class in org.apache.hadoop.hbase.io.hfile.bucket"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.html" target="_top">Frames</a></li>
<li><a href="BucketAllocator.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2007&#x2013;2021 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>