blob: 8e7ba5ff22195c57d5581d7322667988496cfb5e [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>HFileBlockIndex.BlockIndexWriter (Apache HBase 4.0.0-alpha-1-SNAPSHOT API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.hadoop.hbase.io.hfile, class: HFileBlockIndex, class: BlockIndexWriter">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../script-dir/jquery-3.6.1.min.js"></script>
<script type="text/javascript" src="../../../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var evenRowColor = "even-row-color";
var oddRowColor = "odd-row-color";
var tableTab = "table-tab";
var activeTableTab = "active-table-tab";
var pathtoroot = "../../../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="class-use/HFileBlockIndex.BlockIndexWriter.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#class">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&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="sub-nav-list">
<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>
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.hadoop.hbase.io.hfile</a></div>
<h1 title="Class HFileBlockIndex.BlockIndexWriter" class="title">Class HFileBlockIndex.BlockIndexWriter</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance">org.apache.hadoop.hbase.io.hfile.HFileBlockIndex.BlockIndexWriter</div>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="InlineBlockWriter.html" title="interface in org.apache.hadoop.hbase.io.hfile">InlineBlockWriter</a></code></dd>
</dl>
<dl class="notes">
<dt>Enclosing class:</dt>
<dd><a href="HFileBlockIndex.html" title="class in org.apache.hadoop.hbase.io.hfile">HFileBlockIndex</a></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public static class </span><span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.html#line-932">HFileBlockIndex.BlockIndexWriter</a></span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
implements <a href="InlineBlockWriter.html" title="interface in org.apache.hadoop.hbase.io.hfile">InlineBlockWriter</a></span></div>
<div class="block">Writes the block index into the output stream. Generate the tree from bottom up. The leaf level
is written to disk as a sequence of inline blocks, if it is larger than a certain number of
bytes. If the leaf level is not large enough, we write all entries to the root level instead.
After all leaf blocks have been written, we end up with an index referencing the resulting leaf
index blocks. If that index is larger than the allowed root index size, the writer will break
it up into reasonable-size intermediate-level index block chunks write those chunks out, and
create another index referencing those chunks. This will be repeated until the remaining index
is small enough to become the root index. However, in most practical cases we will only have
leaf-level blocks and the root index, or just the root index.</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- =========== FIELD SUMMARY =========== -->
<li>
<section class="field-summary" id="field-summary">
<h2>Field Summary</h2>
<div class="caption"><span>Fields</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Field</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>private <a href="HFileBlock.Writer.html" title="class in org.apache.hadoop.hbase.io.hfile">HFileBlock.Writer</a></code></div>
<div class="col-second even-row-color"><code><a href="#blockWriter" class="member-name-link">blockWriter</a></code></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><code>private <a href="CacheConfig.html" title="class in org.apache.hadoop.hbase.io.hfile">CacheConfig</a></code></div>
<div class="col-second odd-row-color"><code><a href="#cacheConf" class="member-name-link">cacheConf</a></code></div>
<div class="col-last odd-row-color">
<div class="block">CacheConfig, or null if cache-on-write is disabled</div>
</div>
<div class="col-first even-row-color"><code>private <a href="BlockIndexChunk.html" title="interface in org.apache.hadoop.hbase.io.hfile">BlockIndexChunk</a></code></div>
<div class="col-second even-row-color"><code><a href="#curInlineChunk" class="member-name-link">curInlineChunk</a></code></div>
<div class="col-last even-row-color">
<div class="block">Current leaf-level chunk.</div>
</div>
<div class="col-first odd-row-color"><code>private byte[]</code></div>
<div class="col-second odd-row-color"><code><a href="#firstKey" class="member-name-link">firstKey</a></code></div>
<div class="col-last odd-row-color">&nbsp;</div>
<div class="col-first even-row-color"><code>private <a href="HFileIndexBlockEncoder.html" title="interface in org.apache.hadoop.hbase.io.hfile">HFileIndexBlockEncoder</a></code></div>
<div class="col-second even-row-color"><code><a href="#indexBlockEncoder" class="member-name-link">indexBlockEncoder</a></code></div>
<div class="col-last even-row-color">
<div class="block">Type of encoding used for index blocks in HFile</div>
</div>
<div class="col-first odd-row-color"><code>private int</code></div>
<div class="col-second odd-row-color"><code><a href="#maxChunkSize" class="member-name-link">maxChunkSize</a></code></div>
<div class="col-last odd-row-color">
<div class="block">The maximum size guideline of all multi-level index blocks.</div>
</div>
<div class="col-first even-row-color"><code>private int</code></div>
<div class="col-second even-row-color"><code><a href="#minIndexNumEntries" class="member-name-link">minIndexNumEntries</a></code></div>
<div class="col-last even-row-color">
<div class="block">The maximum level of multi-level index blocks</div>
</div>
<div class="col-first odd-row-color"><code>private <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color"><code><a href="#nameForCaching" class="member-name-link">nameForCaching</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Name to use for computing cache keys</div>
</div>
<div class="col-first even-row-color"><code>private int</code></div>
<div class="col-second even-row-color"><code><a href="#numLevels" class="member-name-link">numLevels</a></code></div>
<div class="col-last even-row-color">
<div class="block">The number of block index levels.</div>
</div>
<div class="col-first odd-row-color"><code>private <a href="BlockIndexChunk.html" title="interface in org.apache.hadoop.hbase.io.hfile">BlockIndexChunk</a></code></div>
<div class="col-second odd-row-color"><code><a href="#rootChunk" class="member-name-link">rootChunk</a></code></div>
<div class="col-last odd-row-color">
<div class="block">While the index is being written, this represents the current block index referencing all
leaf blocks, with one exception.</div>
</div>
<div class="col-first even-row-color"><code>private boolean</code></div>
<div class="col-second even-row-color"><code><a href="#singleLevelOnly" class="member-name-link">singleLevelOnly</a></code></div>
<div class="col-last even-row-color">
<div class="block">Whether we require this block index to always be single-level.</div>
</div>
<div class="col-first odd-row-color"><code>private long</code></div>
<div class="col-second odd-row-color"><code><a href="#totalBlockOnDiskSize" class="member-name-link">totalBlockOnDiskSize</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Total compressed size of all index blocks.</div>
</div>
<div class="col-first even-row-color"><code>private long</code></div>
<div class="col-second even-row-color"><code><a href="#totalBlockUncompressedSize" class="member-name-link">totalBlockUncompressedSize</a></code></div>
<div class="col-last even-row-color">
<div class="block">Total uncompressed size of all index blocks.</div>
</div>
<div class="col-first odd-row-color"><code>private long</code></div>
<div class="col-second odd-row-color"><code><a href="#totalNumEntries" class="member-name-link">totalNumEntries</a></code></div>
<div class="col-last odd-row-color">
<div class="block">The total number of leaf-level entries, i.e.</div>
</div>
</div>
</section>
</li>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">BlockIndexWriter</a>()</code></div>
<div class="col-last even-row-color">
<div class="block">Creates a single-level block index writer</div>
</div>
<div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(org.apache.hadoop.hbase.io.hfile.HFileBlock.Writer,org.apache.hadoop.hbase.io.hfile.CacheConfig,java.lang.String,org.apache.hadoop.hbase.io.hfile.HFileIndexBlockEncoder)" class="member-name-link">BlockIndexWriter</a><wbr>(<a href="HFileBlock.Writer.html" title="class in org.apache.hadoop.hbase.io.hfile">HFileBlock.Writer</a>&nbsp;blockWriter,
<a href="CacheConfig.html" title="class in org.apache.hadoop.hbase.io.hfile">CacheConfig</a>&nbsp;cacheConf,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;nameForCaching,
<a href="HFileIndexBlockEncoder.html" title="interface in org.apache.hadoop.hbase.io.hfile">HFileIndexBlockEncoder</a>&nbsp;indexBlockEncoder)</code></div>
<div class="col-last odd-row-color">
<div class="block">Creates a multi-level block index writer.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addEntry(byte%5B%5D,long,int)" class="member-name-link">addEntry</a><wbr>(byte[]&nbsp;firstKey,
long&nbsp;blockOffset,
int&nbsp;blockDataSize)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Add one index entry to the current leaf-level block.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#blockWritten(long,int,int)" class="member-name-link">blockWritten</a><wbr>(long&nbsp;offset,
int&nbsp;onDiskSize,
int&nbsp;uncompressedSize)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Called after an inline block has been written so that we can add an entry referring to that
block to the parent-level index.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#ensureSingleLevel()" class="member-name-link">ensureSingleLevel</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>private void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#expectNumLevels(int)" class="member-name-link">expectNumLevels</a><wbr>(int&nbsp;expectedNumLevels)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getCacheOnWrite()" class="member-name-link">getCacheOnWrite</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns true if inline blocks produced by this writer should be cached</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="BlockType.html" title="enum class in org.apache.hadoop.hbase.io.hfile">BlockType</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getInlineBlockType()" class="member-name-link">getInlineBlockType</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">The type of blocks this block writer produces.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getNumLevels()" class="member-name-link">getNumLevels</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the number of levels in this block index.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>final int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getNumRootEntries()" class="member-name-link">getNumRootEntries</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns how many block index entries there are in the root level</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>long</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTotalUncompressedSize()" class="member-name-link">getTotalUncompressedSize</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">The total uncompressed size of the root index block, intermediate-level index blocks, and
leaf-level index blocks.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setMaxChunkSize(int)" class="member-name-link">setMaxChunkSize</a><wbr>(int&nbsp;maxChunkSize)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setMinIndexNumEntries(int)" class="member-name-link">setMinIndexNumEntries</a><wbr>(int&nbsp;minIndexNumEntries)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#shouldWriteBlock(boolean)" class="member-name-link">shouldWriteBlock</a><wbr>(boolean&nbsp;closing)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Whether there is an inline block ready to be written.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>long</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#writeIndexBlocks(org.apache.hadoop.fs.FSDataOutputStream)" class="member-name-link">writeIndexBlocks</a><wbr>(org.apache.hadoop.fs.FSDataOutputStream&nbsp;out)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Writes the root level and intermediate levels of the block index into the output stream,
generating the tree from bottom up.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#writeInlineBlock(java.io.DataOutput)" class="member-name-link">writeInlineBlock</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/DataOutput.html" title="class or interface in java.io" class="external-link">DataOutput</a>&nbsp;out)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Write out the current inline index block.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>private void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#writeIntermediateBlock(org.apache.hadoop.fs.FSDataOutputStream,org.apache.hadoop.hbase.io.hfile.BlockIndexChunk,org.apache.hadoop.hbase.io.hfile.BlockIndexChunk)" class="member-name-link">writeIntermediateBlock</a><wbr>(org.apache.hadoop.fs.FSDataOutputStream&nbsp;out,
<a href="BlockIndexChunk.html" title="interface in org.apache.hadoop.hbase.io.hfile">BlockIndexChunk</a>&nbsp;parent,
<a href="BlockIndexChunk.html" title="interface in org.apache.hadoop.hbase.io.hfile">BlockIndexChunk</a>&nbsp;curChunk)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>private <a href="BlockIndexChunk.html" title="interface in org.apache.hadoop.hbase.io.hfile">BlockIndexChunk</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#writeIntermediateLevel(org.apache.hadoop.fs.FSDataOutputStream,org.apache.hadoop.hbase.io.hfile.BlockIndexChunk)" class="member-name-link">writeIntermediateLevel</a><wbr>(org.apache.hadoop.fs.FSDataOutputStream&nbsp;out,
<a href="BlockIndexChunk.html" title="interface in org.apache.hadoop.hbase.io.hfile">BlockIndexChunk</a>&nbsp;currentLevel)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Split the current level of the block index into intermediate index blocks of permitted size
and write those blocks to disk.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#writeSingleLevelIndex(java.io.DataOutput,java.lang.String)" class="member-name-link">writeSingleLevelIndex</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/DataOutput.html" title="class or interface in java.io" class="external-link">DataOutput</a>&nbsp;out,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;description)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Writes the block index data as a single level only.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ FIELD DETAIL =========== -->
<li>
<section class="field-details" id="field-detail">
<h2>Field Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="rootChunk">
<h3>rootChunk</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type"><a href="BlockIndexChunk.html" title="interface in org.apache.hadoop.hbase.io.hfile">BlockIndexChunk</a></span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-940">rootChunk</a></span></div>
<div class="block">While the index is being written, this represents the current block index referencing all
leaf blocks, with one exception. If the file is being closed and there are not enough blocks
to complete even a single leaf block, no leaf blocks get written and this contains the entire
block index. After all levels of the index were written by
<a href="#writeIndexBlocks(org.apache.hadoop.fs.FSDataOutputStream)"><code>writeIndexBlocks(FSDataOutputStream)</code></a>, this contains the final root-level index.</div>
</section>
</li>
<li>
<section class="detail" id="curInlineChunk">
<h3>curInlineChunk</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type"><a href="BlockIndexChunk.html" title="interface in org.apache.hadoop.hbase.io.hfile">BlockIndexChunk</a></span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-946">curInlineChunk</a></span></div>
<div class="block">Current leaf-level chunk. New entries referencing data blocks get added to this chunk until
it grows large enough to be written to disk.</div>
</section>
</li>
<li>
<section class="detail" id="numLevels">
<h3>numLevels</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-955">numLevels</a></span></div>
<div class="block">The number of block index levels. This is one if there is only root level (even empty), two
if there a leaf level and root level, and is higher if there are intermediate levels. This is
only final after <a href="#writeIndexBlocks(org.apache.hadoop.fs.FSDataOutputStream)"><code>writeIndexBlocks(FSDataOutputStream)</code></a> has been called. The initial
value accounts for the root level, and will be increased to two as soon as we find out there
is a leaf-level in <a href="#blockWritten(long,int,int)"><code>blockWritten(long, int, int)</code></a>.</div>
</section>
</li>
<li>
<section class="detail" id="blockWriter">
<h3>blockWriter</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type"><a href="HFileBlock.Writer.html" title="class in org.apache.hadoop.hbase.io.hfile">HFileBlock.Writer</a></span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-957">blockWriter</a></span></div>
</section>
</li>
<li>
<section class="detail" id="firstKey">
<h3>firstKey</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type">byte[]</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-958">firstKey</a></span></div>
</section>
</li>
<li>
<section class="detail" id="totalNumEntries">
<h3>totalNumEntries</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-964">totalNumEntries</a></span></div>
<div class="block">The total number of leaf-level entries, i.e. entries referenced by leaf-level blocks. For the
data block index this is equal to the number of data blocks.</div>
</section>
</li>
<li>
<section class="detail" id="totalBlockOnDiskSize">
<h3>totalBlockOnDiskSize</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-967">totalBlockOnDiskSize</a></span></div>
<div class="block">Total compressed size of all index blocks.</div>
</section>
</li>
<li>
<section class="detail" id="totalBlockUncompressedSize">
<h3>totalBlockUncompressedSize</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-970">totalBlockUncompressedSize</a></span></div>
<div class="block">Total uncompressed size of all index blocks.</div>
</section>
</li>
<li>
<section class="detail" id="maxChunkSize">
<h3>maxChunkSize</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-973">maxChunkSize</a></span></div>
<div class="block">The maximum size guideline of all multi-level index blocks.</div>
</section>
</li>
<li>
<section class="detail" id="minIndexNumEntries">
<h3>minIndexNumEntries</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-976">minIndexNumEntries</a></span></div>
<div class="block">The maximum level of multi-level index blocks</div>
</section>
</li>
<li>
<section class="detail" id="singleLevelOnly">
<h3>singleLevelOnly</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-979">singleLevelOnly</a></span></div>
<div class="block">Whether we require this block index to always be single-level.</div>
</section>
</li>
<li>
<section class="detail" id="cacheConf">
<h3>cacheConf</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type"><a href="CacheConfig.html" title="class in org.apache.hadoop.hbase.io.hfile">CacheConfig</a></span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-982">cacheConf</a></span></div>
<div class="block">CacheConfig, or null if cache-on-write is disabled</div>
</section>
</li>
<li>
<section class="detail" id="nameForCaching">
<h3>nameForCaching</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-985">nameForCaching</a></span></div>
<div class="block">Name to use for computing cache keys</div>
</section>
</li>
<li>
<section class="detail" id="indexBlockEncoder">
<h3>indexBlockEncoder</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type"><a href="HFileIndexBlockEncoder.html" title="interface in org.apache.hadoop.hbase.io.hfile">HFileIndexBlockEncoder</a></span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-988">indexBlockEncoder</a></span></div>
<div class="block">Type of encoding used for index blocks in HFile</div>
</section>
</li>
</ul>
</section>
</li>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;()">
<h3>BlockIndexWriter</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-991">BlockIndexWriter</a></span>()</div>
<div class="block">Creates a single-level block index writer</div>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(org.apache.hadoop.hbase.io.hfile.HFileBlock.Writer,org.apache.hadoop.hbase.io.hfile.CacheConfig,java.lang.String,org.apache.hadoop.hbase.io.hfile.HFileIndexBlockEncoder)">
<h3>BlockIndexWriter</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1001">BlockIndexWriter</a></span><wbr><span class="parameters">(<a href="HFileBlock.Writer.html" title="class in org.apache.hadoop.hbase.io.hfile">HFileBlock.Writer</a>&nbsp;blockWriter,
<a href="CacheConfig.html" title="class in org.apache.hadoop.hbase.io.hfile">CacheConfig</a>&nbsp;cacheConf,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;nameForCaching,
<a href="HFileIndexBlockEncoder.html" title="interface in org.apache.hadoop.hbase.io.hfile">HFileIndexBlockEncoder</a>&nbsp;indexBlockEncoder)</span></div>
<div class="block">Creates a multi-level block index writer.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>blockWriter</code> - the block writer to use to write index blocks</dd>
<dd><code>cacheConf</code> - used to determine when and how a block should be cached-on-write.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="setMaxChunkSize(int)">
<h3>setMaxChunkSize</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1017">setMaxChunkSize</a></span><wbr><span class="parameters">(int&nbsp;maxChunkSize)</span></div>
</section>
</li>
<li>
<section class="detail" id="setMinIndexNumEntries(int)">
<h3>setMinIndexNumEntries</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1024">setMinIndexNumEntries</a></span><wbr><span class="parameters">(int&nbsp;minIndexNumEntries)</span></div>
</section>
</li>
<li>
<section class="detail" id="writeIndexBlocks(org.apache.hadoop.fs.FSDataOutputStream)">
<h3>writeIndexBlocks</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1043">writeIndexBlocks</a></span><wbr><span class="parameters">(org.apache.hadoop.fs.FSDataOutputStream&nbsp;out)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div>
<div class="block">Writes the root level and intermediate levels of the block index into the output stream,
generating the tree from bottom up. Assumes that the leaf level has been inline-written to
the disk if there is enough data for more than one leaf block. We iterate by breaking the
current level of the block index, starting with the index of all leaf-level blocks, into
chunks small enough to be written to disk, and generate its parent level, until we end up
with a level small enough to become the root level. If the leaf level is not large enough,
there is no inline block index anymore, so we only write that level of block index to disk as
the root level.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>out</code> - FSDataOutputStream</dd>
<dt>Returns:</dt>
<dd>position at which we entered the root-level index.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeSingleLevelIndex(java.io.DataOutput,java.lang.String)">
<h3>writeSingleLevelIndex</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1103">writeSingleLevelIndex</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/DataOutput.html" title="class or interface in java.io" class="external-link">DataOutput</a>&nbsp;out,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;description)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div>
<div class="block">Writes the block index data as a single level only. Does not do any block framing.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>out</code> - the buffered output stream to write the index to. Typically a stream
writing into an <a href="HFile.html" title="class in org.apache.hadoop.hbase.io.hfile"><code>HFile</code></a> block.</dd>
<dd><code>description</code> - a short description of the index being written. Used in a log message.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeIntermediateLevel(org.apache.hadoop.fs.FSDataOutputStream,org.apache.hadoop.hbase.io.hfile.BlockIndexChunk)">
<h3>writeIntermediateLevel</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type"><a href="BlockIndexChunk.html" title="interface in org.apache.hadoop.hbase.io.hfile">BlockIndexChunk</a></span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1130">writeIntermediateLevel</a></span><wbr><span class="parameters">(org.apache.hadoop.fs.FSDataOutputStream&nbsp;out,
<a href="BlockIndexChunk.html" title="interface in org.apache.hadoop.hbase.io.hfile">BlockIndexChunk</a>&nbsp;currentLevel)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div>
<div class="block">Split the current level of the block index into intermediate index blocks of permitted size
and write those blocks to disk. Return the next level of the block index referencing those
intermediate-level blocks.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>currentLevel</code> - the current level of the block index, such as the a chunk referencing all
leaf-level index blocks</dd>
<dt>Returns:</dt>
<dd>the parent level block index, which becomes the root index after a few (usually zero)
iterations</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeIntermediateBlock(org.apache.hadoop.fs.FSDataOutputStream,org.apache.hadoop.hbase.io.hfile.BlockIndexChunk,org.apache.hadoop.hbase.io.hfile.BlockIndexChunk)">
<h3>writeIntermediateBlock</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1157">writeIntermediateBlock</a></span><wbr><span class="parameters">(org.apache.hadoop.fs.FSDataOutputStream&nbsp;out,
<a href="BlockIndexChunk.html" title="interface in org.apache.hadoop.hbase.io.hfile">BlockIndexChunk</a>&nbsp;parent,
<a href="BlockIndexChunk.html" title="interface in org.apache.hadoop.hbase.io.hfile">BlockIndexChunk</a>&nbsp;curChunk)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div>
<dl class="notes">
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getNumRootEntries()">
<h3>getNumRootEntries</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1191">getNumRootEntries</a></span>()</div>
<div class="block">Returns how many block index entries there are in the root level</div>
</section>
</li>
<li>
<section class="detail" id="getNumLevels()">
<h3>getNumLevels</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1196">getNumLevels</a></span>()</div>
<div class="block">Returns the number of levels in this block index.</div>
</section>
</li>
<li>
<section class="detail" id="expectNumLevels(int)">
<h3>expectNumLevels</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1200">expectNumLevels</a></span><wbr><span class="parameters">(int&nbsp;expectedNumLevels)</span></div>
</section>
</li>
<li>
<section class="detail" id="shouldWriteBlock(boolean)">
<h3>shouldWriteBlock</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1212">shouldWriteBlock</a></span><wbr><span class="parameters">(boolean&nbsp;closing)</span></div>
<div class="block">Whether there is an inline block ready to be written. In general, we write an leaf-level
index block as an inline block as soon as its size as serialized in the non-root format
reaches a certain threshold.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="InlineBlockWriter.html#shouldWriteBlock(boolean)">shouldWriteBlock</a></code>&nbsp;in interface&nbsp;<code><a href="InlineBlockWriter.html" title="interface in org.apache.hadoop.hbase.io.hfile">InlineBlockWriter</a></code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="writeInlineBlock(java.io.DataOutput)">
<h3>writeInlineBlock</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1249">writeInlineBlock</a></span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/DataOutput.html" title="class or interface in java.io" class="external-link">DataOutput</a>&nbsp;out)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div>
<div class="block">Write out the current inline index block. Inline blocks are non-root blocks, so the non-root
index format is used.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="InlineBlockWriter.html#writeInlineBlock(java.io.DataOutput)">writeInlineBlock</a></code>&nbsp;in interface&nbsp;<code><a href="InlineBlockWriter.html" title="interface in org.apache.hadoop.hbase.io.hfile">InlineBlockWriter</a></code></dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="blockWritten(long,int,int)">
<h3>blockWritten</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1269">blockWritten</a></span><wbr><span class="parameters">(long&nbsp;offset,
int&nbsp;onDiskSize,
int&nbsp;uncompressedSize)</span></div>
<div class="block">Called after an inline block has been written so that we can add an entry referring to that
block to the parent-level index.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="InlineBlockWriter.html#blockWritten(long,int,int)">blockWritten</a></code>&nbsp;in interface&nbsp;<code><a href="InlineBlockWriter.html" title="interface in org.apache.hadoop.hbase.io.hfile">InlineBlockWriter</a></code></dd>
<dt>Parameters:</dt>
<dd><code>offset</code> - the offset of the block in the stream</dd>
<dd><code>onDiskSize</code> - the on-disk size of the block</dd>
<dd><code>uncompressedSize</code> - the uncompressed size of the block</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getInlineBlockType()">
<h3>getInlineBlockType</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="BlockType.html" title="enum class in org.apache.hadoop.hbase.io.hfile">BlockType</a></span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1295">getInlineBlockType</a></span>()</div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="InlineBlockWriter.html#getInlineBlockType()">InlineBlockWriter</a></code></span></div>
<div class="block">The type of blocks this block writer produces.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="InlineBlockWriter.html#getInlineBlockType()">getInlineBlockType</a></code>&nbsp;in interface&nbsp;<code><a href="InlineBlockWriter.html" title="interface in org.apache.hadoop.hbase.io.hfile">InlineBlockWriter</a></code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="addEntry(byte[],long,int)">
<h3>addEntry</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1309">addEntry</a></span><wbr><span class="parameters">(byte[]&nbsp;firstKey,
long&nbsp;blockOffset,
int&nbsp;blockDataSize)</span></div>
<div class="block">Add one index entry to the current leaf-level block. When the leaf-level block gets large
enough, it will be flushed to disk as an inline block.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>firstKey</code> - the first key of the data block</dd>
<dd><code>blockOffset</code> - the offset of the data block</dd>
<dd><code>blockDataSize</code> - the on-disk size of the data block (<a href="HFile.html" title="class in org.apache.hadoop.hbase.io.hfile"><code>HFile</code></a> format version 2), or
the uncompressed size of the data block ( <a href="HFile.html" title="class in org.apache.hadoop.hbase.io.hfile"><code>HFile</code></a> format version
1).</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="ensureSingleLevel()">
<h3>ensureSingleLevel</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1317">ensureSingleLevel</a></span>()
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div>
<dl class="notes">
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - if we happened to write a multi-level index.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getCacheOnWrite()">
<h3>getCacheOnWrite</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1329">getCacheOnWrite</a></span>()</div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="InlineBlockWriter.html#getCacheOnWrite()">InlineBlockWriter</a></code></span></div>
<div class="block">Returns true if inline blocks produced by this writer should be cached</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="InlineBlockWriter.html#getCacheOnWrite()">getCacheOnWrite</a></code>&nbsp;in interface&nbsp;<code><a href="InlineBlockWriter.html" title="interface in org.apache.hadoop.hbase.io.hfile">InlineBlockWriter</a></code></dd>
<dt>Returns:</dt>
<dd>true if we are using cache-on-write. This is configured by the caller of the
constructor by either passing a valid block cache or null.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getTotalUncompressedSize()">
<h3>getTotalUncompressedSize</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name"><a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.BlockIndexWriter.html#line-1339">getTotalUncompressedSize</a></span>()</div>
<div class="block">The total uncompressed size of the root index block, intermediate-level index blocks, and
leaf-level index blocks.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the total uncompressed size of all index blocks</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2007&#x2013;2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>