<!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 (1.8.0_102) on Wed Oct 19 15:34:01 PDT 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>DataCache (Hive Storage API 2.1.1-pre-orc API)</title>
<meta name="date" content="2016-10-19">
<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="DataCache (Hive Storage API 2.1.1-pre-orc API)";
        }
    }
    catch(err) {
    }
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract 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/DataCache.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/hive/common/io/Allocator.AllocatorOutOfMemoryException.html" title="class in org.apache.hadoop.hive.common.io"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/hadoop/hive/common/io/DataCache.BooleanRef.html" title="class in org.apache.hadoop.hive.common.io"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/hadoop/hive/common/io/DataCache.html" target="_top">Frames</a></li>
<li><a href="DataCache.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>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.hadoop.hive.common.io</div>
<h2 title="Interface DataCache" class="title">Interface DataCache</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public interface <span class="typeNameLabel">DataCache</span></pre>
<div class="block">An abstract data cache that IO formats can use to retrieve and cache data.</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">Interface and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hive/common/io/DataCache.BooleanRef.html" title="class in org.apache.hadoop.hive.common.io">DataCache.BooleanRef</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static interface&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hive/common/io/DataCache.DiskRangeListFactory.html" title="interface in org.apache.hadoop.hive.common.io">DataCache.DiskRangeListFactory</a></span></code>
<div class="block">Disk range factory used during cache retrieval.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract 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><a href="../../../../../../org/apache/hadoop/hive/common/io/Allocator.html" title="interface in org.apache.hadoop.hive.common.io">Allocator</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hive/common/io/DataCache.html#getAllocator--">getAllocator</a></span>()</code>
<div class="block">Gets the allocator associated with this DataCache.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/hadoop/hive/common/io/DiskRangeList.html" title="class in org.apache.hadoop.hive.common.io">DiskRangeList</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hive/common/io/DataCache.html#getFileData-java.lang.Object-org.apache.hadoop.hive.common.io.DiskRangeList-long-org.apache.hadoop.hive.common.io.DataCache.DiskRangeListFactory-org.apache.hadoop.hive.common.io.DataCache.BooleanRef-">getFileData</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;fileKey,
           <a href="../../../../../../org/apache/hadoop/hive/common/io/DiskRangeList.html" title="class in org.apache.hadoop.hive.common.io">DiskRangeList</a>&nbsp;range,
           long&nbsp;baseOffset,
           <a href="../../../../../../org/apache/hadoop/hive/common/io/DataCache.DiskRangeListFactory.html" title="interface in org.apache.hadoop.hive.common.io">DataCache.DiskRangeListFactory</a>&nbsp;factory,
           <a href="../../../../../../org/apache/hadoop/hive/common/io/DataCache.BooleanRef.html" title="class in org.apache.hadoop.hive.common.io">DataCache.BooleanRef</a>&nbsp;gotAllData)</code>
<div class="block">Gets file data for particular offsets.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>long[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hive/common/io/DataCache.html#putFileData-java.lang.Object-org.apache.hadoop.hive.common.io.DiskRange:A-org.apache.hadoop.hive.common.io.encoded.MemoryBuffer:A-long-">putFileData</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;fileKey,
           <a href="../../../../../../org/apache/hadoop/hive/common/io/DiskRange.html" title="class in org.apache.hadoop.hive.common.io">DiskRange</a>[]&nbsp;ranges,
           <a href="../../../../../../org/apache/hadoop/hive/common/io/encoded/MemoryBuffer.html" title="interface in org.apache.hadoop.hive.common.io.encoded">MemoryBuffer</a>[]&nbsp;data,
           long&nbsp;baseOffset)</code>
<div class="block">Puts file data into cache, or gets older data in case of collisions.</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/hadoop/hive/common/io/DataCache.html#releaseBuffer-org.apache.hadoop.hive.common.io.encoded.MemoryBuffer-">releaseBuffer</a></span>(<a href="../../../../../../org/apache/hadoop/hive/common/io/encoded/MemoryBuffer.html" title="interface in org.apache.hadoop.hive.common.io.encoded">MemoryBuffer</a>&nbsp;buffer)</code>
<div class="block">Releases the buffer returned by getFileData/provided to putFileData back to cache.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/hive/common/io/DataCache.html#reuseBuffer-org.apache.hadoop.hive.common.io.encoded.MemoryBuffer-">reuseBuffer</a></span>(<a href="../../../../../../org/apache/hadoop/hive/common/io/encoded/MemoryBuffer.html" title="interface in org.apache.hadoop.hive.common.io.encoded">MemoryBuffer</a>&nbsp;buffer)</code>
<div class="block">Notifies the cache that the buffer returned from getFileData/provided to putFileData will
 be used by another consumer and therefore released multiple times (one more time per call).</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="getFileData-java.lang.Object-org.apache.hadoop.hive.common.io.DiskRangeList-long-org.apache.hadoop.hive.common.io.DataCache.DiskRangeListFactory-org.apache.hadoop.hive.common.io.DataCache.BooleanRef-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFileData</h4>
<pre><a href="../../../../../../org/apache/hadoop/hive/common/io/DiskRangeList.html" title="class in org.apache.hadoop.hive.common.io">DiskRangeList</a>&nbsp;getFileData(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;fileKey,
                          <a href="../../../../../../org/apache/hadoop/hive/common/io/DiskRangeList.html" title="class in org.apache.hadoop.hive.common.io">DiskRangeList</a>&nbsp;range,
                          long&nbsp;baseOffset,
                          <a href="../../../../../../org/apache/hadoop/hive/common/io/DataCache.DiskRangeListFactory.html" title="interface in org.apache.hadoop.hive.common.io">DataCache.DiskRangeListFactory</a>&nbsp;factory,
                          <a href="../../../../../../org/apache/hadoop/hive/common/io/DataCache.BooleanRef.html" title="class in org.apache.hadoop.hive.common.io">DataCache.BooleanRef</a>&nbsp;gotAllData)</pre>
