Skip to content

Commit

Permalink
Merge pull request #1165 from takuya-isbs/feature/gfptar-reduce-memory
Browse files Browse the repository at this point in the history
gfptar - reduce memory usage
  • Loading branch information
otatebe authored Nov 8, 2024
2 parents 97e6c9f + a818f67 commit f570565
Show file tree
Hide file tree
Showing 5 changed files with 4,131 additions and 983 deletions.
4 changes: 4 additions & 0 deletions INSTALL.en
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,8 @@ postgresql, postgresql-client (required to execute config-gfarm)
libfuse-dev (required to build gfarm2fs)
python3, python3-docopt, python3-schema (required to execute gfptar)

* pip (Python Package Installer) Package

orjson (If it is installed, use it to accelerate gfptar)

$Id$
4 changes: 4 additions & 0 deletions INSTALL.ja
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,8 @@ postgresql, postgresql-client (config-gfarm の実行に必要)
libfuse-dev (gfarm2fs の構築に必要)
python3, python3-docopt, python3-schema (gfptar の実行に必要)

* pip (Python Package Installer) パッケージ

orjson (インストールされていれば gfptar を高速化)

$Id$
70 changes: 59 additions & 11 deletions doc/docbook/en/ref/man1/gfptar.1.docbook
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<refentry id="gfptar.1">

<refentryinfo><date>29 Jan 2023</date></refentryinfo>
<refentryinfo><date>27 Sep 2024</date></refentryinfo>

<refmeta>
<refentrytitle>gfptar</refentrytitle>
Expand Down Expand Up @@ -43,6 +43,22 @@
<arg choice="plain" rep="norepeat">-t <replaceable>indir</replaceable></arg>
</cmdsynopsis>

<cmdsynopsis sepchar=" ">
<command moreinfo="none">gfptar</command>
<arg choice="opt" rep="norepeat">OPTIONS</arg>
<arg choice="plain" rep="norepeat">-r <replaceable>outdir</replaceable></arg>
<arg choice="opt" rep="norepeat">-C <replaceable>basedir</replaceable></arg>
<arg choice="plain" rep="repeat"><replaceable>member</replaceable></arg>
</cmdsynopsis>

<cmdsynopsis sepchar=" ">
<command moreinfo="none">gfptar</command>
<arg choice="opt" rep="norepeat">OPTIONS</arg>
<arg choice="plain" rep="norepeat">-u <replaceable>outdir</replaceable></arg>
<arg choice="opt" rep="norepeat">-C <replaceable>basedir</replaceable></arg>
<arg choice="plain" rep="repeat"><replaceable>member</replaceable></arg>
</cmdsynopsis>

</refsynopsisdiv>

<!-- body begins here -->
Expand All @@ -51,9 +67,9 @@

<para>
<command moreinfo="none">gfptar</command>
creates archive files to Gfarm, or extracts files from archive files on Gfarm.
The archive files consist of multiple tar files and list files of archived members in a directory.
Creation or extraction is performed in parallel for each tar file in a directory for archive.
creates archive files to Gfarm or local file system, or extracts the archive files.
The archive files consist of multiple tar files and database files in a directory.
Creation or extraction is performed in parallel for each tar file.
</para>

</refsect1>
Expand All @@ -63,7 +79,8 @@

<varlistentry>
<term><option>-c(--create)</option> <parameter moreinfo="none">outdir</parameter>
<option>-C(--basedir)</option> <parameter moreinfo="none">basedir</parameter> <parameter moreinfo="none">member...</parameter>
[<option>-C(--basedir)</option> <parameter moreinfo="none">basedir</parameter>]
<parameter moreinfo="none">member...</parameter>
</term>
<listitem>
<para>
Expand Down Expand Up @@ -99,6 +116,31 @@
</listitem>
</varlistentry>

<varlistentry>
<term><option>-r(--append)</option> <parameter moreinfo="none">outdir</parameter>
[<option>-C(--basedir)</option> <parameter moreinfo="none">basedir</parameter>]
<parameter moreinfo="none">member...</parameter>
</term>
<listitem>
<para>
Append archive files in <parameter moreinfo="none">outdir</parameter> directory.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-u(--update)</option> <parameter moreinfo="none">outdir</parameter>
[<option>-C(--basedir)</option> <parameter moreinfo="none">basedir</parameter>]
<parameter moreinfo="none">member...</parameter>
</term>
<listitem>
<para>
Append archive files with newer files
in existing <parameter moreinfo="none">outdir</parameter> directory.
</para>
</listitem>
</varlistentry>

