Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the user to feed an existing configuration file #8

Closed
aveuiller opened this issue Mar 4, 2018 · 3 comments
Closed

Enable the user to feed an existing configuration file #8

aveuiller opened this issue Mar 4, 2018 · 3 comments
Milestone

Comments

@aveuiller
Copy link
Contributor

As mentioned by @fsanaulla in #6, we should propose a ConfigurationWriter implementation able to use an existing influx config file.

I think in this case the methods should have the following behaviour:

  • addStatement: Throw an UnsupportedOperationException.
  • writeFile: Return the user given config file.
  • getDataPath: The main difficulty here since we should parse the given configuration file to retrieve the data path. And even if our configuration centralize all the data in a directory, the user defined configuration may come with multiple data directory.

Maybe we should give the option to the user to set a data directory to remove on server stop? This would avoid us to parse the given configuration file.

@fsanaulla
Copy link
Contributor

@aveuiller what about specifying the path to existing config file, without parsing. See this.

@aveuiller
Copy link
Contributor Author

That's already what we are doing in the end, so yes ultimately we don't have to parse the configuration file.

Having said that, the embedded influx server is made to automatically remove the created data directory on server stop (hence the getDataPath function in the interface).
This leads to 2 possibilities: either we don't care about deletion if the user gives us an already written file, or we ask the user for the directory to remove on server stop.

I don't really like both of the solutions since it duplicate the dataPath information, already present in the configuration file. But I think we can let the user choose if he wants some file deleted at the end of the tests, for instance by providing two constructors.

What do you think about it?

aveuiller added a commit to aveuiller/embed-influxDB that referenced this issue Mar 9, 2018
aveuiller added a commit to aveuiller/embed-influxDB that referenced this issue Mar 9, 2018
@fsanaulla
Copy link
Contributor

@aveuiller I think to let a user choose when to delete data, it's a nice option.

aveuiller added a commit that referenced this issue Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants