dca_interface  6.3.4
dca::DbConnectionCustomData Struct Reference

#include <base_classes.h>

Detailed Description

Class to store the Database connection data for a custom database.

Fill out this structure if you are using a custom DbConnection.

Custom databases are saved as a single file in the given specified configuration dir.

When using a custom database, update files will be saved at a specified interval, and contain all the changes (using the maintenance interface) that have been made since the last update file was written. The custom database will be merged at regular intervals with all existing update files and replaced by the merged data.

The start time and frequency of the database merge process can be determined when creating a DbConnection by setting the parameters in this structure. The default database merge frequency is every two hours.

All database changes (made by using the maintenance interface) will also be immediately added to the database cache. This cache has a configurable maximum number of entries that should not be exceeded. If this count is exceeded you will need to recreate the DbConnection that is connected with you custom database.

Note
You can use a single DbConnection instance for multiple UrlClassifiers and for the maintenance interface as well. If you create multiple DbConnections that refer to the same custom database folder (configDir) only the parameters of the first instance are used!
See also
dca::UpdateModule::performUpdate(), dca::DcaInstance::schedule()

Definition at line 715 of file base_classes.h.

Public Attributes

unsigned int cacheMaxEntries
 This is the maximum number of entries the cache can be filled up with (by using the maintenance interface) The minimum is value 1024, if left at 0 the default value (32000) will be used.
 
unsigned int cacheEntryExpirationMinutes
 The cache is also used to cache URL requests. This setting defines when an entry will be considered as obsolete. This setting does not have any effect on the maintenance interface or cacheMaxEntries. Default value is 60 minutes.
 
unsigned int updateFileWriteIntervalMinutes
 This is the interval (specified in minutes) in which the modifications made to the database are saved to an update file. Minimum is one minute, if left at 0 the default value of 10 minutes will be used.
 
unsigned int dbUpdateIntervalMinutes
 This is the interval of the database merge process, specified in minutes. Minimum is one minute, when left at 0 the default value of 2*60 (2 hours) is used.
 
time_t dbUpdateStartLocalTime
 The start time for the database merge process. If left at 0, the current time plus a small random offset is used.
 
std::string configDir
 Specifies the complete folder path where the custom database is located, or the folder in which it should be created.
 
unsigned int updateFileWriteMaxEntries
 The maximum number of entries. If exceeded, the database will be saved to an update file. Minimum is 1000, maximum is 25000000, if left at 0 or less than minimum or larger than maximum, the default value of 500000 entries will be used.
 

The documentation for this struct was generated from the following file: