mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-02-02 10:00:38 +01:00
Implement feature #7682 : Firebird 5 - use ParallelWorkers setting from firebird.conf as default for all parallelised operations
This commit is contained in:
parent
7b130a479d
commit
9ca1372206
@ -146,6 +146,7 @@ int alice(Firebird::UtilSvc* uSvc)
|
||||
#ifdef TRUSTED_AUTH
|
||||
tdgbl->ALICE_data.ua_trusted = false;
|
||||
#endif
|
||||
tdgbl->ALICE_data.ua_parallel_workers = uSvc->getParallelWorkers();
|
||||
|
||||
// Start by parsing switches
|
||||
|
||||
|
@ -325,7 +325,7 @@ static void buildDpb(Firebird::ClumpletWriter& dpb, const SINT64 switches)
|
||||
dpb.insertByte(isc_dpb_set_db_replica, tdgbl->ALICE_data.ua_replica_mode);
|
||||
}
|
||||
|
||||
if (switches & sw_parallel_workers) {
|
||||
if (tdgbl->ALICE_data.ua_parallel_workers > 0) {
|
||||
dpb.insertInt(isc_dpb_parallel_workers, tdgbl->ALICE_data.ua_parallel_workers);
|
||||
}
|
||||
|
||||
|
@ -597,7 +597,7 @@ int gbak(Firebird::UtilSvc* uSvc)
|
||||
tdgbl->gbl_sw_old_descriptions = false;
|
||||
tdgbl->gbl_sw_mode = false;
|
||||
tdgbl->gbl_sw_skip_count = 0;
|
||||
tdgbl->gbl_sw_par_workers = 1;
|
||||
tdgbl->gbl_sw_par_workers = uSvc->getParallelWorkers();
|
||||
tdgbl->action = NULL;
|
||||
|
||||
burp_fil* file = NULL;
|
||||
|
@ -1019,7 +1019,8 @@ void create_database(BurpGlobals* tdgbl, Firebird::IProvider* provider, const TE
|
||||
}
|
||||
else
|
||||
{
|
||||
dpb.insertInt(isc_dpb_parallel_workers, tdgbl->gbl_sw_par_workers);
|
||||
if (tdgbl->gbl_sw_par_workers > 0)
|
||||
dpb.insertInt(isc_dpb_parallel_workers, tdgbl->gbl_sw_par_workers);
|
||||
dpb.insertByte(isc_dpb_shutdown, isc_dpb_shut_multi);
|
||||
}
|
||||
dpb.insertInt(isc_dpb_shutdown_delay, 0);
|
||||
|
@ -147,6 +147,7 @@ public:
|
||||
virtual void initStatus() { }
|
||||
virtual bool utf8FileNames() { return false; }
|
||||
virtual Firebird::ICryptKeyCallback* getCryptCallback() { return NULL; }
|
||||
virtual int getParallelWorkers() { return 0; };
|
||||
};
|
||||
|
||||
|
||||
|
@ -77,6 +77,7 @@ public:
|
||||
virtual unsigned int getAuthBlock(const unsigned char** bytes) = 0;
|
||||
virtual bool utf8FileNames() = 0;
|
||||
virtual Firebird::ICryptKeyCallback* getCryptCallback() = 0;
|
||||
virtual int getParallelWorkers() = 0;
|
||||
|
||||
void setDataMode(bool value)
|
||||
{
|
||||
|
@ -701,7 +701,7 @@ Service::Service(const TEXT* service_name, USHORT spb_length, const UCHAR* spb_d
|
||||
svc_username(getPool()), svc_sql_role(getPool()), svc_auth_block(getPool()),
|
||||
svc_expected_db(getPool()), svc_trusted_role(false), svc_utf8(false),
|
||||
svc_switches(getPool()), svc_perm_sw(getPool()), svc_address_path(getPool()),
|
||||
svc_command_line(getPool()),
|
||||
svc_command_line(getPool()), svc_parallel_workers(0),
|
||||
svc_network_protocol(getPool()), svc_remote_address(getPool()), svc_remote_process(getPool()),
|
||||
svc_remote_pid(0), svc_trace_manager(NULL), svc_crypt_callback(crypt_callback),
|
||||
svc_existence(FB_NEW_POOL(*getDefaultMemoryPool()) SvcMutex(this)),
|
||||
@ -731,6 +731,8 @@ Service::Service(const TEXT* service_name, USHORT spb_length, const UCHAR* spb_d
|
||||
if (svcname == "@@@")
|
||||
svc_debug = true;
|
||||
#endif
|
||||
// Could be overrided in SPB
|
||||
svc_parallel_workers = Config::getParallelWorkers();
|
||||
|
||||
// Process the service parameter block.
|
||||
ClumpletReader spb(ClumpletReader::spbList, spb_data, spb_length, spbVersionError);
|
||||
|
@ -146,6 +146,7 @@ public: // utilities interface with service
|
||||
virtual bool utf8FileNames();
|
||||
// get database encryption key transfer callback routine
|
||||
virtual Firebird::ICryptKeyCallback* getCryptCallback();
|
||||
virtual int getParallelWorkers() { return svc_parallel_workers; }
|
||||
|
||||
virtual TraceManager* getTraceManager()
|
||||
{
|
||||
@ -324,6 +325,7 @@ private:
|
||||
Firebird::string svc_perm_sw; // Switches, taken from services table and/or passed using spb_command_line
|
||||
Firebird::UCharBuffer svc_address_path;
|
||||
Firebird::string svc_command_line;
|
||||
int svc_parallel_workers;
|
||||
|
||||
Firebird::string svc_network_protocol;
|
||||
Firebird::string svc_remote_address;
|
||||
|
Loading…
Reference in New Issue
Block a user