</variablelist>
</refsect1>

Expand Down Expand Up @@ -136,6 +178,12 @@
</refsect1>

<refsect1 id="options"><title>OPTIONS</title>

<para>
The primary options are listed below.
For additional options, please refer to <command moreinfo="none">gfptar --help</command>.
</para>

<variablelist>

<varlistentry>
Expand All @@ -161,13 +209,13 @@
for each group of files divided by the assumed size calculated considering the assumed compression ratio (--ratio option).
</para>
<para>
The default value is 200M (200 * 1024^2 = 209715200) (200 MiB).
The default value is 200Mi (200 * 1024^2 = 209715200) (200 mebibytes).
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-r, --ratio=</option><parameter moreinfo="none">RATIO</parameter></term>
<term><option>--ratio=</option><parameter moreinfo="none">RATIO</parameter></term>
<listitem>
<para>
Specifies the assumed compression ratio in percentage for <option>--create</option>.
Expand All @@ -188,9 +236,6 @@
"xz" means xz type (suffix is .tar.xz).
"no" means no compression.
</para>
<para>
This option is unnecessary for --extract (determine type automatically).
</para>
<para>
The default value is gz.
</para>
Expand Down Expand Up @@ -236,7 +281,7 @@
</varlistentry>

<varlistentry>
<term><option>-?, -h, --help</option></term>
<term><option>-?, --help</option></term>
<listitem>
<para>
Displays a list of command options.
Expand Down Expand Up @@ -292,6 +337,9 @@
</refsect1>

<refsect1 id="see-also"><title>SEE ALSO</title>
<para>
<command moreinfo="none">gfptar --help</command>
</para>
<para>
<citerefentry>
<refentrytitle>gfreg</refentrytitle><manvolnum>1</manvolnum>
Expand Down
75 changes: 61 additions & 14 deletions doc/docbook/ja/ref/man1/gfptar.1.docbook
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<refentry id="gfptar.1">

<refentryinfo><date>29 Jan 2023</date></refentryinfo>
<refentryinfo><date>27 Sep 2024</date></refentryinfo>

<refmeta>
<refentrytitle>gfptar</refentrytitle>
Expand Down Expand Up @@ -43,6 +43,22 @@
<arg choice="plain" rep="norepeat">-t <replaceable>indir</replaceable></arg>
</cmdsynopsis>

<cmdsynopsis sepchar=" ">
<command moreinfo="none">gfptar</command>
<arg choice="opt" rep="norepeat">OPTIONS</arg>
<arg choice="plain" rep="norepeat">-r <replaceable>outdir</replaceable></arg>
<arg choice="opt" rep="norepeat">-C <replaceable>basedir</replaceable></arg>
<arg choice="plain" rep="repeat"><replaceable>member</replaceable></arg>
</cmdsynopsis>

<cmdsynopsis sepchar=" ">
<command moreinfo="none">gfptar</command>
<arg choice="opt" rep="norepeat">OPTIONS</arg>
<arg choice="plain" rep="norepeat">-u <replaceable>outdir</replaceable></arg>
<arg choice="opt" rep="norepeat">-C <replaceable>basedir</replaceable></arg>
<arg choice="plain" rep="repeat"><replaceable>member</replaceable></arg>
</cmdsynopsis>

</refsynopsisdiv>

<!-- body begins here -->
Expand All @@ -51,9 +67,9 @@

<para>
<command moreinfo="none">gfptar</command>
は、アーカイブファイルをGfarm上に作成します。また、そのアーカイブファイルからファイルを抽出します。
作成されるアーカイブファイルは、ディレクトリの中に複数のtarファイルと複数のファイル一覧のファイルで構成されます
アーカイブの作成または抽出処理を、アーカイブ用ディレクトリ内のtarファイルごとに並列でおこないます
は、アーカイブファイルをGfarmまたはローカルファイルシステムに作成します。または、そのアーカイブファイルからファイルを抽出します。
作成されるアーカイブファイルは、一つのディレクトリの中に、複数のtarファイルと複数のデータベースファイルで構成されます
アーカイブの作成または抽出処理を、tarファイルごとに並列でおこないます
</para>

</refsect1>
Expand All @@ -63,7 +79,8 @@

