cmu-db / peloton

The Self-Driving Database Management System
http://pelotondb.io
Apache License 2.0
2.03k stars 624 forks source link

Settings refactoring #1432

Open ksaito7 opened 6 years ago

ksaito7 commented 6 years ago

This PR refactors setting stuff in order to enable checkpoint manager to recover setting values. In addition, added some convenient functions.

- Fix Points of SettingsManager

  1. Change All set functions to non-static, and move all set/get functions to public.
  2. Add txn argument into set functions in order that a caller of set functions can manage a necessary transaction by itself.
  3. Add set_default argument into set functions. If this flag argument is true, then the default value is updated in addition to updating the setting value.
  4. Add Reset public function to reset the setting value to default value.
  5. Add UpdateSettingListFromCatalog() public function to update setting values in the manager from catalog for checkpoints.
  6. Add/Modify two catalog management private functions: InsertCatalog(), UpdateCatalog().

- Fix Points of SettingsCatalog

  1. Add SettingsCatalogEntry class to acquire all setting information from catalog
  2. Add GetSettingsCatalogEntry() and GetSettingsCatalogEntries() functions. *These function names are temporary. The permanent names depend on discussion in PR #1414.
  3. Delete other get functions.
  4. Add UpdateSettingValue() function to update a setting value and a default value.

- Related Issues

  1. Issues #1424
coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.1%) to 76.39% when pulling ebc71addd5bf95063e914335e2c2348e9fd89f7e on ksaito7:settings_refactor into 898219f9fe6e1d2b6901ea3797caac5c93850213 on cmu-db:master.

ksaito7 commented 6 years ago

This last commit isn't related to this PR directly, but I did it because a part of index names of constraints were weird. (related to #1415 we worked for last time)