add MySQLMetaImpl::UpdateTableFilesToIndex and set maximum_memory to default if config value = 0

Former-commit-id: f8943149b9737b2f0107308aa96a7f77acdf9ce4
pull/191/head
zhiru 2019-07-15 11:36:01 +08:00
parent 5f3533ba21
commit e950fff672
3 changed files with 1593 additions and 1677 deletions

File diff suppressed because it is too large Load Diff

View File

@ -63,7 +63,7 @@ struct Options {
size_t index_trigger_size = ONE_GB; //unit: byte
DBMetaOptions meta;
int mode = MODE::SINGLE;
float maximum_memory = 4 * ONE_GB;
size_t maximum_memory = 4 * ONE_GB;
}; // Options

View File

@ -28,11 +28,11 @@ DBWrapper::DBWrapper() {
if(index_size > 0) {//ensure larger than zero, unit is MB
opt.index_trigger_size = (size_t)index_size * engine::ONE_MB;
}
float maximum_memory = config.GetFloatValue(CONFIG_MAXMIMUM_MEMORY);
int64_t maximum_memory = config.GetInt64Value(CONFIG_MAXMIMUM_MEMORY);
if (maximum_memory > 1.0) {
opt.maximum_memory = maximum_memory * engine::ONE_GB;
}
else {
else if (maximum_memory != 0) { //if maximum_memory = 0, set it to default
std::cout << "ERROR: maximum_memory should be at least 1 GB" << std::endl;
kill(0, SIGUSR1);
}