Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Fix: Updated db config loading to account for sections #1667

Merged
merged 3 commits into from
Nov 20, 2019

Conversation

kwek20
Copy link
Contributor

@kwek20 kwek20 commented Nov 18, 2019

Description

Copy/pasting the OPTIONS file in rocksdb in place of the config file we use should work.
However previously, sections were not supported, resulting in null and default options beeing loaded.

This adds the ability to load from both a partial or a full OPTIONS file

Fixes #1624

Type of change

  • Enhancement (a non-breaking change which adds functionality)

How Has This Been Tested?

Loaded both a OPTIONS file from another location, and a small config file

Checklist:

  • My code follows the style guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Contributor

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks


private Properties section;

public synchronized Object put(Object key, Object value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add @Override annotation please

@@ -598,4 +607,31 @@ private DBOptions createOptions(String logPath, String configFile) throws IOExce

return options;
}

// https://stackoverflow.com/a/41084504/4512850 -ish
private static Map<String, Properties> parseINI(InputStream stream) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can make this public and move it to IotaIOUtils

Could be useful so why not?

@GalRogozinski GalRogozinski merged commit 1a9f506 into iotaledger:dev Nov 20, 2019
acha-bill pushed a commit to acha-bill/iri that referenced this pull request Nov 26, 2019
* Updated config loading to account for sections

* Fixed logging of errors

* Moved parseJNI to iotaIOUtils
@GalRogozinski GalRogozinski mentioned this pull request May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow users to manually tweak RocksDb Options
2 participants