- Added the above DB change to schema.sql

- Omit the "after" clause from update.
- Web: add missing arg; fixes #749
- server: more --help additions

svn path=/trunk/boinc/; revision=16136
This commit is contained in:
David Anderson 2008-10-06 00:18:36 +00:00
parent 19ac33738a
commit 33ad1b3d40
7 changed files with 60 additions and 1492 deletions

1417
Doxyfile

File diff suppressed because it is too large Load Diff

View File

@ -8049,7 +8049,7 @@ David 4 Oct 2008
client/*.h
Janus 5 Oct 2008
Janus 5 Oct 2008
- Projects can override the login form by defining their own replacement
print_login_form_aux/print_login_form in their project.inc file
- Fixed a case of bad coding where variables where called "1", "2"... instead
@ -8064,17 +8064,33 @@ Janus 5 Oct 2008
html/
inc/
forum.inc
util.inc
forum.inc
util.inc
ops/
db_update.php
manage_special_users_action.php
manage_special_users.php
db_update.php
manage_special_users_action.php
manage_special_users.php
user/
img/
75pct_white.png
edit_forum_preferences_action.php
edit_forum_preferences_form.php
white.css
forum_forum.php
img/
75pct_white.png
edit_forum_preferences_action.php
edit_forum_preferences_form.php
white.css
forum_forum.php
David 5 Oct 2008
- Added the above DB change to schema.sql
- Omit the "after" clause from update.
- Web: add missing arg; fixes #749
- server: more --help additions
db/
schema.sql
sched/
db_purge.cpp
db_dump.cpp
html/
ops/
db_update.php
inc/
host.inc

View File

@ -443,6 +443,7 @@ create table forum_preferences (
-- 0 = no email
-- 1 = email per event
-- 2 = digest email
highlight_special tinyint not null default 1,
primary key (userid)
) engine=MyISAM;

View File

@ -331,12 +331,12 @@ function os_compatible($host1, $host2) {
// that their time intervals are disjoint.
// So the CPU/OS checks don't have to be very strict.
//
function hosts_compatible($host1, $host2, $detail) {
function hosts_compatible($host1, $host2, $show_detail) {
// skip disjoint-time check if one host or other has no credit
//
if ($host1->total_credit && $host2->total_credit) {
if (!times_disjoint($host1, $host2)) {
if ($detail) {
if ($show_detail) {
$c1 = date_str($host1->create_time);
$r1 = date_str($host1->rpc_time);
$c2 = date_str($host2->create_time);
@ -347,13 +347,13 @@ function hosts_compatible($host1, $host2, $detail) {
}
}
if (!os_compatible($host1, $host2)) {
if ($detail) {
if ($show_detail) {
echo "<br>Host $host2->id has incompatible OS: ($host1->os_name, $host2->os_name)\n";
}
return false;
}
if (!cpus_compatible($host1, $host2)) {
if ($detail) {
if ($show_detail) {
echo "<br>Host $host2->id: CPU not compatible ($host1->p_vendor $host1->p_model, $host2->p_vendor $host2->p_model)\n";
}
return false;
@ -423,7 +423,7 @@ function merge_hosts($old_host, $new_host) {
if ($old_host->id == $new_host->id) {
return "same host";
}
if (!hosts_compatible($old_host, $new_host)) {
if (!hosts_compatible($old_host, $new_host, false)) {
return "Can't merge host $old_host->id into $new_host->id - they're incompatible";
}

View File

@ -616,7 +616,7 @@ function update_7_28_2008() {
}
function update_10_05_2008(){
do_query("ALTER TABLE `forum_preferences` ADD `highlight_special` TINYINT DEFAULT '1' NOT NULL AFTER `hide_signatures`");
do_query("alter table forum_preferences add highlight_special tinyint default '1' not null");
}
// modify the following to call the function you want.

View File

@ -15,36 +15,8 @@
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// db_dump: dump database views in XML format
//
// usage: db_dump [-d n] -dump_spec file
// -d debug level (1,2,3)
//
// dump_spec file:
// <boinc_db_dump_spec>
// <output_dir>x</output_dir>
// <final_output_dir>x</final_output_dir>
// [ <archive_dir>X</archive_dir> ]
// <enumeration>
// <table>user</table>
// <filename>x</filename>
// <sort>x</sort> x = id, total_credit, expavg_credit
// <output>
// [<recs_per_file>n</recs_per_file>]
// [<detail/>]
// [<compression>x</compression> ] x = zip or gzip
// </output>
// ...
// </enumeration>
// ...
// </boinc_db_dump_spec>
// output_dir is temp directory (usually ../html/stats_tmp)
// final_out_dir is what to rename this to when done (usually ../html/stats)
// (this is to avoid exporting incomplete stats)
// archive_dir: if present, when done, move old final_out_dir
// to archive_dir/stats_DATE
// Otherwise rename old final_out_dir to final_out_dir_DATE
/// db_dump: dump database views in XML format
// see http://boinc.berkeley.edu/trac/wiki/DbDump
// Note: this program is way more configurable than it needs to be.
// All projects export stats in the same format,

View File

@ -29,31 +29,6 @@
// where TIME is the time it was created.
// In addition there are index files associating each WU and result ID
// with the timestamp of the file it's in.
//
// Options:
//
// -min_age_days n purge WUs with mod_time at least N days in the past
// -max n purge at most N WUs
// -one_pass go until nothing left to purge, then exit
// default: keep scanning indefinitely
// -max_wu_per_file n write at most N WUs to an archive file
// The file is then closed and another file is opened.
// This can be used to get a series of small files
// instead of one huge file.
// -zip
// compress output files using zip. If used with
// -max_wu_per_file then the files get compressed after
// being closed. In any case the files are compressed
// when db_purge exits on a signal.
// -gzip
// compress output files using gzip. If used with
// -max_wu_per_file then the files get compressed after
// being closed. In any case the files are compressed
// when db_purge exits on a signal.
// -sleep N // when done with a pass of purging the DB, sleep
// for N seconds before the next pass. Default
// value is 600 seconds.
#include "config.h"
#include <cstdio>
@ -565,12 +540,31 @@ bool do_pass() {
}
}
void usage(char** argv) {
fprintf(stderr,
"Purge workunit and result records that are no longer needed.\n\n"
"Usage: %s [options]\n"
" [-d N] Set verbosity level (1, 2, 3=most verbose)\n"
" [-min_age_days N] Purge Wus w/ mod time at least N days ago\n"
" [-max N] Purge at more N WUs\n"
" [-zip] Compuress output files using zip\n"
" [-gzip] Compuress output files using gzip\n"
" [-no_archive] Don't write output files, just purge\n"
" [-max_wu_per_file N] Write at most N WUs per output file\n"
" [-sleep N] Sleep N sec after DB scan\n"
" [-one_pass] Make one DB scan, then exit\n",
argv[0]
);
exit(0);
}
int main(int argc, char** argv) {
int retval;
bool one_pass = false;
int i;
int sleep_sec = 600;
check_stop_daemons();
for (i=1; i<argc; i++) {
if (!strcmp(argv[i], "-one_pass")) {
one_pass = true;
@ -595,13 +589,15 @@ int main(int argc, char** argv) {
"Unreasonable value of sleep interval: %d seconds\n",
sleep_sec
);
exit(1);
usage(argv);
}
} else if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")) {
usage(argv);
} else {
log_messages.printf(MSG_CRITICAL,
"Unrecognized arg: %s\n", argv[i]
);
exit(1);
usage(argv);
}
}