openaire / iis

Information Inference Service of the OpenAIRE system
Apache License 2.0
20 stars 11 forks source link

Refactor AbstractDBBuilder hierarchy and check if targetDbFile needs to be explicitly set as writable #1399

Open marekhorst opened 1 year ago

marekhorst commented 1 year ago

It looks like all implementations of AbstractDBBuilder#initializeProcess() in the following subclasses:

are quite similar and it should be possible to refactor it and put most of the code in a shared method.

We should also check if targetDbFile.setWritable(true); is really needed and justified since it doesn't work for non-existing files. We should check if it is possible this file could be already created e.g. by previous execution of this process on the same datanode. This was referenced in https://github.com/openaire/iis/pull/1398#discussion_r1191070605 as a part of CR process.