blob: 8daec940ebffaac7deb9d0256728a95c8a02c332 [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>BufferAllocator (Apache Arrow Java Root POM 17.0.0-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="BufferAllocator (Apache Arrow Java Root POM 17.0.0-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":6,"i13":6,"i14":6,"i15":6,"i16":18,"i17":6,"i18":6,"i19":6,"i20":6,"i21":6,"i22":6,"i23":6,"i24":18};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default 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/BufferAllocator.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/arrow/memory/BoundsChecking.html" title="class in org.apache.arrow.memory"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/arrow/memory/BufferLedger.html" title="class in org.apache.arrow.memory"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/arrow/memory/BufferAllocator.html" target="_top">Frames</a></li>
<li><a href="BufferAllocator.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>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&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.arrow.memory</div>
<h2 title="Interface BufferAllocator" class="title">Interface BufferAllocator</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></dd>
</dl>
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../org/apache/arrow/memory/RootAllocator.html" title="class in org.apache.arrow.memory">RootAllocator</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">BufferAllocator</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></pre>
<div class="block">Wrapper class to deal with byte buffer allocation. Ensures users only use designated methods.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== 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="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default 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/arrow/memory/BufferAllocator.html#assertOpen--">assertOpen</a></span>()</code>
<div class="block">Asserts (using java assertions) that the provided allocator is currently open.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/arrow/memory/ArrowBuf.html" title="class in org.apache.arrow.memory">ArrowBuf</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#buffer-long-">buffer</a></span>(long&nbsp;size)</code>
<div class="block">Allocate a new or reused buffer of the provided size.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/arrow/memory/ArrowBuf.html" title="class in org.apache.arrow.memory">ArrowBuf</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#buffer-long-org.apache.arrow.memory.BufferManager-">buffer</a></span>(long&nbsp;size,
<a href="../../../../org/apache/arrow/memory/BufferManager.html" title="interface in org.apache.arrow.memory">BufferManager</a>&nbsp;manager)</code>
<div class="block">Allocate a new or reused buffer of the provided size.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#close--">close</a></span>()</code>
<div class="block">Close and release all buffers generated from this buffer pool.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#forceAllocate-long-">forceAllocate</a></span>(long&nbsp;size)</code>
<div class="block">Forcibly allocate bytes.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#getAllocatedMemory--">getAllocatedMemory</a></span>()</code>
<div class="block">Returns the amount of memory currently allocated from this allocator.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/arrow/memory/BufferAllocator.html" title="interface in org.apache.arrow.memory">BufferAllocator</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#getChildAllocators--">getChildAllocators</a></span>()</code>
<div class="block">Returns the set of child allocators.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/arrow/memory/ArrowBuf.html" title="class in org.apache.arrow.memory">ArrowBuf</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#getEmpty--">getEmpty</a></span>()</code>
<div class="block">Get a reference to the empty buffer associated with this allocator.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#getHeadroom--">getHeadroom</a></span>()</code>
<div class="block">Returns the amount of memory that can probably be allocated at this moment
without exceeding this or any parents allocation maximum.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#getInitReservation--">getInitReservation</a></span>()</code>
<div class="block">Return the initial reservation.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#getLimit--">getLimit</a></span>()</code>
<div class="block">Return the current maximum limit this allocator imposes.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/arrow/memory/AllocationListener.html" title="interface in org.apache.arrow.memory">AllocationListener</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#getListener--">getListener</a></span>()</code>
<div class="block">Returns the allocation listener used by this allocator.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#getName--">getName</a></span>()</code>
<div class="block">Return the name of this allocator.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>@Nullable <a href="../../../../org/apache/arrow/memory/BufferAllocator.html" title="interface in org.apache.arrow.memory">BufferAllocator</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#getParentAllocator--">getParentAllocator</a></span>()</code>
<div class="block">Returns the parent allocator.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#getPeakMemoryAllocation--">getPeakMemoryAllocation</a></span>()</code>
<div class="block">Returns the peak amount of memory allocated from this allocator.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/arrow/memory/BufferAllocator.html" title="interface in org.apache.arrow.memory">BufferAllocator</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#getRoot--">getRoot</a></span>()</code>
<div class="block">Get the root allocator of this allocator.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>default <a href="../../../../org/apache/arrow/memory/rounding/RoundingPolicy.html" title="interface in org.apache.arrow.memory.rounding">RoundingPolicy</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#getRoundingPolicy--">getRoundingPolicy</a></span>()</code>
<div class="block">Gets the rounding policy of the allocator.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#isOverLimit--">isOverLimit</a></span>()</code>
<div class="block">Return whether or not this allocator (or one if its parents) is over its limits.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/arrow/memory/BufferAllocator.html" title="interface in org.apache.arrow.memory">BufferAllocator</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#newChildAllocator-java.lang.String-org.apache.arrow.memory.AllocationListener-long-long-">newChildAllocator</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="../../../../org/apache/arrow/memory/AllocationListener.html" title="interface in org.apache.arrow.memory">AllocationListener</a>&nbsp;listener,
long&nbsp;initReservation,
long&nbsp;maxAllocation)</code>
<div class="block">Create a new child allocator.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/arrow/memory/BufferAllocator.html" title="interface in org.apache.arrow.memory">BufferAllocator</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#newChildAllocator-java.lang.String-long-long-">newChildAllocator</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
long&nbsp;initReservation,
long&nbsp;maxAllocation)</code>
<div class="block">Create a new child allocator.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/arrow/memory/AllocationReservation.html" title="interface in org.apache.arrow.memory">AllocationReservation</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#newReservation--">newReservation</a></span>()</code>
<div class="block">Create an allocation reservation.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#releaseBytes-long-">releaseBytes</a></span>(long&nbsp;size)</code>
<div class="block">Release bytes from this allocator.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#setLimit-long-">setLimit</a></span>(long&nbsp;newLimit)</code>
<div class="block">Set the maximum amount of memory this allocator is allowed to allocate.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#toVerboseString--">toVerboseString</a></span>()</code>
<div class="block">Return a verbose string describing this allocator.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>default <a href="../../../../org/apache/arrow/memory/ArrowBuf.html" title="class in org.apache.arrow.memory">ArrowBuf</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/arrow/memory/BufferAllocator.html#wrapForeignAllocation-org.apache.arrow.memory.ForeignAllocation-">wrapForeignAllocation</a></span>(<a href="../../../../org/apache/arrow/memory/ForeignAllocation.html" title="class in org.apache.arrow.memory">ForeignAllocation</a>&nbsp;allocation)</code>
<div class="block">EXPERIMENTAL: Wrap an allocation created outside this BufferAllocator.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="buffer-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>buffer</h4>
<pre><a href="../../../../org/apache/arrow/memory/ArrowBuf.html" title="class in org.apache.arrow.memory">ArrowBuf</a>&nbsp;buffer(long&nbsp;size)</pre>
<div class="block">Allocate a new or reused buffer of the provided size. Note that the buffer may technically
be larger than the
requested size for rounding purposes. However, the buffer's capacity will be set to the
configured size.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>size</code> - The size in bytes.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new ArrowBuf, or null if the request can't be satisfied</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/arrow/memory/OutOfMemoryException.html" title="class in org.apache.arrow.memory">OutOfMemoryException</a></code> - if buffer cannot be allocated</dd>
</dl>
</li>
</ul>
<a name="buffer-long-org.apache.arrow.memory.BufferManager-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>buffer</h4>
<pre><a href="../../../../org/apache/arrow/memory/ArrowBuf.html" title="class in org.apache.arrow.memory">ArrowBuf</a>&nbsp;buffer(long&nbsp;size,
<a href="../../../../org/apache/arrow/memory/BufferManager.html" title="interface in org.apache.arrow.memory">BufferManager</a>&nbsp;manager)</pre>
<div class="block">Allocate a new or reused buffer of the provided size. Note that the buffer may technically
be larger than the
requested size for rounding purposes. However, the buffer's capacity will be set to the
configured size.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>size</code> - The size in bytes.</dd>
<dd><code>manager</code> - A buffer manager to manage reallocation.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new ArrowBuf, or null if the request can't be satisfied</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/arrow/memory/OutOfMemoryException.html" title="class in org.apache.arrow.memory">OutOfMemoryException</a></code> - if buffer cannot be allocated</dd>
</dl>
</li>
</ul>
<a name="getRoot--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRoot</h4>
<pre><a href="../../../../org/apache/arrow/memory/BufferAllocator.html" title="interface in org.apache.arrow.memory">BufferAllocator</a>&nbsp;getRoot()</pre>
<div class="block">Get the root allocator of this allocator. If this allocator is already a root, return
this directly.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The root allocator</dd>
</dl>
</li>
</ul>
<a name="newChildAllocator-java.lang.String-long-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newChildAllocator</h4>
<pre><a href="../../../../org/apache/arrow/memory/BufferAllocator.html" title="interface in org.apache.arrow.memory">BufferAllocator</a>&nbsp;newChildAllocator(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
long&nbsp;initReservation,
long&nbsp;maxAllocation)</pre>
<div class="block">Create a new child allocator.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name of the allocator.</dd>
<dd><code>initReservation</code> - the initial space reservation (obtained from this allocator)</dd>
<dd><code>maxAllocation</code> - maximum amount of space the new allocator can allocate</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the new allocator, or null if it can't be created</dd>
</dl>
</li>
</ul>
<a name="newChildAllocator-java.lang.String-org.apache.arrow.memory.AllocationListener-long-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newChildAllocator</h4>
<pre><a href="../../../../org/apache/arrow/memory/BufferAllocator.html" title="interface in org.apache.arrow.memory">BufferAllocator</a>&nbsp;newChildAllocator(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="../../../../org/apache/arrow/memory/AllocationListener.html" title="interface in org.apache.arrow.memory">AllocationListener</a>&nbsp;listener,
long&nbsp;initReservation,
long&nbsp;maxAllocation)</pre>
<div class="block">Create a new child allocator.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name of the allocator.</dd>
<dd><code>listener</code> - allocation listener for the newly created child</dd>
<dd><code>initReservation</code> - the initial space reservation (obtained from this allocator)</dd>
<dd><code>maxAllocation</code> - maximum amount of space the new allocator can allocate</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the new allocator, or null if it can't be created</dd>
</dl>
</li>
</ul>
<a name="close--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>close</h4>
<pre>void&nbsp;close()</pre>
<div class="block">Close and release all buffers generated from this buffer pool.
<p>When assertions are on, complains if there are any outstanding buffers; to avoid
that, release all buffers before the allocator is closed.</p></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true#close--" title="class or interface in java.lang">close</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></code></dd>
</dl>
</li>
</ul>
<a name="getAllocatedMemory--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAllocatedMemory</h4>
<pre>long&nbsp;getAllocatedMemory()</pre>
<div class="block">Returns the amount of memory currently allocated from this allocator.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the amount of memory currently allocated</dd>
</dl>
</li>
</ul>
<a name="getLimit--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLimit</h4>
<pre>long&nbsp;getLimit()</pre>
<div class="block">Return the current maximum limit this allocator imposes.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Limit in number of bytes.</dd>
</dl>
</li>
</ul>
<a name="getInitReservation--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInitReservation</h4>
<pre>long&nbsp;getInitReservation()</pre>
<div class="block">Return the initial reservation.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>reservation in bytes.</dd>
</dl>
</li>
</ul>
<a name="setLimit-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setLimit</h4>
<pre>void&nbsp;setLimit(long&nbsp;newLimit)</pre>
<div class="block">Set the maximum amount of memory this allocator is allowed to allocate.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>newLimit</code> - The new Limit to apply to allocations</dd>
</dl>
</li>
</ul>
<a name="getPeakMemoryAllocation--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPeakMemoryAllocation</h4>
<pre>long&nbsp;getPeakMemoryAllocation()</pre>
<div class="block">Returns the peak amount of memory allocated from this allocator.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the peak amount of memory allocated</dd>
</dl>
</li>
</ul>
<a name="getHeadroom--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getHeadroom</h4>
<pre>long&nbsp;getHeadroom()</pre>
<div class="block">Returns the amount of memory that can probably be allocated at this moment
without exceeding this or any parents allocation maximum.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Headroom in bytes</dd>
</dl>
</li>
</ul>
<a name="forceAllocate-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>forceAllocate</h4>
<pre>boolean&nbsp;forceAllocate(long&nbsp;size)</pre>
<div class="block">Forcibly allocate bytes. Returns whether the allocation fit within limits.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>size</code> - to increase</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Whether the allocation fit within limits.</dd>
</dl>
</li>
</ul>
<a name="releaseBytes-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>releaseBytes</h4>
<pre>void&nbsp;releaseBytes(long&nbsp;size)</pre>
<div class="block">Release bytes from this allocator.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>size</code> - to release</dd>
</dl>
</li>
</ul>
<a name="getListener--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getListener</h4>
<pre><a href="../../../../org/apache/arrow/memory/AllocationListener.html" title="interface in org.apache.arrow.memory">AllocationListener</a>&nbsp;getListener()</pre>
<div class="block">Returns the allocation listener used by this allocator.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <a href="../../../../org/apache/arrow/memory/AllocationListener.html" title="interface in org.apache.arrow.memory"><code>AllocationListener</code></a> instance. Or <a href="../../../../org/apache/arrow/memory/AllocationListener.html#NOOP"><code>AllocationListener.NOOP</code></a> by default if no listener
is configured when this allocator was created.</dd>
</dl>
</li>
</ul>
<a name="getParentAllocator--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getParentAllocator</h4>
<pre>@Nullable <a href="../../../../org/apache/arrow/memory/BufferAllocator.html" title="interface in org.apache.arrow.memory">BufferAllocator</a>&nbsp;getParentAllocator()</pre>
<div class="block">Returns the parent allocator.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>parent allocator</dd>
</dl>
</li>
</ul>
<a name="getChildAllocators--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getChildAllocators</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/arrow/memory/BufferAllocator.html" title="interface in org.apache.arrow.memory">BufferAllocator</a>&gt;&nbsp;getChildAllocators()</pre>
<div class="block">Returns the set of child allocators.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>set of child allocators</dd>
</dl>
</li>
</ul>
<a name="newReservation--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newReservation</h4>
<pre><a href="../../../../org/apache/arrow/memory/AllocationReservation.html" title="interface in org.apache.arrow.memory">AllocationReservation</a>&nbsp;newReservation()</pre>
<div class="block">Create an allocation reservation. A reservation is a way of building up
a request for a buffer whose size is not known in advance. See</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the newly created reservation</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/apache/arrow/memory/AllocationReservation.html" title="interface in org.apache.arrow.memory"><code>AllocationReservation</code></a></dd>
</dl>
</li>
</ul>
<a name="getEmpty--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEmpty</h4>
<pre><a href="../../../../org/apache/arrow/memory/ArrowBuf.html" title="class in org.apache.arrow.memory">ArrowBuf</a>&nbsp;getEmpty()</pre>
<div class="block">Get a reference to the empty buffer associated with this allocator. Empty buffers are
special because we don't
worry about them leaking or managing reference counts on them since they don't actually
point to any memory.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the empty buffer</dd>
</dl>
</li>
</ul>
<a name="getName--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getName</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getName()</pre>
<div class="block">Return the name of this allocator. This is a human readable name that can help debugging.
Typically provides
coordinates about where this allocator was created</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the name of the allocator</dd>
</dl>
</li>
</ul>
<a name="isOverLimit--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isOverLimit</h4>
<pre>boolean&nbsp;isOverLimit()</pre>
<div class="block">Return whether or not this allocator (or one if its parents) is over its limits. In the case
that an allocator is
over its limit, all consumers of that allocator should aggressively try to address the
overlimit situation.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>whether or not this allocator (or one if its parents) is over its limits</dd>
</dl>
</li>
</ul>
<a name="toVerboseString--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toVerboseString</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toVerboseString()</pre>
<div class="block">Return a verbose string describing this allocator. If in DEBUG mode, this will also include
relevant stacktraces
and historical logs for underlying objects</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A very verbose description of the allocator hierarchy.</dd>
</dl>
</li>
</ul>
<a name="assertOpen--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>assertOpen</h4>
<pre>void&nbsp;assertOpen()</pre>
<div class="block">Asserts (using java assertions) that the provided allocator is currently open. If assertions
are disabled, this is
a no-op.</div>
</li>
</ul>
<a name="getRoundingPolicy--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRoundingPolicy</h4>
<pre>default&nbsp;<a href="../../../../org/apache/arrow/memory/rounding/RoundingPolicy.html" title="interface in org.apache.arrow.memory.rounding">RoundingPolicy</a>&nbsp;getRoundingPolicy()</pre>
<div class="block">Gets the rounding policy of the allocator.</div>
</li>
</ul>
<a name="wrapForeignAllocation-org.apache.arrow.memory.ForeignAllocation-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>wrapForeignAllocation</h4>
<pre>default&nbsp;<a href="../../../../org/apache/arrow/memory/ArrowBuf.html" title="class in org.apache.arrow.memory">ArrowBuf</a>&nbsp;wrapForeignAllocation(<a href="../../../../org/apache/arrow/memory/ForeignAllocation.html" title="class in org.apache.arrow.memory">ForeignAllocation</a>&nbsp;allocation)</pre>
<div class="block">EXPERIMENTAL: Wrap an allocation created outside this BufferAllocator.
<p>This is useful to integrate allocations from native code into the same memory management framework as
Java-allocated buffers, presenting users a consistent API. The created buffer will be tracked by this allocator
and can be transferred like Java-allocated buffers.
<p>The underlying allocation will be closed when all references to the buffer are released. If this method throws,
the underlying allocation will also be closed.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>allocation</code> - The underlying allocation.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/BufferAllocator.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/arrow/memory/BoundsChecking.html" title="class in org.apache.arrow.memory"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/arrow/memory/BufferLedger.html" title="class in org.apache.arrow.memory"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/arrow/memory/BufferAllocator.html" target="_top">Frames</a></li>
<li><a href="BufferAllocator.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>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&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; 2023 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>