- data archival stuff

svn path=/trunk/boinc/; revision=25128
This commit is contained in:
David Anderson 2012-01-23 08:04:41 +00:00
parent f4b8f357bb
commit 86dd953c06
4 changed files with 23 additions and 10 deletions

View File

@ -1,10 +1,16 @@
all: ssim vda vda_transitioner
CCFLAGS = -I /usr/include/mysql -I ../db -I ../lib
LIBS = ../sched/libsched.a ../lib/libboinc.a
MYSQL_LIBS = -L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl
vda_lib.o: vda_lib.cpp vda_lib.h
g++ -c vda_lib.cpp
ssim: ssim.cpp des.h vda_lib.o
g++ -g -Wall -o ssim ssim.cpp vda_lib.o
vda_transitioner: vda_transitioner.cpp vda_lib.o
g++ -g -Wall -o vda_transitioner vda_transitioner.cpp vda_lib.o
g++ -g $(CCFLAGS) -Wall -o vda_transitioner vda_transitioner.cpp vda_lib.o $(LIBS) $(MYSQL_LIBS)
vda: vda.cpp vda_lib.o
g++ -g -Wall -o vda vda.cpp vda_lib.o
g++ -g $(CCFLAGS) -Wall -o vda vda.cpp vda_lib.o $(LIBS) $(MYSQL_LIBS)

View File

@ -41,7 +41,7 @@
#include <set>
#include "des.h"
#include "vda.h"
#include "vda_lib.h"
using std::set;

View File

@ -18,7 +18,7 @@
#include <stdio.h>
#include <string.h>
#include "vda.h"
#include "vda_lib.h"
int POLICY::parse(const char* filename) {
int n;

View File

@ -17,6 +17,8 @@
#include "boinc_db.h"
#include "util.h"
void handle_file(VDA_FILE& vf) {
}
@ -24,28 +26,33 @@ bool scan_files() {
DB_VDA_FILE vf;
bool found = false;
while (vda_file.enum("need_update<>0")) {
while (vf.enumerate("need_update<>0")) {
found = true;
handle_file(vf);
}
return found;
}
void handle_chunk(VDA_CHUNK_HOST* ch) {
void handle_chunk(VDA_CHUNK_HOST& ch) {
}
void scan_chunks() {
bool scan_chunks() {
DB_VDA_CHUNK_HOST ch;
char buf[256];
bool found = false;
double now = dtime();
while (ch.enum("transition_time < %f")) {
sprintf(buf, "transition_time < %f", dtime());
while (ch.enumerate(buf)) {
found = true;
handle_chunk(ch);
}
return found;
}
int main(int argc, char** argv) {
while(1) {
bool action = scan_files();
action != scan_chunks();
action |= scan_chunks();
if (!action) boinc_sleep(5.);
}
}