データベース消去のユーティリティ |
|
この問題を解決するため、BOINC では db_purge というユーティリティを提供します。 この機能は、 リザルトとワークユニットのレコードを XML 形式の保存ファイルに書き出した後、 データベースから消去します。
ワークユニットが消されるのは、対応する入力ファイルが消された後でだけです。 BOINC のファイル消去の方針からすると、これが意味するところは、 すべてのリザルトが完了しているということです。 そういうわけで、ワークユニットが消されるときには、 対応するリザルトもすべて消去されます。
db_purge は、プロジェクトの bin/ ディレクトリで走らせてください。 そうすると、 archive/ ディレクトリを作ってその中に保存ファイルを格納します。
db_purge は、通常、プロジェクトの config.xml ファイルの中の daemon 要素に記述して、デーモンとして走らせます。 db_purge は、以下のコマンドライン・オプションを持っています。
| -min_age_days N | 更新日時 mod_time が少なくとも
N 日前の ワークユニットだけを消去します。
推奨指定値は、7 程度です。 このように指定することで、 参加者は最近のリザルト[だけ]を見ることになります。 |
| -max N | 最大で N 個のワークユニットまで消去して、exit します。 |
| -max_wu_per_file N | 最大で N 個のワークユニットを、1つの保存ファイルに書き出します。 推奨指定値は 10,000 程度です。 |
| -zip | 保存ファイルを zip コマンドを使って圧縮します。 |
| -gzip | 保存ファイルを gzip コマンドを使って圧縮します。 |
| -d N | ログ出力の饒舌さを N に設定します。 (N の範囲は 1,2,3 のいずれか) |
保存ファイルは、wu_archive_TIME および result_archive_TIME という名前を持ちます。 ここで、TIME と書いた部分は、 [タイムスタンプであり、] ファイルを作成した時の Unix 時刻です。 さらに、 db_purge は 'wu_index' および 'result_index' というインデクスファイルも作成します。 このファイルは、ワークユニットとリザルトの ID を、 その保存ファイルのタイムスタンプと関連づけます。
これら両方の型のインデクス・ファイルは沢山の行からなり、その行には以下を含みます。
ID TIMEWU あるいは リザルトの ID フィールドの後に、空白が 5つ、そして その ID の値を持つ記録が見つかる保存ファイル名のタイムスタンプ部分が続きます。
リザルト保存ファイルの記録の形式は以下の通りです。
<result_archive>
<id>%d</id>
<create_time>%d</create_time>
<workunitid>%d</workunitid>
<server_state>%d</server_state>
<outcome>%d</outcome>
<client_state>%d</client_state>
<hostid>%d</hostid>
<userid>%d</userid>
<report_deadline>%d</report_deadline>
<sent_time>%d</sent_time>
<received_time>%d</received_time>
<name>%s</name>
<cpu_time>%.15e</cpu_time>
<xml_doc_in>%s</xml_doc_in>
<xml_doc_out>%s</xml_doc_out>
<stderr_out>%s</stderr_out>
<batch>%d</batch>
<file_delete_state>%d</file_delete_state>
<validate_state>%d</validate_state>
<claimed_credit>%.15e</claimed_credit>
<granted_credit>%.15e</granted_credit>
<opaque>%f</opaque>
<random>%d</random>
<app_version_num>%d</app_version_num>
<appid>%d</appid>
<exit_status>%d</exit_status>
<teamid>%d</teamid>
<priority>%d</priority>
<mod_time>%s</mod_time>
</result_archive>
<workunit_archive>
<id>%d</id>
<create_time>%d</create_time>
<appid>%d</appid>
<name>%s</name>
<xml_doc>%s</xml_doc>
<batch>%d</batch>
<rsc_fpops_est>%.15e</rsc_fpops_est>
<rsc_fpops_bound>%.15e</rsc_fpops_bound>
<rsc_memory_bound>%.15e</rsc_memory_bound>
<rsc_disk_bound>%.15e</rsc_disk_bound>
<need_validate>%d</need_validate>
<canonical_resultid>%d</canonical_resultid>
<canonical_credit>%.15e</canonical_credit>
<transition_time>%d</transition_time>
<delay_bound>%d</delay_bound>
<error_mask>%d</error_mask>
<file_delete_state>%d</file_delete_state>
<assimilate_state>%d</assimilate_state>
<hr_class>%d</hr_class>
<opaque>%f</opaque>
<min_quorum>%d</min_quorum>
<target_nresults>%d</target_nresults>
<max_error_results>%d</max_error_results>
<max_total_results>%d</max_total_results>
<max_success_results>%d</max_success_results>
<result_template_file>%s</result_template_file>
<priority>%d</priority>
<mod_time>%s</mod_time>
</workunit_archive>
最終更新時刻 00:48:05, 2006年08月12日(JST)
Copyright © 2008 University of California.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License,
Version 1.2 or any later version published by the Free Software Foundation.
Copyright © 2008 Komori Hitoshi(je2bwm at jarl.com).
Japanese translation from English web pages on BOINC.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License,
Version 1.2 or any later version published by the Free Software Foundation.