blob: 6764ff7dbbb7e5870d78a70eb4a708e71122cc9f [file] [log] [blame]
import{_ as a,O as s,P as e,ah as n,aW as t}from"./framework-e4340ccd.js";const o={},r=t(`<h1 id="data-archiving" tabindex="-1"><a class="header-anchor" href="#data-archiving" aria-hidden="true">#</a> Data Archiving</h1><p>The data archiving tools consist of 5 Cli commands: <code>set</code>, <code>cancel</code>, <code>pause</code>, <code>continue</code>, and <code>show</code>. Users may use archiving tools to create archiving tasks, these archiving tasks start at the user specified date, and archives expired data (timestamp before expire time) into a target directory specified by user, the user can then perform other operations such as <code>pause</code> on the tasks.</p><h2 id="sql-statements" tabindex="-1"><a class="header-anchor" href="#sql-statements" aria-hidden="true">#</a> SQL statements</h2><h3 id="show-archiving-tasks" tabindex="-1"><a class="header-anchor" href="#show-archiving-tasks" aria-hidden="true">#</a> Show Archiving Tasks</h3><p>Show the data archiving tasks.</p><h4 id="syntax" tabindex="-1"><a class="header-anchor" href="#syntax" aria-hidden="true">#</a> Syntax</h4><div class="language-sql line-numbers-mode" data-ext="sql"><pre class="language-sql"><code><span class="token keyword">SHOW</span> ARCHIVING
<span class="token keyword">SHOW</span> <span class="token keyword">ALL</span> ARCHIVING
<span class="token keyword">SHOW</span> ARCHIVING <span class="token keyword">ON</span> <span class="token operator">&lt;</span>storage_group<span class="token operator">&gt;</span>
<span class="token keyword">SHOW</span> <span class="token keyword">ALL</span> ARCHIVING <span class="token keyword">ON</span> <span class="token operator">&lt;</span>storage_group<span class="token operator">&gt;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><ul><li><code>&lt;storage_group&gt;</code> specifies the storage group to show archiving task on.</li><li><code>all</code> By default, only tasks in the READY, RUNNING, and PAUSED states are returned. You can view tasks in other states by adding the all parameter.</li></ul><h4 id="example-result" tabindex="-1"><a class="header-anchor" href="#example-result" aria-hidden="true">#</a> Example Result</h4><div class="language-sql line-numbers-mode" data-ext="sql"><pre class="language-sql"><code><span class="token operator">+</span><span class="token comment">-------+---------------------------+-------------+------+---------------------------+---------------+----------------+</span>
<span class="token operator">|</span>task id<span class="token operator">|</span> submit <span class="token keyword">time</span><span class="token operator">|</span>storage <span class="token keyword">group</span><span class="token operator">|</span><span class="token keyword">status</span><span class="token operator">|</span> <span class="token keyword">start</span> <span class="token keyword">time</span><span class="token operator">|</span>expire <span class="token keyword">time</span><span class="token punctuation">(</span>ms<span class="token punctuation">)</span><span class="token operator">|</span>target directory<span class="token operator">|</span>
<span class="token operator">+</span><span class="token comment">-------+---------------------------+-------------+------+---------------------------+---------------+----------------+</span>
<span class="token operator">|</span> <span class="token number">0</span><span class="token operator">|</span><span class="token number">2022</span><span class="token operator">-</span><span class="token number">1</span><span class="token operator">-</span><span class="token number">1</span>T00:<span class="token number">00</span>:<span class="token number">00.000</span><span class="token operator">+</span><span class="token number">08</span>:<span class="token number">00</span><span class="token operator">|</span> root<span class="token punctuation">.</span>ln<span class="token operator">|</span> READY<span class="token operator">|</span><span class="token number">2023</span><span class="token operator">-</span><span class="token number">1</span><span class="token operator">-</span><span class="token number">1</span>T00:<span class="token number">00</span>:<span class="token number">00.000</span><span class="token operator">+</span><span class="token number">08</span>:<span class="token number">00</span><span class="token operator">|</span> <span class="token number">360000</span><span class="token operator">|</span> <span class="token operator">/</span>tmp<span class="token operator">|</span>
<span class="token operator">+</span><span class="token comment">-------+---------------------------+-------------+------+---------------------------+---------------+----------------+</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="set-data-archiving-task" tabindex="-1"><a class="header-anchor" href="#set-data-archiving-task" aria-hidden="true">#</a> Set Data Archiving Task</h3><p>User submit data archiving task.</p><h4 id="syntax-1" tabindex="-1"><a class="header-anchor" href="#syntax-1" aria-hidden="true">#</a> Syntax</h4><div class="language-sql line-numbers-mode" data-ext="sql"><pre class="language-sql"><code><span class="token keyword">SET</span> ARCHIVING <span class="token keyword">TO</span> <span class="token operator">&lt;</span>storage_group<span class="token operator">&gt;</span> <span class="token operator">&lt;</span>start_time<span class="token operator">&gt;</span> <span class="token operator">&lt;</span>ttl<span class="token operator">&gt;</span> <span class="token operator">&lt;</span>target_dir<span class="token operator">&gt;</span>
<span class="token keyword">SET</span> ARCHIVING <span class="token keyword">TO</span> storage_group<span class="token operator">=</span><span class="token operator">&lt;</span>storage_group<span class="token operator">&gt;</span> start_time<span class="token operator">=</span><span class="token operator">&lt;</span>start_time<span class="token operator">&gt;</span> ttl<span class="token operator">=</span><span class="token operator">&lt;</span>ttl<span class="token operator">&gt;</span> target_dir<span class="token operator">=</span><span class="token operator">&lt;</span>target_dir<span class="token operator">&gt;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><ul><li><code>&lt;storage_group&gt;</code> specifies the storage group to show archiving task on.</li><li><code>&lt;start_time&gt;</code> specifies the date to start the archiving task.</li><li><code>&lt;ttl&gt;</code> specifies the expire time for task, data with <code>timestamp &lt; now - ttl</code> are archived, units in milliseconds.</li><li><code>&lt;target_dir&gt;</code> specifies the target directory to move the archived data, uses string for the path.</li></ul><h4 id="example" tabindex="-1"><a class="header-anchor" href="#example" aria-hidden="true">#</a> Example</h4><div class="language-sql line-numbers-mode" data-ext="sql"><pre class="language-sql"><code><span class="token keyword">SET</span> ARCHIVING <span class="token keyword">TO</span> storage_group<span class="token operator">=</span>root<span class="token punctuation">.</span>ln start_time<span class="token operator">=</span><span class="token number">2023</span><span class="token operator">-</span><span class="token number">01</span><span class="token operator">-</span><span class="token number">01</span> ttl<span class="token operator">=</span><span class="token number">360000</span> target_dir<span class="token operator">=</span><span class="token string">&quot;/tmp&quot;</span>
<span class="token keyword">SET</span> ARCHIVING <span class="token keyword">TO</span> root<span class="token punctuation">.</span>ln <span class="token number">2023</span><span class="token operator">-</span><span class="token number">01</span><span class="token operator">-</span><span class="token number">01</span> <span class="token number">360000</span> <span class="token string">&quot;/tmp&quot;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h4 id="tips" tabindex="-1"><a class="header-anchor" href="#tips" aria-hidden="true">#</a> Tips</h4><ul><li><code>A=</code> (such as <code>storage_group=</code>) in the Cli commands can be omitted, the order after omission must be the same as the above.</li><li>The start time is in ISO 8601 format, so information such as hour/minute/second can be omitted, and it is set to 0 by default after being omitted.</li><li><code>SET</code> command is able to submit migration tasks for all storage groups by parameters like <code>root.ln.**</code>.</li></ul><h3 id="cancel-archiving-task" tabindex="-1"><a class="header-anchor" href="#cancel-archiving-task" aria-hidden="true">#</a> Cancel Archiving Task</h3><p>Stop and delete the data archiving task. (Note: data that has been archived will not be put back into the database)</p><h4 id="syntax-2" tabindex="-1"><a class="header-anchor" href="#syntax-2" aria-hidden="true">#</a> Syntax</h4><div class="language-sql line-numbers-mode" data-ext="sql"><pre class="language-sql"><code>CANCEL ARCHIVING <span class="token operator">&lt;</span>task_id<span class="token operator">&gt;</span>
CANCEL ARCHIVING <span class="token keyword">ON</span> <span class="token operator">&lt;</span>storage_group<span class="token operator">&gt;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><ul><li><code>&lt;task_id&gt;</code> specifies the id of archiving task to cancel.</li><li><code>&lt;storage_group&gt;</code> specifies the storage group to cancel archiving task, if many exist cancel the one with the lowest start time.</li></ul><h4 id="example-1" tabindex="-1"><a class="header-anchor" href="#example-1" aria-hidden="true">#</a> Example</h4><div class="language-sql line-numbers-mode" data-ext="sql"><pre class="language-sql"><code>CANCEL ARCHIVING <span class="token number">0</span>
CANCEL ARCHIVING <span class="token keyword">ON</span> root<span class="token punctuation">.</span>ln
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="pause-archiving-task" tabindex="-1"><a class="header-anchor" href="#pause-archiving-task" aria-hidden="true">#</a> Pause Archiving Task</h3><p>Suspend the data migration task.</p><h4 id="syntax-3" tabindex="-1"><a class="header-anchor" href="#syntax-3" aria-hidden="true">#</a> Syntax</h4><div class="language-sql line-numbers-mode" data-ext="sql"><pre class="language-sql"><code>PAUSE ARCHIVING <span class="token operator">&lt;</span>task_id<span class="token operator">&gt;</span>
PAUSE ARCHIVING <span class="token keyword">ON</span> <span class="token operator">&lt;</span>storage_group<span class="token operator">&gt;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><ul><li><code>&lt;task_id&gt;</code> specifies the id of archiving task to pause.</li><li><code>&lt;storage_group&gt;</code> specifies the storage group to pause archiving task, if many exist cancel the one with the lowest start time.</li></ul><h4 id="example-2" tabindex="-1"><a class="header-anchor" href="#example-2" aria-hidden="true">#</a> Example</h4><div class="language-sql line-numbers-mode" data-ext="sql"><pre class="language-sql"><code>PAUSE ARCHIVING <span class="token number">0</span>
PAUSE ARCHIVING <span class="token keyword">ON</span> root<span class="token punctuation">.</span>ln
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="resume-archiving-task" tabindex="-1"><a class="header-anchor" href="#resume-archiving-task" aria-hidden="true">#</a> Resume Archiving Task</h3><p>Resume suspended data archiving tasks.</p><h4 id="syntax-4" tabindex="-1"><a class="header-anchor" href="#syntax-4" aria-hidden="true">#</a> Syntax</h4><div class="language-sql line-numbers-mode" data-ext="sql"><pre class="language-sql"><code>RESUME ARCHIVING <span class="token operator">&lt;</span>task_id<span class="token operator">&gt;</span>
RESUME ARCHIVING <span class="token keyword">ON</span> <span class="token operator">&lt;</span>storage_group<span class="token operator">&gt;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><ul><li><code>&lt;task_id&gt;</code> specifies the id of archiving task to resume.</li><li><code>&lt;storage_group&gt;</code> specifies the storage group to resume archiving task, if many exist cancel the one with the lowest start time.</li></ul><h4 id="example-3" tabindex="-1"><a class="header-anchor" href="#example-3" aria-hidden="true">#</a> Example</h4><div class="language-sql line-numbers-mode" data-ext="sql"><pre class="language-sql"><code>RESUME ARCHIVING <span class="token number">0</span>
RESUME ARCHIVING <span class="token keyword">ON</span> root<span class="token punctuation">.</span>ln
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="system-parameter-configuration" tabindex="-1"><a class="header-anchor" href="#system-parameter-configuration" aria-hidden="true">#</a> System Parameter Configuration</h2><table><thead><tr><th style="text-align:left;">Name</th><th>Description</th><th>Data Type</th><th>Default Value</th></tr></thead><tbody><tr><td style="text-align:left;"><code>archiving_thread_num</code></td><td>The number of threads in the thread pool that executes archiving tasks.</td><td>int</td><td>2</td></tr></tbody></table>`,42);function i(p,l){return s(),e("div",null,[n(`
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
`),r])}const d=a(o,[["render",i],["__file","Archiving.html.vue"]]);export{d as default};