<div class="block">Gets file data for particular offsets. The range list is modified in place; it is then
 returned (since the list head could have changed). Ranges are replaced with cached ranges.

 Any such buffer is locked in cache to prevent eviction, and must therefore be released
 back to cache via a corresponding call (releaseBuffer) when the caller is done with it.

 In case of partial overlap with cached data, full cache blocks are always returned;
 there's no capacity for partial matches in return type. The rules are as follows:
 1) If the requested range starts in the middle of a cached range, that cached range will not
    be returned by default (e.g. if [100,200) and [200,300) are cached, the request for
    [150,300) will only return [200,300) from cache). This may be configurable in impls.
    This is because we assume well-known range start offsets are used (rg/stripe offsets), so
    a request from the middle of the start doesn't make sense.
 2) If the requested range ends in the middle of a cached range, that entire cached range will
    be returned (e.g. if [100,200) and [200,300) are cached, the request for [100,250) will
    return both ranges). It should really be same as #1, however currently ORC uses estimated
    end offsets; if we don't return the end block, the caller may read it from disk needlessly.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fileKey</code> - Unique ID of the target file on the file system.</dd>
<dd><code>range</code> - A set of DiskRange-s (linked list) that is to be retrieved. May be modified.</dd>
<dd><code>baseOffset</code> - base offset for the ranges (stripe/stream offset in case of ORC).</dd>
<dd><code>factory</code> - A factory to produce DiskRangeList-s out of cached MemoryBuffer-s.</dd>
<dd><code>gotAllData</code> - An out param - whether all the requested data was found in cache.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The new or modified list of DiskRange-s, where some ranges may contain cached data.</dd>
</dl>
</li>
</ul>
<a name="putFileData-java.lang.Object-org.apache.hadoop.hive.common.io.DiskRange:A-org.apache.hadoop.hive.common.io.encoded.MemoryBuffer:A-long-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>putFileData</h4>
<pre>long[]&nbsp;putFileData(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;fileKey,
                   <a href="../../../../../../org/apache/hadoop/hive/common/io/DiskRange.html" title="class in org.apache.hadoop.hive.common.io">DiskRange</a>[]&nbsp;ranges,
                   <a href="../../../../../../org/apache/hadoop/hive/common/io/encoded/MemoryBuffer.html" title="interface in org.apache.hadoop.hive.common.io.encoded">MemoryBuffer</a>[]&nbsp;data,
                   long&nbsp;baseOffset)</pre>
<div class="block">Puts file data into cache, or gets older data in case of collisions.

 The memory buffers provided MUST be allocated via an allocator returned by getAllocator
 method, to allow cache implementations that evict and then de-allocate the buffer.

 It is assumed that the caller will use the data immediately, therefore any buffers provided
 to putFileData (or returned due to cache collision) are locked in cache to prevent eviction,
 and must therefore be released back to cache via a corresponding call (releaseBuffer) when the
 caller is done with it. Buffers rejected due to conflict will neither be locked, nor
 automatically deallocated. The caller must take care to discard these buffers.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fileKey</code> - Unique ID of the target file on the file system.</dd>
<dd><code>ranges</code> - The ranges for which the data is being cached. These objects will not be stored.</dd>
<dd><code>data</code> - The data for the corresponding ranges.</dd>
<dd><code>baseOffset</code> - base offset for the ranges (stripe/stream offset in case of ORC).</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>null if all data was put; bitmask indicating which chunks were not put otherwise;
         the replacement chunks from cache are updated directly in the array.</dd>
</dl>
</li>
</ul>
<a name="releaseBuffer-org.apache.hadoop.hive.common.io.encoded.MemoryBuffer-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>releaseBuffer</h4>
<pre>void&nbsp;releaseBuffer(<a href="../../../../../../org/apache/hadoop/hive/common/io/encoded/MemoryBuffer.html" title="interface in org.apache.hadoop.hive.common.io.encoded">MemoryBuffer</a>&nbsp;buffer)</pre>
<div class="block">Releases the buffer returned by getFileData/provided to putFileData back to cache.
 See respective javadocs for details.</div>
</li>
</ul>
<a name="reuseBuffer-org.apache.hadoop.hive.common.io.encoded.MemoryBuffer-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reuseBuffer</h4>
<pre>void&nbsp;reuseBuffer(<a href="../../../../../../org/apache/hadoop/hive/common/io/encoded/MemoryBuffer.html" title="interface in org.apache.hadoop.hive.common.io.encoded">MemoryBuffer</a>&nbsp;buffer)</pre>
<div class="block">Notifies the cache that the buffer returned from getFileData/provided to putFileData will
 be used by another consumer and therefore released multiple times (one more time per call).</div>
</li>
</ul>
<a name="getAllocator--">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getAllocator</h4>
<pre><a href="../../../../../../org/apache/hadoop/hive/common/io/Allocator.html" title="interface in org.apache.hadoop.hive.common.io">Allocator</a>&nbsp;getAllocator()</pre>
<div class="block">Gets the allocator associated with this DataCache.</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/DataCache.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/hive/common/io/Allocator.AllocatorOutOfMemoryException.html" title="class in org.apache.hadoop.hive.common.io"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/hadoop/hive/common/io/DataCache.BooleanRef.html" title="class in org.apache.hadoop.hive.common.io"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/hadoop/hive/common/io/DataCache.html" target="_top">Frames</a></li>
<li><a href="DataCache.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>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; 2016 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
