blob: 26c2c609c22cb7fff1f7fabbf4911f66d1db5f99 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>iceberg-cpp: iceberg::FileIO Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">iceberg-cpp
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>iceberg</b></li><li class="navelem"><a class="el" href="classiceberg_1_1FileIO.html">FileIO</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classiceberg_1_1FileIO-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">iceberg::FileIO Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Pluggable module for reading, writing, and deleting files.
<a href="classiceberg_1_1FileIO.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="file__io_8h_source.html">file_io.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for iceberg::FileIO:</div>
<div class="dyncontent">
<div class="center">
<img src="classiceberg_1_1FileIO.png" usemap="#iceberg::FileIO_map" alt=""/>
<map id="iceberg::FileIO_map" name="iceberg::FileIO_map">
<area href="classiceberg_1_1MockFileIO.html" alt="iceberg::MockFileIO" shape="rect" coords="0,56,230,80"/>
<area href="classiceberg_1_1arrow_1_1ArrowFileSystemFileIO.html" title="A concrete implementation of FileIO for Arrow file system." alt="iceberg::arrow::ArrowFileSystemFileIO" shape="rect" coords="240,56,470,80"/>
<area href="classiceberg_1_1test_1_1StdFileIO.html" title="Simple local filesystem FileIO implementation for testing." alt="iceberg::test::StdFileIO" shape="rect" coords="480,56,710,80"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a714e3babeac9395ed6ef4b2f5c94a5cd" id="r_a714e3babeac9395ed6ef4b2f5c94a5cd"><td class="memItemLeft" align="right" valign="top">virtual Result&lt; std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classiceberg_1_1FileIO.html#a714e3babeac9395ed6ef4b2f5c94a5cd">ReadFile</a> (const std::string &amp;file_location, std::optional&lt; size_t &gt; length)</td></tr>
<tr class="memdesc:a714e3babeac9395ed6ef4b2f5c94a5cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read the content of the file at the given location. <br /></td></tr>
<tr class="separator:a714e3babeac9395ed6ef4b2f5c94a5cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a527a78aca1045034250f50a51d8dc0f9" id="r_a527a78aca1045034250f50a51d8dc0f9"><td class="memItemLeft" align="right" valign="top">virtual Status&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classiceberg_1_1FileIO.html#a527a78aca1045034250f50a51d8dc0f9">WriteFile</a> (const std::string &amp;file_location, std::string_view content)</td></tr>
<tr class="memdesc:a527a78aca1045034250f50a51d8dc0f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write the given content to the file at the given location. <br /></td></tr>
<tr class="separator:a527a78aca1045034250f50a51d8dc0f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace7c9ec329017d5a99082739e8578937" id="r_ace7c9ec329017d5a99082739e8578937"><td class="memItemLeft" align="right" valign="top">virtual Status&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classiceberg_1_1FileIO.html#ace7c9ec329017d5a99082739e8578937">DeleteFile</a> (const std::string &amp;file_location)</td></tr>
<tr class="memdesc:ace7c9ec329017d5a99082739e8578937"><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete a file at the given location. <br /></td></tr>
<tr class="separator:ace7c9ec329017d5a99082739e8578937"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Pluggable module for reading, writing, and deleting files. </p>
<p>This module only handle metadata files, not data files. The metadata files are typically small and are used to store schema, partition information, and other metadata about the table.</p>
<p>Note that these functions are not atomic. For example, if a write fails, the file may be partially written. Implementations should be careful to avoid corrupting metadata files. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="ace7c9ec329017d5a99082739e8578937" name="ace7c9ec329017d5a99082739e8578937"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ace7c9ec329017d5a99082739e8578937">&#9670;&#160;</a></span>DeleteFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual Status iceberg::FileIO::DeleteFile </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>file_location</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Delete a file at the given location. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">file_location</td><td>The location of the file to delete. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void if the delete succeeded, an error code if the delete failed. </dd></dl>
<p>Reimplemented in <a class="el" href="classiceberg_1_1arrow_1_1ArrowFileSystemFileIO.html#a054c596530ea55f4e66155c46308ab74">iceberg::arrow::ArrowFileSystemFileIO</a>, and <a class="el" href="classiceberg_1_1test_1_1StdFileIO.html#a1050c568739393ef643f8601086a354e">iceberg::test::StdFileIO</a>.</p>
</div>
</div>
<a id="a714e3babeac9395ed6ef4b2f5c94a5cd" name="a714e3babeac9395ed6ef4b2f5c94a5cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a714e3babeac9395ed6ef4b2f5c94a5cd">&#9670;&#160;</a></span>ReadFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual Result&lt; std::string &gt; iceberg::FileIO::ReadFile </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>file_location</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::optional&lt; size_t &gt;&#160;</td>
<td class="paramname"><em>length</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Read the content of the file at the given location. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">file_location</td><td>The location of the file to read. </td></tr>
<tr><td class="paramname">length</td><td>The number of bytes to read. Some object storage need to specify the length to read, e.g. S3 <code>GetObject</code> has a Range parameter. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The content of the file if the read succeeded, an error code if the read failed. </dd></dl>
<p>Reimplemented in <a class="el" href="classiceberg_1_1arrow_1_1ArrowFileSystemFileIO.html#aa023cae7f400db161e6d847c2bf6f2f3">iceberg::arrow::ArrowFileSystemFileIO</a>, and <a class="el" href="classiceberg_1_1test_1_1StdFileIO.html#acd86d18e3fb3a5dc6b86584953ec34f1">iceberg::test::StdFileIO</a>.</p>
</div>
</div>
<a id="a527a78aca1045034250f50a51d8dc0f9" name="a527a78aca1045034250f50a51d8dc0f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a527a78aca1045034250f50a51d8dc0f9">&#9670;&#160;</a></span>WriteFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual Status iceberg::FileIO::WriteFile </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>file_location</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string_view&#160;</td>
<td class="paramname"><em>content</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Write the given content to the file at the given location. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">file_location</td><td>The location of the file to write. </td></tr>
<tr><td class="paramname">content</td><td>The content to write to the file. </td></tr>
<tr><td class="paramname">overwrite</td><td>If true, overwrite the file if it exists. If false, fail if the file exists. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void if the write succeeded, an error code if the write failed. </dd></dl>
<p>Reimplemented in <a class="el" href="classiceberg_1_1arrow_1_1ArrowFileSystemFileIO.html#a989c72cecf8dc2463cc90f947d36ba50">iceberg::arrow::ArrowFileSystemFileIO</a>, and <a class="el" href="classiceberg_1_1test_1_1StdFileIO.html#a42ed781e4a4eedf4538d8e1c8da28680">iceberg::test::StdFileIO</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>iceberg/<a class="el" href="file__io_8h_source.html">file_io.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>