Skip to content

Commit

Permalink
Deployed a494acf with MkDocs version: 1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kkli08 committed Oct 8, 2024
1 parent fc9d1a0 commit aad6a09
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 12 deletions.
13 changes: 7 additions & 6 deletions api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ <h1>Module</h1>

<h3 id="database-operations">Database Operations<a class="headerlink" href="#database-operations" title="Permanent link">&para;</a></h3>
<h4 id="veloxdbopenstring-db_name"><strong><em>VeloxDB::Open(string db_name)</em></strong><a class="headerlink" href="#veloxdbopenstring-db_name" title="Permanent link">&para;</a></h4>
<p>Initializes the database system, setting up the necessary files and directories (including SSTs and related data). Can be initialized with a custom Memtable size or default size of <code>1e3</code>.</p>
<p>Initializes and open the database system, setting up the necessary files and directories (including SSTs and related data). Can be initialized with a custom Memtable size or default size of <code>1e3</code>.</p>
<div class="codehilite"><pre><span></span><code><span class="cp">#include</span><span class="w"> </span><span class="cpf">&quot;VeloxDB/VeloxDB.h&quot;</span>
<span class="cm">/*</span>
<span class="cm"> * Initialize with default value : </span>
Expand All @@ -652,16 +652,16 @@ <h4 id="veloxdbopenstring-db_name"><strong><em>VeloxDB::Open(string db_name)</em
<span class="k">auto</span><span class="w"> </span><span class="n">MyDBDefault</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">std</span><span class="o">::</span><span class="n">make_unique</span><span class="o">&lt;</span><span class="n">VeloxDB</span><span class="o">&gt;</span><span class="p">();</span>
<span class="k">auto</span><span class="w"> </span><span class="n">MyDBDefault</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">std</span><span class="o">::</span><span class="n">make_unique</span><span class="o">&lt;</span><span class="n">VeloxDB</span><span class="o">&gt;</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">memtableSize</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">BTreeDegree</span><span class="p">);</span>

<span class="n">MyDBDefault</span><span class="o">-&gt;</span><span class="n">Open</span><span class="p">(</span><span class="s">&quot;database_name&quot;</span><span class="p">);</span>
<span class="n">MyDBDefault</span><span class="o">-&gt;</span><span class="n">Open</span><span class="p">(</span><span class="s">&quot;database_name&quot;</span><span class="p">);</span><span class="w"> </span><span class="c1">// open</span>
</code></pre></div>

<h4 id="veloxdbclose"><strong><em>VeloxDB::Close()</em></strong><a class="headerlink" href="#veloxdbclose" title="Permanent link">&para;</a></h4>
<p>Closes the database, flushing any data in memory (Memtable) to disk and storing it in SSTs.</p>
<p>Close the database, flushing any data in memory (Memtable) to disk and storing it in SSTs.</p>
<div class="codehilite"><pre><span></span><code><span class="cp">#include</span><span class="w"> </span><span class="cpf">&quot;VeloxDB/VeloxDB.h&quot;</span>
<span class="c1">// Close the database and flush the Memtable to disk</span>
<span class="k">auto</span><span class="w"> </span><span class="n">MyDB</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">std</span><span class="o">::</span><span class="n">make_unique</span><span class="o">&lt;</span><span class="n">VeloxDB</span><span class="o">&gt;</span><span class="p">();</span>
<span class="n">MyDB</span><span class="o">-&gt;</span><span class="n">Open</span><span class="p">(</span><span class="s">&quot;database_name&quot;</span><span class="p">);</span>
<span class="n">MyDB</span><span class="o">-&gt;</span><span class="n">Close</span><span class="p">();</span>
<span class="n">MyDB</span><span class="o">-&gt;</span><span class="n">Close</span><span class="p">();</span><span class="w"> </span><span class="c1">// close</span>
</code></pre></div>

<h3 id="data-operations">Data Operations<a class="headerlink" href="#data-operations" title="Permanent link">&para;</a></h3>
Expand All @@ -671,6 +671,7 @@ <h4 id="template-veloxdbputk-key-v-value"><strong><em>Template<typename K, typen
<span class="c1">// Example of inserting different data types</span>
<span class="k">auto</span><span class="w"> </span><span class="n">MyDB</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">std</span><span class="o">::</span><span class="n">make_unique</span><span class="o">&lt;</span><span class="n">VeloxDB</span><span class="o">&gt;</span><span class="p">();</span>
<span class="n">MyDB</span><span class="o">-&gt;</span><span class="n">Open</span><span class="p">(</span><span class="s">&quot;database_name&quot;</span><span class="p">);</span>
<span class="c1">// put</span>
<span class="n">MyDB</span><span class="o">-&gt;</span><span class="n">Put</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">100</span><span class="p">);</span><span class="w"> </span><span class="c1">// int -&gt; int</span>
<span class="n">MyDB</span><span class="o">-&gt;</span><span class="n">Put</span><span class="p">(</span><span class="mf">1.5</span><span class="p">,</span><span class="w"> </span><span class="sc">&#39;A&#39;</span><span class="p">);</span><span class="w"> </span><span class="c1">// double -&gt; char</span>
<span class="n">MyDB</span><span class="o">-&gt;</span><span class="n">Put</span><span class="p">(</span><span class="s">&quot;Hello&quot;</span><span class="p">,</span><span class="w"> </span><span class="mf">1e8L</span><span class="n">L</span><span class="p">);</span><span class="w"> </span><span class="c1">// string -&gt; long long</span>
Expand All @@ -688,7 +689,7 @@ <h4 id="veloxdbgetconst-keyvaluewrapper-key"><strong><em>VeloxDB::Get(const KeyV
<span class="n">MyDB</span><span class="o">-&gt;</span><span class="n">Put</span><span class="p">(</span><span class="s">&quot;Hello&quot;</span><span class="p">,</span><span class="w"> </span><span class="mf">1e8L</span><span class="n">L</span><span class="p">);</span>

<span class="c1">// Retrieve the value by key</span>
<span class="k">auto</span><span class="w"> </span><span class="n">result1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">MyDB</span><span class="o">-&gt;</span><span class="n">Get</span><span class="p">(</span><span class="s">&quot;Hello&quot;</span><span class="p">);</span>
<span class="k">auto</span><span class="w"> </span><span class="n">result1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">MyDB</span><span class="o">-&gt;</span><span class="n">Get</span><span class="p">(</span><span class="s">&quot;Hello&quot;</span><span class="p">);</span><span class="w"> </span><span class="c1">// get</span>
<span class="kt">long</span><span class="w"> </span><span class="kt">long</span><span class="w"> </span><span class="n">value1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">result1</span><span class="p">.</span><span class="n">kv</span><span class="p">.</span><span class="n">long_value</span><span class="p">();</span><span class="w"> </span><span class="c1">// 1e8</span>
<span class="n">string</span><span class="w"> </span><span class="n">key1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">result1</span><span class="p">.</span><span class="n">kv</span><span class="p">.</span><span class="n">string_key</span><span class="p">();</span><span class="w"> </span><span class="c1">// &quot;Hello&quot;</span>

Expand Down Expand Up @@ -718,7 +719,7 @@ <h4 id="veloxdbscankeyvaluewrapper-smallestkey-keyvaluewrapper-largestkey"><stro
<span class="k">auto</span><span class="w"> </span><span class="n">MyDB</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">std</span><span class="o">::</span><span class="n">make_unique</span><span class="o">&lt;</span><span class="n">VeloxDB</span><span class="o">&gt;</span><span class="p">();</span>
<span class="n">MyDB</span><span class="o">-&gt;</span><span class="n">Open</span><span class="p">(</span><span class="s">&quot;database_name&quot;</span><span class="p">);</span>
<span class="c1">// Scan by key</span>
<span class="n">std</span><span class="o">::</span><span class="n">set</span><span class="o">&lt;</span><span class="n">KeyValueWrapper</span><span class="o">&gt;</span><span class="w"> </span><span class="n">results</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">MyDB</span><span class="o">-&gt;</span><span class="n">Scan</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">10</span><span class="p">);</span>
<span class="n">std</span><span class="o">::</span><span class="n">set</span><span class="o">&lt;</span><span class="n">KeyValueWrapper</span><span class="o">&gt;</span><span class="w"> </span><span class="n">results</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">MyDB</span><span class="o">-&gt;</span><span class="n">Scan</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">10</span><span class="p">);</span><span class="w"> </span><span class="c1">// scan</span>
<span class="c1">// Scan by `KeyValueWrapper` instance</span>
<span class="n">std</span><span class="o">::</span><span class="n">set</span><span class="o">&lt;</span><span class="n">KeyValueWrapper</span><span class="o">&gt;</span><span class="w"> </span><span class="n">results</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">MyDB</span><span class="o">-&gt;</span><span class="n">Scan</span><span class="p">(</span><span class="n">KeyValueWrapper</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;&quot;</span><span class="p">),</span><span class="w"> </span><span class="n">KeyValueWrapper</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;&quot;</span><span class="p">));</span>
</code></pre></div>
Expand Down
47 changes: 42 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,18 @@
</li>

<li class="md-nav__item">
<a href="#supported-platforms" class="md-nav__link">
<a href="#supported-language" class="md-nav__link">
<span class="md-ellipsis">
Supported Platforms
Supported Language
</span>
</a>

</li>

<li class="md-nav__item">
<a href="#c-supported-platforms" class="md-nav__link">
<span class="md-ellipsis">
C++ Supported Platforms
</span>
</a>

Expand Down Expand Up @@ -409,9 +418,18 @@
</li>

<li class="md-nav__item">
<a href="#supported-platforms" class="md-nav__link">
<a href="#supported-language" class="md-nav__link">
<span class="md-ellipsis">
Supported Language
</span>
</a>

</li>

<li class="md-nav__item">
<a href="#c-supported-platforms" class="md-nav__link">
<span class="md-ellipsis">
Supported Platforms
C++ Supported Platforms
</span>
</a>

Expand Down Expand Up @@ -500,7 +518,26 @@ <h2 id="supported-data-types">Supported Data Types<a class="headerlink" href="#s
<p>2024-08-28 Support <int_64, int_64>
</p>
</blockquote>
<h2 id="supported-platforms">Supported Platforms<a class="headerlink" href="#supported-platforms" title="Permanent link">&para;</a></h2>
<h2 id="supported-language">Supported Language<a class="headerlink" href="#supported-language" title="Permanent link">&para;</a></h2>
<table>
<thead>
<tr>
<th>Language</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>C++</code></td>
<td></td>
</tr>
<tr>
<td><code>Rust</code></td>
<td></td>
</tr>
</tbody>
</table>
<h2 id="c-supported-platforms"><code>C++</code> Supported Platforms<a class="headerlink" href="#c-supported-platforms" title="Permanent link">&para;</a></h2>
<p>The KV-Store system has been tested across multiple platforms and compilers. Below is the current support status:</p>
<table>
<thead>
Expand Down
Loading

0 comments on commit aad6a09

Please sign in to comment.