From: Kern Sibbald Date: Mon, 17 Sep 2007 13:27:55 +0000 (+0000) Subject: kes Begin implemention of Optimize Job Scheduling. X-Git-Tag: Release-7.0.0~5663 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=29c7a12fd2cc7fbab1bc864d6b04c0733bae15ea;p=bacula%2Fbacula kes Begin implemention of Optimize Job Scheduling. kes Implement restore callback that Dirk and I agreed on for bat restore. kes Fix SQL Catalog logging which broke with new db_escape_string calling sequence. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5582 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index 475df3cdf3..870a32120a 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -293,6 +293,7 @@ RES_ITEM job_items[] = { {"prunefiles", store_bool, ITEM(res_job.PruneFiles), 0, ITEM_DEFAULT, false}, {"prunevolumes",store_bool, ITEM(res_job.PruneVolumes), 0, ITEM_DEFAULT, false}, {"enabled", store_bool, ITEM(res_job.enabled), 0, ITEM_DEFAULT, true}, + {"optimizejobscheduling",store_bool, ITEM(res_job.OptimizeJobScheduling), 0, ITEM_DEFAULT, false}, {"spoolattributes",store_bool, ITEM(res_job.SpoolAttributes), 0, ITEM_DEFAULT, false}, {"spooldata", store_bool, ITEM(res_job.spool_data), 0, ITEM_DEFAULT, false}, {"rerunfailedlevels", store_bool, ITEM(res_job.rerun_failed_levels), 0, ITEM_DEFAULT, false}, diff --git a/bacula/src/dird/dird_conf.h b/bacula/src/dird/dird_conf.h index 03d50eb706..2df2d6ad90 100644 --- a/bacula/src/dird/dird_conf.h +++ b/bacula/src/dird/dird_conf.h @@ -392,6 +392,7 @@ public: bool PreferMountedVolumes; /* Prefer vols mounted rather than new one */ bool write_part_after_job; /* Set to write part after job in SD */ bool enabled; /* Set if job enabled */ + bool OptimizeJobScheduling; /* Set if we should optimize Job scheduling */ MSGS *messages; /* How and where to send messages */ SCHED *schedule; /* When -- Automatic schedule */ diff --git a/bacula/src/lib/message.c b/bacula/src/lib/message.c index 915c3d9007..620aa32b38 100644 --- a/bacula/src/lib/message.c +++ b/bacula/src/lib/message.c @@ -658,7 +658,7 @@ void dispatch_message(JCR *jcr, int type, time_t mtime, char *msg) int len = strlen(msg) + 1; esc_msg = check_pool_memory_size(esc_msg, len*2+1); - p_sql_escape(esc_msg, msg, len); + p_sql_escape(jcr, jcr->db, esc_msg, msg, len); bstrutime(dt, sizeof(dt), mtime); Mmsg(cmd, "INSERT INTO Log (JobId, Time, LogText) VALUES (%s,'%s','%s')", diff --git a/bacula/src/lib/message.h b/bacula/src/lib/message.h index 191e02c42b..476d3611a9 100644 --- a/bacula/src/lib/message.h +++ b/bacula/src/lib/message.h @@ -146,8 +146,9 @@ void Jmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...); void Qmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...); bool get_trace(void); +struct B_DB; typedef void (*sql_query)(JCR *jcr, const char *cmd); -typedef void (*sql_escape)(char *snew, char *old, int len); +typedef void (*sql_escape)(JCR *jcr, B_DB* db, char *snew, char *old, int len); extern DLL_IMP_EXP sql_query p_sql_query; extern DLL_IMP_EXP sql_escape p_sql_escape; diff --git a/bacula/src/qt-console/console/console.cpp b/bacula/src/qt-console/console/console.cpp index 0c50f13579..fd4273b3b6 100644 --- a/bacula/src/qt-console/console/console.cpp +++ b/bacula/src/qt-console/console/console.cpp @@ -689,6 +689,13 @@ int Console::read() if (mainWin->m_commDebug) Pmsg0(000, "RUN CMD\n"); new runCmdPage(); break; + case BNET_START_RTREE: + if (mainWin->m_commDebug) Pmsg0(000, "START RTREE CMD\n"); + new restorePage(); + break; + case BNET_END_RTREE: + if (mainWin->m_commDebug) Pmsg0(000, "END RTREE CMD\n"); + break; case BNET_ERROR_MSG: if (mainWin->m_commDebug) Pmsg0(000, "ERROR MSG\n"); m_sock->recv(); /* get the message */ diff --git a/bacula/src/qt-console/restore/prerestore.cpp b/bacula/src/qt-console/restore/prerestore.cpp index cc13480ac3..379bf483fb 100644 --- a/bacula/src/qt-console/restore/prerestore.cpp +++ b/bacula/src/qt-console/restore/prerestore.cpp @@ -170,17 +170,19 @@ void prerestorePage::okButtonPushed() if (mainWin->m_commandDebug) { Pmsg1(000, "preRestore command \'%s\'\n", cmd.toUtf8().data()); } - consoleCommand(cmd); + m_console->write_dir(cmd.toUtf8().data()); +// consoleCommand(cmd); + /* Note, do not turn notifier back on here ... */ if (selectFilesRadio->isChecked()) { setConsoleCurrent(); - new restorePage(); +// new restorePage(); closeStackPage(); } else { - m_console->notify(true); closeStackPage(); mainWin->resetFocus(); } + m_console->notify(true); } diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 3e8c0d755c..214b347421 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -1,6 +1,12 @@ Technical notes on version 2.3 General: +17Sep07 +kes Begin implemention of Optimize Job Scheduling. +kes Implement restore callback that Dirk and I agreed on for bat + restore. +kes Fix SQL Catalog logging which broke with new db_escape_string + calling sequence. 14Sep07 kes Fix bacula_cats.def for new db_escape_string(). kes Increase size of name string when FD making connection to SD.