<varlistentry>
<term><option>-c(--create)</option> <parameter moreinfo="none">outdir</parameter>
<option>-C(--basedir)</option> <parameter moreinfo="none">basedir</parameter> <parameter moreinfo="none">member...</parameter>
[<option>-C(--basedir)</option> <parameter moreinfo="none">basedir</parameter>]
<parameter moreinfo="none">member...</parameter>
</term>
<listitem>
<para>
Expand Down Expand Up @@ -100,6 +117,30 @@
</listitem>
</varlistentry>

<varlistentry>
<term><option>-r(--append)</option> <parameter moreinfo="none">outdir</parameter>
[<option>-C(--basedir)</option> <parameter moreinfo="none">basedir</parameter>]
<parameter moreinfo="none">member...</parameter>
</term>
<listitem>
<para>
<parameter moreinfo="none">outdir</parameter> に、既存アーカイブファイル群を含むディレクトリを指定し、アーカイブファイルを追加します。
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-u(--update)</option> <parameter moreinfo="none">outdir</parameter>
[<option>-C(--basedir)</option> <parameter moreinfo="none">basedir</parameter>]
<parameter moreinfo="none">member...</parameter>
</term>
<listitem>
<para>
<parameter moreinfo="none">outdir</parameter> に、アーカイブファイル群を含むディレクトリを指定し、既存ファイルよりも新しいファイルのみを格納したアーカイブファイル追加します。
</para>
</listitem>
</varlistentry>

</variablelist>
</refsect1>

Expand Down Expand Up @@ -137,6 +178,12 @@
</refsect1>

<refsect1 id="options"><title>OPTIONS</title>

<para>
主なオプションは以下の通りです。
その他オプションは <command moreinfo="none">gfptar --help</command> を参照してください。
</para>

<variablelist>

<varlistentry>
Expand All @@ -160,13 +207,13 @@
仮定圧縮率(別オプション --ratio)を考慮して計算された想定サイズで分割されたファイル群ごとにアーカイブファイルを作成します。
</para>
<para>
デフォルト値は 200M (200 * 1024^2 = 209715200) (200 メビバイト) です。
デフォルト値は 200Mi (200 * 1024^2 = 209715200) (200 メビバイト) です。
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-r, --ratio=</option><parameter moreinfo="none">RATIO</parameter></term>
<term><option>--ratio=</option><parameter moreinfo="none">RATIO</parameter></term>
<listitem>
<para>
アーカイブを作成時に、分割されるアーカイブファイルの仮定圧縮率(%)を指定します。
Expand All @@ -181,14 +228,11 @@
<term><option>-T, --type=</option><parameter moreinfo="none">TYPE</parameter></term>
<listitem>
<para>
アーカイブを作成時に、圧縮する形式を指定します
アーカイブ新規作成時(--create)の圧縮形式を指定します
gz は gzip、bz2 は bzip2、xz は xz 形式で圧縮されます。
拡張子もそれぞれ tar.gz, tar.bz2, tar,xz になります。
拡張子はそれぞれ tar.gz, tar.bz2, tar.xz になります。
no を指定すると圧縮しません。
</para>
<para>
抽出時にこのオプションは使用されず、形式が自動で認識されます。
</para>
<para>
デフォルト値は gz です。
</para>
Expand All @@ -201,7 +245,7 @@
<para>
アーカイブを作成時または抽出時に、圧縮・伸張するための外部コマンドを指定します。
作成されるアーカイブファイルの拡張子を <option>--type</option> オプションで指定します。
抽出時にはそのコマンドに -d オプションが指定されます。
抽出時にはその外部コマンドに -d オプションが指定されます。
</para>
</listitem>
</varlistentry>
Expand Down Expand Up @@ -234,7 +278,7 @@
</varlistentry>

<varlistentry>
<term><option>-?, -h, --help</option></term>
<term><option>-?, --help</option></term>
<listitem>
<para>
コマンドオプションを出力します。
Expand Down Expand Up @@ -292,6 +336,9 @@
</refsect1>

<refsect1 id="see-also"><title>SEE ALSO</title>
<para>
<command moreinfo="none">gfptar --help</command>
</para>
<para>
<citerefentry>
<refentrytitle>gfreg</refentrytitle><manvolnum>1</manvolnum>
Expand Down
Loading

0 comments on commit f570565

Please sign in to comment.