blob: c69022de0a23c4ee045f27e5a7877c5995fb0c76 [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>HFileBlock.Writer (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="HFileBlock.Writer (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,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":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/HFileBlock.Writer.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><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.PrefetchedHeader.html" title="class in org.apache.hadoop.hbase.io.hfile"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.State.html" title="enum in org.apache.hadoop.hbase.io.hfile"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html" target="_top">Frames</a></li>
<li><a href="HFileBlock.Writer.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</div>
<h2 title="Class HFileBlock.Writer" class="title">Class HFileBlock.Writer</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.HFileBlock.Writer</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../../../org/apache/hadoop/hbase/regionserver/ShipperListener.html" title="interface in org.apache.hadoop.hbase.regionserver">ShipperListener</a></dd>
</dl>
<dl>
<dt>Enclosing class:</dt>
<dd><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.html" title="class in org.apache.hadoop.hbase.io.hfile">HFileBlock</a></dd>
</dl>
<hr>
<br>
<pre>static class <a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.html#line.752">HFileBlock.Writer</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>
implements <a href="../../../../../../org/apache/hadoop/hbase/regionserver/ShipperListener.html" title="interface in org.apache.hadoop.hbase.regionserver">ShipperListener</a></pre>
<div class="block">Unified version 2 <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFile.html" title="class in org.apache.hadoop.hbase.io.hfile"><code>HFile</code></a> block writer. The intended usage pattern
is as follows:
<ol>
<li>Construct an <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html" title="class in org.apache.hadoop.hbase.io.hfile"><code>HFileBlock.Writer</code></a>, providing a compression algorithm.
<li>Call <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#startWriting-org.apache.hadoop.hbase.io.hfile.BlockType-"><code>startWriting(org.apache.hadoop.hbase.io.hfile.BlockType)</code></a> and get a data stream to write to.
<li>Write your data into the stream.
<li>Call Writer#writeHeaderAndData(FSDataOutputStream) as many times as you need to.
store the serialized block into an external stream.
<li>Repeat to write more blocks.
</ol>
<p></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>private static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.State.html" title="enum in org.apache.hadoop.hbase.io.hfile">HFileBlock.Writer.State</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 <a href="../../../../../../org/apache/hadoop/hbase/io/ByteBuffAllocator.html" title="class in org.apache.hadoop.hbase.io">ByteBuffAllocator</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#allocator">allocator</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private <a href="../../../../../../org/apache/hadoop/hbase/io/ByteArrayOutputStream.html" title="class in org.apache.hadoop.hbase.io">ByteArrayOutputStream</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#baosInMemory">baosInMemory</a></span></code>
<div class="block">The stream we use to accumulate data into a block in an uncompressed format.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/BlockType.html" title="enum in org.apache.hadoop.hbase.io.hfile">BlockType</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#blockType">blockType</a></span></code>
<div class="block">Current block type.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileDataBlockEncoder.html" title="interface in org.apache.hadoop.hbase.io.hfile">HFileDataBlockEncoder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#dataBlockEncoder">dataBlockEncoder</a></span></code>
<div class="block">Data block encoder used for data blocks</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private <a href="../../../../../../org/apache/hadoop/hbase/io/encoding/HFileBlockEncodingContext.html" title="interface in org.apache.hadoop.hbase.io.encoding">HFileBlockEncodingContext</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#dataBlockEncodingCtx">dataBlockEncodingCtx</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private <a href="../../../../../../org/apache/hadoop/hbase/io/encoding/HFileBlockDefaultEncodingContext.html" title="class in org.apache.hadoop.hbase.io.encoding">HFileBlockDefaultEncodingContext</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#defaultBlockEncodingCtx">defaultBlockEncodingCtx</a></span></code>
<div class="block">block encoding context for non-data blocks</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileContext.html" title="class in org.apache.hadoop.hbase.io.hfile">HFileContext</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#fileContext">fileContext</a></span></code>
<div class="block">Meta data that holds information about the hfileblock</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private <a href="../../../../../../org/apache/hadoop/hbase/io/ByteArrayOutputStream.html" title="class in org.apache.hadoop.hbase.io">ByteArrayOutputStream</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#onDiskBlockBytesWithHeader">onDiskBlockBytesWithHeader</a></span></code>
<div class="block">Bytes to be written to the file system, including the header.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#onDiskChecksum">onDiskChecksum</a></span></code>
<div class="block">The size of the checksum data on disk.</div>
</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/HFileBlock.Writer.html#prevOffset">prevOffset</a></span></code>
<div class="block">The offset of the previous block of the same type</div>
</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/HFileBlock.Writer.html#prevOffsetByType">prevOffsetByType</a></span></code>
<div class="block">Offset of previous block by block type.</div>
</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/HFileBlock.Writer.html#startOffset">startOffset</a></span></code>
<div class="block">Current block's start offset in the <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFile.html" title="class in org.apache.hadoop.hbase.io.hfile"><code>HFile</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.State.html" title="enum in org.apache.hadoop.hbase.io.hfile">HFileBlock.Writer.State</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#state">state</a></span></code>
<div class="block">Writer state.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private <a href="https://docs.oracle.com/javase/8/docs/api/java/io/DataOutputStream.html?is-external=true" title="class or interface in java.io">DataOutputStream</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#userDataStream">userDataStream</a></span></code>
<div class="block">A stream that we write uncompressed bytes to, which compresses them and
writes them to <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#baosInMemory"><code>baosInMemory</code></a>.</div>
</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/HFileBlock.Writer.html#Writer-org.apache.hadoop.hbase.io.hfile.HFileDataBlockEncoder-org.apache.hadoop.hbase.io.hfile.HFileContext-">Writer</a></span>(<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileDataBlockEncoder.html" title="interface in org.apache.hadoop.hbase.io.hfile">HFileDataBlockEncoder</a>&nbsp;dataBlockEncoder,
<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileContext.html" title="class in org.apache.hadoop.hbase.io.hfile">HFileContext</a>&nbsp;fileContext)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#Writer-org.apache.hadoop.hbase.io.hfile.HFileDataBlockEncoder-org.apache.hadoop.hbase.io.hfile.HFileContext-org.apache.hadoop.hbase.io.ByteBuffAllocator-">Writer</a></span>(<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileDataBlockEncoder.html" title="interface in org.apache.hadoop.hbase.io.hfile">HFileDataBlockEncoder</a>&nbsp;dataBlockEncoder,
<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileContext.html" title="class in org.apache.hadoop.hbase.io.hfile">HFileContext</a>&nbsp;fileContext,
<a href="../../../../../../org/apache/hadoop/hbase/io/ByteBuffAllocator.html" title="class in org.apache.hadoop.hbase.io">ByteBuffAllocator</a>&nbsp;allocator)</code>&nbsp;</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>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#beforeShipped--">beforeShipped</a></span>()</code>
<div class="block">The action that needs to be performed before <a href="../../../../../../org/apache/hadoop/hbase/regionserver/Shipper.html#shipped--"><code>Shipper.shipped()</code></a> is performed</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>(package private) int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#blockSizeWritten--">blockSizeWritten</a></span>()</code>
<div class="block">Returns the number of bytes written into the current block so far, or
zero if not writing the block at the moment.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>private <a href="../../../../../../org/apache/hadoop/hbase/nio/ByteBuff.html" title="class in org.apache.hadoop.hbase.nio">ByteBuff</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#cloneOnDiskBufferWithHeader--">cloneOnDiskBufferWithHeader</a></span>()</code>
<div class="block">Clones the header followed by the on-disk (compressed/encoded/encrypted) data.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>(package private) <a href="../../../../../../org/apache/hadoop/hbase/nio/ByteBuff.html" title="class in org.apache.hadoop.hbase.nio">ByteBuff</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#cloneUncompressedBufferWithHeader--">cloneUncompressedBufferWithHeader</a></span>()</code>
<div class="block">Clones the header followed by the uncompressed data, even if using
compression.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#encodedBlockSizeWritten--">encodedBlockSizeWritten</a></span>()</code>
<div class="block">Returns the number of bytes written into the current block so far, or
zero if not writing the block at the moment.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>(package private) void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#ensureBlockReady--">ensureBlockReady</a></span>()</code>
<div class="block">Transitions the block writer from the "writing" state to the "block
ready" state.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>private void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#expectState-org.apache.hadoop.hbase.io.hfile.HFileBlock.Writer.State-">expectState</a></span>(<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.State.html" title="enum in org.apache.hadoop.hbase.io.hfile">HFileBlock.Writer.State</a>&nbsp;expectedState)</code>&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>private void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#finishBlock--">finishBlock</a></span>()</code>
<div class="block">Finish up writing of the block.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#finishBlockAndWriteHeaderAndData-java.io.DataOutputStream-">finishBlockAndWriteHeaderAndData</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/DataOutputStream.html?is-external=true" title="class or interface in java.io">DataOutputStream</a>&nbsp;out)</code>
<div class="block">Writes the header and the compressed data of this block (or uncompressed
data when not using compression) into the given stream.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>(package private) <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.html" title="class in org.apache.hadoop.hbase.io.hfile">HFileBlock</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#getBlockForCaching-org.apache.hadoop.hbase.io.hfile.CacheConfig-">getBlockForCaching</a></span>(<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/CacheConfig.html" title="class in org.apache.hadoop.hbase.io.hfile">CacheConfig</a>&nbsp;cacheConf)</code>
<div class="block">Creates a new HFileBlock.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>(package private) <a href="../../../../../../org/apache/hadoop/hbase/io/encoding/EncodingState.html" title="class in org.apache.hadoop.hbase.io.encoding">EncodingState</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#getEncodingState--">getEncodingState</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>(package private) byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#getHeaderAndDataForTest--">getHeaderAndDataForTest</a></span>()</code>
<div class="block">Returns the header or the compressed data (or uncompressed data when not
using compression) as a byte array.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>(package private) int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#getOnDiskSizeWithHeader--">getOnDiskSizeWithHeader</a></span>()</code>
<div class="block">Returns the on-disk size of the block.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>(package private) int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#getOnDiskSizeWithoutHeader--">getOnDiskSizeWithoutHeader</a></span>()</code>
<div class="block">Returns the on-disk size of the data portion of the block.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>(package private) int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#getUncompressedSizeWithHeader--">getUncompressedSizeWithHeader</a></span>()</code>
<div class="block">The uncompressed size of the block data, including header size.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>(package private) int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#getUncompressedSizeWithoutHeader--">getUncompressedSizeWithoutHeader</a></span>()</code>
<div class="block">The uncompressed size of the block data.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>(package private) boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#isWriting--">isWriting</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>private void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#putHeader-byte:A-int-int-int-int-">putHeader</a></span>(byte[]&nbsp;dest,
int&nbsp;offset,
int&nbsp;onDiskSize,
int&nbsp;uncompressedSize,
int&nbsp;onDiskDataSize)</code>
<div class="block">Put the header into the given byte array at the given offset.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>private void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#putHeader-org.apache.hadoop.hbase.io.ByteArrayOutputStream-int-int-int-">putHeader</a></span>(<a href="../../../../../../org/apache/hadoop/hbase/io/ByteArrayOutputStream.html" title="class in org.apache.hadoop.hbase.io">ByteArrayOutputStream</a>&nbsp;dest,
int&nbsp;onDiskSize,
int&nbsp;uncompressedSize,
int&nbsp;onDiskDataSize)</code>&nbsp;</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>private void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#putHeader-org.apache.hadoop.hbase.nio.ByteBuff-int-int-int-">putHeader</a></span>(<a href="../../../../../../org/apache/hadoop/hbase/nio/ByteBuff.html" title="class in org.apache.hadoop.hbase.nio">ByteBuff</a>&nbsp;buff,
int&nbsp;onDiskSize,
int&nbsp;uncompressedSize,
int&nbsp;onDiskDataSize)</code>&nbsp;</td>
</tr>
<tr id="i20" 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/HFileBlock.Writer.html#release--">release</a></span>()</code>
<div class="block">Releases resources used by this writer.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>(package private) <a href="https://docs.oracle.com/javase/8/docs/api/java/io/DataOutputStream.html?is-external=true" title="class or interface in java.io">DataOutputStream</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#startWriting-org.apache.hadoop.hbase.io.hfile.BlockType-">startWriting</a></span>(<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/BlockType.html" title="enum in org.apache.hadoop.hbase.io.hfile">BlockType</a>&nbsp;newBlockType)</code>
<div class="block">Starts writing into the block.</div>
</td>
</tr>
<tr id="i22" 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/HFileBlock.Writer.html#write-org.apache.hadoop.hbase.Cell-">write</a></span>(<a href="../../../../../../org/apache/hadoop/hbase/Cell.html" title="interface in org.apache.hadoop.hbase">Cell</a>&nbsp;cell)</code>
<div class="block">Writes the Cell to this block</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>(package private) void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#writeBlock-org.apache.hadoop.hbase.io.hfile.HFileBlock.BlockWritable-org.apache.hadoop.fs.FSDataOutputStream-">writeBlock</a></span>(<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.BlockWritable.html" title="interface in org.apache.hadoop.hbase.io.hfile">HFileBlock.BlockWritable</a>&nbsp;bw,
org.apache.hadoop.fs.FSDataOutputStream&nbsp;out)</code>
<div class="block">Takes the given <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.BlockWritable.html" title="interface in org.apache.hadoop.hbase.io.hfile"><code>HFileBlock.BlockWritable</code></a> instance, creates a new block of
its appropriate type, writes the writable into this block, and flushes
the block into the output stream.</div>
</td>
</tr>
<tr id="i24" 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/HFileBlock.Writer.html#writeHeaderAndData-org.apache.hadoop.fs.FSDataOutputStream-">writeHeaderAndData</a></span>(org.apache.hadoop.fs.FSDataOutputStream&nbsp;out)</code>
<div class="block">Similar to <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#writeHeaderAndData-org.apache.hadoop.fs.FSDataOutputStream-"><code>writeHeaderAndData(FSDataOutputStream)</code></a>, but records
the offset of this block so that it can be referenced in the next block
of the same type.</div>
</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#toString--" title="class or interface in java.lang">toString</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="state">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>state</h4>
<pre>private&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.State.html" title="enum in org.apache.hadoop.hbase.io.hfile">HFileBlock.Writer.State</a> <a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.760">state</a></pre>
<div class="block">Writer state. Used to ensure the correct usage protocol.</div>
</li>
</ul>
<a name="dataBlockEncoder">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>dataBlockEncoder</h4>
<pre>private final&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileDataBlockEncoder.html" title="interface in org.apache.hadoop.hbase.io.hfile">HFileDataBlockEncoder</a> <a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.763">dataBlockEncoder</a></pre>
<div class="block">Data block encoder used for data blocks</div>
</li>
</ul>
<a name="dataBlockEncodingCtx">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>dataBlockEncodingCtx</h4>
<pre>private&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/io/encoding/HFileBlockEncodingContext.html" title="interface in org.apache.hadoop.hbase.io.encoding">HFileBlockEncodingContext</a> <a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.765">dataBlockEncodingCtx</a></pre>
</li>
</ul>
<a name="defaultBlockEncodingCtx">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>defaultBlockEncodingCtx</h4>
<pre>private&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/io/encoding/HFileBlockDefaultEncodingContext.html" title="class in org.apache.hadoop.hbase.io.encoding">HFileBlockDefaultEncodingContext</a> <a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.768">defaultBlockEncodingCtx</a></pre>
<div class="block">block encoding context for non-data blocks</div>
</li>
</ul>
<a name="baosInMemory">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>baosInMemory</h4>
<pre>private&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/io/ByteArrayOutputStream.html" title="class in org.apache.hadoop.hbase.io">ByteArrayOutputStream</a> <a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.776">baosInMemory</a></pre>
<div class="block">The stream we use to accumulate data into a block in an uncompressed format.
We reset this stream at the end of each block and reuse it. The
header is written as the first <a href="../../../../../../org/apache/hadoop/hbase/HConstants.html#HFILEBLOCK_HEADER_SIZE"><code>HConstants.HFILEBLOCK_HEADER_SIZE</code></a> bytes into this
stream.</div>
</li>
</ul>
<a name="blockType">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>blockType</h4>
<pre>private&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/BlockType.html" title="enum in org.apache.hadoop.hbase.io.hfile">BlockType</a> <a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.783">blockType</a></pre>
<div class="block">Current block type. Set in <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#startWriting-org.apache.hadoop.hbase.io.hfile.BlockType-"><code>startWriting(BlockType)</code></a>. Could be
changed in <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#finishBlock--"><code>finishBlock()</code></a> from <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/BlockType.html#DATA"><code>BlockType.DATA</code></a>
to <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/BlockType.html#ENCODED_DATA"><code>BlockType.ENCODED_DATA</code></a>.</div>
</li>
</ul>
<a name="userDataStream">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>userDataStream</h4>
<pre>private&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/io/DataOutputStream.html?is-external=true" title="class or interface in java.io">DataOutputStream</a> <a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.789">userDataStream</a></pre>
<div class="block">A stream that we write uncompressed bytes to, which compresses them and
writes them to <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#baosInMemory"><code>baosInMemory</code></a>.</div>
</li>
</ul>
<a name="onDiskBlockBytesWithHeader">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onDiskBlockBytesWithHeader</h4>
<pre>private&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/io/ByteArrayOutputStream.html" title="class in org.apache.hadoop.hbase.io">ByteArrayOutputStream</a> <a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.796">onDiskBlockBytesWithHeader</a></pre>
<div class="block">Bytes to be written to the file system, including the header. Compressed
if compression is turned on. It also includes the checksum data that
immediately follows the block data. (header + data + checksums)</div>
</li>
</ul>
<a name="onDiskChecksum">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onDiskChecksum</h4>
<pre>private&nbsp;byte[] <a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.804">onDiskChecksum</a></pre>
<div class="block">The size of the checksum data on disk. It is used only if data is
not compressed. If data is compressed, then the checksums are already
part of onDiskBytesWithHeader. If data is uncompressed, then this
variable stores the checksum data for this block.</div>
</li>
</ul>
<a name="startOffset">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>startOffset</h4>
<pre>private&nbsp;long <a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.810">startOffset</a></pre>
<div class="block">Current block's start offset in the <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFile.html" title="class in org.apache.hadoop.hbase.io.hfile"><code>HFile</code></a>. Set in
<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#writeHeaderAndData-org.apache.hadoop.fs.FSDataOutputStream-"><code>writeHeaderAndData(FSDataOutputStream)</code></a>.</div>
</li>
</ul>
<a name="prevOffsetByType">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>prevOffsetByType</h4>
<pre>private&nbsp;long[] <a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.816">prevOffsetByType</a></pre>
<div class="block">Offset of previous block by block type. Updated when the next block is
started.</div>
</li>
</ul>
<a name="prevOffset">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>prevOffset</h4>
<pre>private&nbsp;long <a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.819">prevOffset</a></pre>
<div class="block">The offset of the previous block of the same type</div>
</li>
</ul>
<a name="fileContext">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fileContext</h4>
<pre>private&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileContext.html" title="class in org.apache.hadoop.hbase.io.hfile">HFileContext</a> <a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.821">fileContext</a></pre>
<div class="block">Meta data that holds information about the hfileblock</div>
</li>
</ul>
<a name="allocator">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>allocator</h4>
<pre>private final&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/io/ByteBuffAllocator.html" title="class in org.apache.hadoop.hbase.io">ByteBuffAllocator</a> <a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.823">allocator</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="Writer-org.apache.hadoop.hbase.io.hfile.HFileDataBlockEncoder-org.apache.hadoop.hbase.io.hfile.HFileContext-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Writer</h4>
<pre>public&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.839">Writer</a>(<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileDataBlockEncoder.html" title="interface in org.apache.hadoop.hbase.io.hfile">HFileDataBlockEncoder</a>&nbsp;dataBlockEncoder,
<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileContext.html" title="class in org.apache.hadoop.hbase.io.hfile">HFileContext</a>&nbsp;fileContext)</pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dataBlockEncoder</code> - data block encoding algorithm to use</dd>
</dl>
</li>
</ul>
<a name="Writer-org.apache.hadoop.hbase.io.hfile.HFileDataBlockEncoder-org.apache.hadoop.hbase.io.hfile.HFileContext-org.apache.hadoop.hbase.io.ByteBuffAllocator-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Writer</h4>
<pre>public&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.843">Writer</a>(<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileDataBlockEncoder.html" title="interface in org.apache.hadoop.hbase.io.hfile">HFileDataBlockEncoder</a>&nbsp;dataBlockEncoder,
<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileContext.html" title="class in org.apache.hadoop.hbase.io.hfile">HFileContext</a>&nbsp;fileContext,
<a href="../../../../../../org/apache/hadoop/hbase/io/ByteBuffAllocator.html" title="class in org.apache.hadoop.hbase.io">ByteBuffAllocator</a>&nbsp;allocator)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="beforeShipped--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>beforeShipped</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.826">beforeShipped</a>()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../org/apache/hadoop/hbase/regionserver/ShipperListener.html#beforeShipped--">ShipperListener</a></code></span></div>
<div class="block">The action that needs to be performed before <a href="../../../../../../org/apache/hadoop/hbase/regionserver/Shipper.html#shipped--"><code>Shipper.shipped()</code></a> is performed</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../org/apache/hadoop/hbase/regionserver/ShipperListener.html#beforeShipped--">beforeShipped</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../org/apache/hadoop/hbase/regionserver/ShipperListener.html" title="interface in org.apache.hadoop.hbase.regionserver">ShipperListener</a></code></dd>
</dl>
</li>
</ul>
<a name="getEncodingState--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEncodingState</h4>
<pre><a href="../../../../../../org/apache/hadoop/hbase/io/encoding/EncodingState.html" title="class in org.apache.hadoop.hbase.io.encoding">EncodingState</a>&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.832">getEncodingState</a>()</pre>
</li>
</ul>
<a name="startWriting-org.apache.hadoop.hbase.io.hfile.BlockType-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>startWriting</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/io/DataOutputStream.html?is-external=true" title="class or interface in java.io">DataOutputStream</a>&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.874">startWriting</a>(<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/BlockType.html" title="enum in org.apache.hadoop.hbase.io.hfile">BlockType</a>&nbsp;newBlockType)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Starts writing into the block. The previous block's data is discarded.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the stream the user can write their data into</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="write-org.apache.hadoop.hbase.Cell-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.901">write</a>(<a href="../../../../../../org/apache/hadoop/hbase/Cell.html" title="interface in org.apache.hadoop.hbase">Cell</a>&nbsp;cell)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Writes the Cell to this block</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="ensureBlockReady--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ensureBlockReady</h4>
<pre>void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.910">ensureBlockReady</a>()
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Transitions the block writer from the "writing" state to the "block
ready" state. Does nothing if a block is already finished.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="finishBlock--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>finishBlock</h4>
<pre>private&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.928">finishBlock</a>()
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Finish up writing of the block.
Flushes the compressing stream (if using compression), fills out the header,
does any compression/encryption of bytes to flush out to disk, and manages
the cache on write content, if applicable. Sets block write state to "block ready".</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="putHeader-byte:A-int-int-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>putHeader</h4>
<pre>private&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.982">putHeader</a>(byte[]&nbsp;dest,
int&nbsp;offset,
int&nbsp;onDiskSize,
int&nbsp;uncompressedSize,
int&nbsp;onDiskDataSize)</pre>
<div class="block">Put the header into the given byte array at the given offset.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>onDiskSize</code> - size of the block on disk header + data + checksum</dd>
<dd><code>uncompressedSize</code> - size of the block after decompression (but
before optional data block decoding) including header</dd>
<dd><code>onDiskDataSize</code> - size of the block on disk with header
and data but not including the checksums</dd>
</dl>
</li>
</ul>
<a name="putHeader-org.apache.hadoop.hbase.nio.ByteBuff-int-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>putHeader</h4>
<pre>private&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.993">putHeader</a>(<a href="../../../../../../org/apache/hadoop/hbase/nio/ByteBuff.html" title="class in org.apache.hadoop.hbase.nio">ByteBuff</a>&nbsp;buff,
int&nbsp;onDiskSize,
int&nbsp;uncompressedSize,
int&nbsp;onDiskDataSize)</pre>
</li>
</ul>
<a name="putHeader-org.apache.hadoop.hbase.io.ByteArrayOutputStream-int-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>putHeader</h4>
<pre>private&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1005">putHeader</a>(<a href="../../../../../../org/apache/hadoop/hbase/io/ByteArrayOutputStream.html" title="class in org.apache.hadoop.hbase.io">ByteArrayOutputStream</a>&nbsp;dest,
int&nbsp;onDiskSize,
int&nbsp;uncompressedSize,
int&nbsp;onDiskDataSize)</pre>
</li>
</ul>
<a name="writeHeaderAndData-org.apache.hadoop.fs.FSDataOutputStream-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeHeaderAndData</h4>
<pre>void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1015">writeHeaderAndData</a>(org.apache.hadoop.fs.FSDataOutputStream&nbsp;out)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Similar to <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#writeHeaderAndData-org.apache.hadoop.fs.FSDataOutputStream-"><code>writeHeaderAndData(FSDataOutputStream)</code></a>, but records
the offset of this block so that it can be referenced in the next block
of the same type.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="finishBlockAndWriteHeaderAndData-java.io.DataOutputStream-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>finishBlockAndWriteHeaderAndData</h4>
<pre>protected&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1033">finishBlockAndWriteHeaderAndData</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/DataOutputStream.html?is-external=true" title="class or interface in java.io">DataOutputStream</a>&nbsp;out)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Writes the header and the compressed data of this block (or uncompressed
data when not using compression) into the given stream. Can be called in
the "writing" state or in the "block ready" state. If called in the
"writing" state, transitions the writer to the "block ready" state.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>out</code> - the output stream to write the</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="getHeaderAndDataForTest--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getHeaderAndDataForTest</h4>
<pre>byte[]&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1051">getHeaderAndDataForTest</a>()
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Returns the header or the compressed data (or uncompressed data when not
using compression) as a byte array. Can be called in the "writing" state
or in the "block ready" state. If called in the "writing" state,
transitions the writer to the "block ready" state. This returns
the header + data + checksums stored on disk.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>header and data as they would be stored on disk in a byte array</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="release--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>release</h4>
<pre>void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1068">release</a>()</pre>
<div class="block">Releases resources used by this writer.</div>
</li>
</ul>
<a name="getOnDiskSizeWithoutHeader--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOnDiskSizeWithoutHeader</h4>
<pre>int&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1087">getOnDiskSizeWithoutHeader</a>()</pre>
<div class="block">Returns the on-disk size of the data portion of the block. This is the
compressed size if compression is enabled. Can only be called in the
"block ready" state. Header is not compressed, and its size is not
included in the return value.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the on-disk size of the block, not including the header.</dd>
</dl>
</li>
</ul>
<a name="getOnDiskSizeWithHeader--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOnDiskSizeWithHeader</h4>
<pre>int&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1100">getOnDiskSizeWithHeader</a>()</pre>
<div class="block">Returns the on-disk size of the block. Can only be called in the
"block ready" state.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the on-disk size of the block ready to be written, including the
header size, the data and the checksum data.</dd>
</dl>
</li>
</ul>
<a name="getUncompressedSizeWithoutHeader--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUncompressedSizeWithoutHeader</h4>
<pre>int&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1108">getUncompressedSizeWithoutHeader</a>()</pre>
<div class="block">The uncompressed size of the block data. Does not include header size.</div>
</li>
</ul>
<a name="getUncompressedSizeWithHeader--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUncompressedSizeWithHeader</h4>
<pre>int&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1116">getUncompressedSizeWithHeader</a>()</pre>
<div class="block">The uncompressed size of the block data, including header size.</div>
</li>
</ul>
<a name="isWriting--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isWriting</h4>
<pre>boolean&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1122">isWriting</a>()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if a block is being written</dd>
</dl>
</li>
</ul>
<a name="encodedBlockSizeWritten--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodedBlockSizeWritten</h4>
<pre>public&nbsp;int&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1133">encodedBlockSizeWritten</a>()</pre>
<div class="block">Returns the number of bytes written into the current block so far, or
zero if not writing the block at the moment. Note that this will return
zero in the "block ready" state as well.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number of bytes written</dd>
</dl>
</li>
</ul>
<a name="blockSizeWritten--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>blockSizeWritten</h4>
<pre>int&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1144">blockSizeWritten</a>()</pre>
<div class="block">Returns the number of bytes written into the current block so far, or
zero if not writing the block at the moment. Note that this will return
zero in the "block ready" state as well.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number of bytes written</dd>
</dl>
</li>
</ul>
<a name="cloneUncompressedBufferWithHeader--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>cloneUncompressedBufferWithHeader</h4>
<pre><a href="../../../../../../org/apache/hadoop/hbase/nio/ByteBuff.html" title="class in org.apache.hadoop.hbase.nio">ByteBuff</a>&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1156">cloneUncompressedBufferWithHeader</a>()</pre>
<div class="block">Clones the header followed by the uncompressed data, even if using
compression. This is needed for storing uncompressed blocks in the block
cache. Can be called in the "writing" state or the "block ready" state.
Returns only the header and data, does not include checksum data.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns an uncompressed block ByteBuff for caching on write</dd>
</dl>
</li>
</ul>
<a name="cloneOnDiskBufferWithHeader--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>cloneOnDiskBufferWithHeader</h4>
<pre>private&nbsp;<a href="../../../../../../org/apache/hadoop/hbase/nio/ByteBuff.html" title="class in org.apache.hadoop.hbase.nio">ByteBuff</a>&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1175">cloneOnDiskBufferWithHeader</a>()</pre>
<div class="block">Clones the header followed by the on-disk (compressed/encoded/encrypted) data. This is needed
for storing packed blocks in the block cache. Returns only the header and data, Does not
include checksum data.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns a copy of block bytes for caching on write</dd>
</dl>
</li>
</ul>
<a name="expectState-org.apache.hadoop.hbase.io.hfile.HFileBlock.Writer.State-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>expectState</h4>
<pre>private&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1183">expectState</a>(<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.State.html" title="enum in org.apache.hadoop.hbase.io.hfile">HFileBlock.Writer.State</a>&nbsp;expectedState)</pre>
</li>
</ul>
<a name="writeBlock-org.apache.hadoop.hbase.io.hfile.HFileBlock.BlockWritable-org.apache.hadoop.fs.FSDataOutputStream-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeBlock</h4>
<pre>void&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1199">writeBlock</a>(<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.BlockWritable.html" title="interface in org.apache.hadoop.hbase.io.hfile">HFileBlock.BlockWritable</a>&nbsp;bw,
org.apache.hadoop.fs.FSDataOutputStream&nbsp;out)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Takes the given <a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.BlockWritable.html" title="interface in org.apache.hadoop.hbase.io.hfile"><code>HFileBlock.BlockWritable</code></a> instance, creates a new block of
its appropriate type, writes the writable into this block, and flushes
the block into the output stream. The writer is instructed not to buffer
uncompressed bytes for cache-on-write.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>bw</code> - the block-writable object to write as a block</dd>
<dd><code>out</code> - the file system output stream</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="getBlockForCaching-org.apache.hadoop.hbase.io.hfile.CacheConfig-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getBlockForCaching</h4>
<pre><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.html" title="class in org.apache.hadoop.hbase.io.hfile">HFileBlock</a>&nbsp;<a href="../../../../../../src-html/org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html#line.1218">getBlockForCaching</a>(<a href="../../../../../../org/apache/hadoop/hbase/io/hfile/CacheConfig.html" title="class in org.apache.hadoop.hbase.io.hfile">CacheConfig</a>&nbsp;cacheConf)</pre>
<div class="block">Creates a new HFileBlock. Checksums have already been validated, so
the byte buffer passed into the constructor of this newly created
block does not have checksum data even though the header minor
version is MINOR_VERSION_WITH_CHECKSUM. This is indicated by setting a
0 value in bytesPerChecksum. This method copies the on-disk or
uncompressed data to build the HFileBlock which is used only
while writing blocks and caching.
<p>TODO: Should there be an option where a cache can ask that hbase preserve block
checksums for checking after a block comes out of the cache? Otehrwise, cache is responsible
for blocks being wholesome (ECC memory or if file-backed, it does checksumming).</div>
</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/HFileBlock.Writer.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><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.PrefetchedHeader.html" title="class in org.apache.hadoop.hbase.io.hfile"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.State.html" title="enum in org.apache.hadoop.hbase.io.hfile"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/hadoop/hbase/io/hfile/HFileBlock.Writer.html" target="_top">Frames</a></li>
<li><a href="HFileBlock.Writer.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>