From 760e55d90707cfe0f5cf898ece66bd0ef841476e Mon Sep 17 00:00:00 2001 From: Lana Alber Date: Sun, 12 Sep 2004 00:49:38 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4187 --- checkin_notes | 21 +++++++++++++++++++++ db/db_base.C | 9 +++++++++ db/db_base.h | 1 + sched/Makefile.am | 4 ++++ sched/Makefile.in | 30 ++++++++++++++++++++++-------- 5 files changed, 57 insertions(+), 8 deletions(-) diff --git a/checkin_notes b/checkin_notes index 51fffc6555..6aa60edc3e 100755 --- a/checkin_notes +++ b/checkin_notes @@ -17291,3 +17291,24 @@ Rom 10 Sept 2004 clientgui/ MainDocument.cpp, .h stdwx.h + + +Lana 26 August 2004 + - Installation script provides better default daemons by starting + transitioner, feeder and file deleter deamons automatically + + tools/ + make_project + +Lana 11 Sept 2004 + - Created DB Purger that archives "DONE" workunits and their + results into XML archive files. Deletes those records from the database. + Added delete_from_db function to DB_BASE + + sched/ + db_purge.C + + db/ + db_base.h + db_base.C + diff --git a/db/db_base.C b/db/db_base.C index ade8a4fee0..a08423365a 100644 --- a/db/db_base.C +++ b/db/db_base.C @@ -108,6 +108,15 @@ int DB_BASE::update_field(char* clause) { return db->do_query(query); } +// delete record +// +int DB_BASE::delete_from_db() { + char vals[MAX_QUERY_LEN], query[MAX_QUERY_LEN]; + db_print(vals); + sprintf(query, "delete from %s where id=%d", table_name, get_id()); + return db->do_query(query); +} + int DB_BASE::get_field_int(char* field, int& val) { char query[MAX_QUERY_LEN]; int retval; diff --git a/db/db_base.h b/db/db_base.h index 6fd42daa1a..4edceec1a7 100644 --- a/db/db_base.h +++ b/db/db_base.h @@ -82,6 +82,7 @@ public: int insert_batch(const char*); int update(); int update_field(char*); + int delete_from_db(); int get_field_int(char*, int&); int lookup_id(int id); int lookup(char*); diff --git a/sched/Makefile.am b/sched/Makefile.am index 71919a6cd3..c19eb694bd 100644 --- a/sched/Makefile.am +++ b/sched/Makefile.am @@ -6,6 +6,7 @@ noinst_PROGRAMS = \ cgi \ feeder \ db_dump \ + db_purge \ file_deleter \ file_upload_handler \ make_work \ @@ -90,6 +91,9 @@ sample_dummy_assimilator_DEPENDENCIES = $(LIB_SCHED) db_dump_SOURCES = db_dump.C db_dump_DEPENDENCIES = $(LIB_SCHED) +db_purge_SOURCES = db_purge.C +db_purge_DEPENDENCIES = $(LIB_SCHED) + update_stats_SOURCES = update_stats.C update_stats_DEPENDENCIES = $(LIB_SCHED) diff --git a/sched/Makefile.in b/sched/Makefile.in index 49b1f1856b..c693d90cf1 100644 --- a/sched/Makefile.in +++ b/sched/Makefile.in @@ -179,6 +179,7 @@ noinst_PROGRAMS = \ cgi \ feeder \ db_dump \ + db_purge \ file_deleter \ file_upload_handler \ make_work \ @@ -267,6 +268,9 @@ sample_dummy_assimilator_DEPENDENCIES = $(LIB_SCHED) db_dump_SOURCES = db_dump.C db_dump_DEPENDENCIES = $(LIB_SCHED) +db_purge_SOURCES = db_purge.C +db_purge_DEPENDENCIES = $(LIB_SCHED) + update_stats_SOURCES = update_stats.C update_stats_DEPENDENCIES = $(LIB_SCHED) @@ -348,8 +352,9 @@ am_libsched_a_OBJECTS = sched_shmem.$(OBJEXT) sched_util.$(OBJEXT) \ libsched_a_OBJECTS = $(am_libsched_a_OBJECTS) EXTRA_PROGRAMS = fcgi$(EXEEXT) noinst_PROGRAMS = cgi$(EXEEXT) feeder$(EXEEXT) db_dump$(EXEEXT) \ - file_deleter$(EXEEXT) file_upload_handler$(EXEEXT) \ - make_work$(EXEEXT) show_shmem$(EXEEXT) transitioner$(EXEEXT) \ + db_purge$(EXEEXT) file_deleter$(EXEEXT) \ + file_upload_handler$(EXEEXT) make_work$(EXEEXT) \ + show_shmem$(EXEEXT) transitioner$(EXEEXT) \ message_handler$(EXEEXT) update_stats$(EXEEXT) \ sample_dummy_assimilator$(EXEEXT) \ sample_bitwise_validator$(EXEEXT) \ @@ -368,6 +373,10 @@ am_db_dump_OBJECTS = db_dump.$(OBJEXT) db_dump_OBJECTS = $(am_db_dump_OBJECTS) db_dump_LDADD = $(LDADD) db_dump_LDFLAGS = +am_db_purge_OBJECTS = db_purge.$(OBJEXT) +db_purge_OBJECTS = $(am_db_purge_OBJECTS) +db_purge_LDADD = $(LDADD) +db_purge_LDFLAGS = am_delete_file_OBJECTS = delete_file.$(OBJEXT) delete_file_OBJECTS = $(am_delete_file_OBJECTS) delete_file_LDFLAGS = @@ -453,7 +462,7 @@ am__depfiles_maybe = depfiles @AMDEP_TRUE@ ./$(DEPDIR)/backend_lib.Po ./$(DEPDIR)/base64.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/boinc_db.Po ./$(DEPDIR)/crypt.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/db_base.Po ./$(DEPDIR)/db_dump.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/delete_file.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/db_purge.Po ./$(DEPDIR)/delete_file.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/fcgi-backend_lib.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/fcgi-base64.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/fcgi-boinc_db.Po \ @@ -508,17 +517,18 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(libsched_a_SOURCES) $(cgi_SOURCES) $(db_dump_SOURCES) \ - $(delete_file_SOURCES) $(fcgi_SOURCES) $(feeder_SOURCES) \ - $(file_deleter_SOURCES) $(file_upload_handler_SOURCES) \ - $(get_file_SOURCES) $(make_work_SOURCES) \ - $(message_handler_SOURCES) $(request_file_list_SOURCES) \ + $(db_purge_SOURCES) $(delete_file_SOURCES) $(fcgi_SOURCES) \ + $(feeder_SOURCES) $(file_deleter_SOURCES) \ + $(file_upload_handler_SOURCES) $(get_file_SOURCES) \ + $(make_work_SOURCES) $(message_handler_SOURCES) \ + $(request_file_list_SOURCES) \ $(sample_bitwise_validator_SOURCES) \ $(sample_dummy_assimilator_SOURCES) \ $(sample_trivial_validator_SOURCES) $(send_file_SOURCES) \ $(show_shmem_SOURCES) $(transitioner_SOURCES) \ $(update_stats_SOURCES) $(wu_check_SOURCES) DIST_COMMON = $(top_srcdir)/Makefile.incl Makefile.am Makefile.in -SOURCES = $(libsched_a_SOURCES) $(cgi_SOURCES) $(db_dump_SOURCES) $(delete_file_SOURCES) $(fcgi_SOURCES) $(feeder_SOURCES) $(file_deleter_SOURCES) $(file_upload_handler_SOURCES) $(get_file_SOURCES) $(make_work_SOURCES) $(message_handler_SOURCES) $(request_file_list_SOURCES) $(sample_bitwise_validator_SOURCES) $(sample_dummy_assimilator_SOURCES) $(sample_trivial_validator_SOURCES) $(send_file_SOURCES) $(show_shmem_SOURCES) $(transitioner_SOURCES) $(update_stats_SOURCES) $(wu_check_SOURCES) +SOURCES = $(libsched_a_SOURCES) $(cgi_SOURCES) $(db_dump_SOURCES) $(db_purge_SOURCES) $(delete_file_SOURCES) $(fcgi_SOURCES) $(feeder_SOURCES) $(file_deleter_SOURCES) $(file_upload_handler_SOURCES) $(get_file_SOURCES) $(make_work_SOURCES) $(message_handler_SOURCES) $(request_file_list_SOURCES) $(sample_bitwise_validator_SOURCES) $(sample_dummy_assimilator_SOURCES) $(sample_trivial_validator_SOURCES) $(send_file_SOURCES) $(show_shmem_SOURCES) $(transitioner_SOURCES) $(update_stats_SOURCES) $(wu_check_SOURCES) all: all-am @@ -563,6 +573,9 @@ cgi$(EXEEXT): $(cgi_OBJECTS) $(cgi_DEPENDENCIES) db_dump$(EXEEXT): $(db_dump_OBJECTS) $(db_dump_DEPENDENCIES) @rm -f db_dump$(EXEEXT) $(CXXLINK) $(db_dump_LDFLAGS) $(db_dump_OBJECTS) $(db_dump_LDADD) $(LIBS) +db_purge$(EXEEXT): $(db_purge_OBJECTS) $(db_purge_DEPENDENCIES) + @rm -f db_purge$(EXEEXT) + $(CXXLINK) $(db_purge_LDFLAGS) $(db_purge_OBJECTS) $(db_purge_LDADD) $(LIBS) delete_file$(EXEEXT): $(delete_file_OBJECTS) $(delete_file_DEPENDENCIES) @rm -f delete_file$(EXEEXT) $(CXXLINK) $(delete_file_LDFLAGS) $(delete_file_OBJECTS) $(delete_file_LDADD) $(LIBS) @@ -671,6 +684,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/db_base.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/db_dump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/db_purge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delete_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcgi-backend_lib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcgi-base64.Po@am__quote@