mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-16 21:10:38 +00:00
30 lines
7.0 KiB
HTML
30 lines
7.0 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Format specification for Puffin files"><title>puffin::file_format - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="puffin" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module file_format</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../puffin/index.html">puffin</a><span class="version">1.0.0-rc.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module file_<wbr>format</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#format-specification-for-puffin-files" title="Format specification for Puffin files">Format specification for Puffin files</a><ul><li><a href="#file-structure" title="File structure">File structure</a></li><li><a href="#footer-structure" title="Footer structure">Footer structure</a></li><li><a href="#footer-payload" title="Footer Payload">Footer Payload</a></li></ul></li></ul><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate puffin</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">puffin</a></div><h1>Module <span>file_<wbr>format</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/puffin/file_format.rs.html#15-66">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="format-specification-for-puffin-files"><a class="doc-anchor" href="#format-specification-for-puffin-files">§</a>Format specification for Puffin files</h2><h3 id="file-structure"><a class="doc-anchor" href="#file-structure">§</a>File structure</h3>
|
||
<p>Magic Blob₁ Blob₂ … Blobₙ Footer</p>
|
||
<ul>
|
||
<li><code>Magic</code> is four bytes 0x50, 0x46, 0x41, 0x31 (short for: Puffin Fratercula arctica, version 1),</li>
|
||
<li><code>Blobᵢ</code> is i-th blob contained in the file, to be interpreted by application according to the footer,</li>
|
||
<li><code>Footer</code> is defined below.</li>
|
||
</ul>
|
||
<h3 id="footer-structure"><a class="doc-anchor" href="#footer-structure">§</a>Footer structure</h3>
|
||
<p>Magic FooterPayload FooterPayloadSize Flags Magic</p>
|
||
<ul>
|
||
<li><code>Magic</code>: four bytes, same as at the beginning of the file</li>
|
||
<li><code>FooterPayload</code>: optionally compressed, UTF-8 encoded JSON payload describing the blobs in the file, with the structure described below</li>
|
||
<li><code>FooterPayloadSize</code>: a length in bytes of the <code>FooterPayload</code> (after compression, if compressed), stored as 4 byte integer</li>
|
||
<li><code>Flags</code>: 4 bytes for boolean flags
|
||
<ul>
|
||
<li>byte 0 (first)
|
||
<ul>
|
||
<li>bit 0 (lowest bit): whether <code>FooterPayload</code> is compressed</li>
|
||
<li>all other bits are reserved for future use and should be set to 0 on write</li>
|
||
</ul>
|
||
</li>
|
||
<li>all other bytes are reserved for future use and should be set to 0 on write
|
||
A 4 byte integer is always signed, in a two’s complement representation, stored little-endian.</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
<h3 id="footer-payload"><a class="doc-anchor" href="#footer-payload">§</a>Footer Payload</h3>
|
||
<p>Footer payload bytes is either uncompressed or LZ4-compressed (as a single LZ4 compression frame with content size present),
|
||
UTF-8 encoded JSON payload representing a single <a href="../file_metadata/struct.FileMetadata.html"><code>FileMetadata</code></a> object.</p>
|
||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="reader/index.html" title="mod puffin::file_format::reader">reader</a></dt><dt><a class="mod" href="writer/index.html" title="mod puffin::file_format::writer">writer</a></dt></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Flags.html" title="struct puffin::file_format::Flags">Flags</a></dt></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.FLAGS_SIZE.html" title="constant puffin::file_format::FLAGS_SIZE">FLAGS_<wbr>SIZE</a></dt><dt><a class="constant" href="constant.MAGIC.html" title="constant puffin::file_format::MAGIC">MAGIC</a></dt><dt><a class="constant" href="constant.MAGIC_SIZE.html" title="constant puffin::file_format::MAGIC_SIZE">MAGIC_<wbr>SIZE</a></dt><dt><a class="constant" href="constant.MIN_FILE_SIZE.html" title="constant puffin::file_format::MIN_FILE_SIZE">MIN_<wbr>FILE_<wbr>SIZE</a></dt><dt><a class="constant" href="constant.MIN_FOOTER_SIZE.html" title="constant puffin::file_format::MIN_FOOTER_SIZE">MIN_<wbr>FOOTER_<wbr>SIZE</a></dt><dt><a class="constant" href="constant.PAYLOAD_SIZE_SIZE.html" title="constant puffin::file_format::PAYLOAD_SIZE_SIZE">PAYLOAD_<wbr>SIZE_<wbr>SIZE</a></dt></dl></section></div></main></body></html> |