⚠️ close tagtranslators in mapreducers
⚠️ – 292c011 has breaking changes, needs to be discussed thoroughly ~🚧 – merge after #246~
Moving the ownership for the TagTranslator from MapReducer to OSHDBDatabase could solve the problem. Up to now I don't see a case where we need to have the same OSHDBDatabase connection with different TagTranslator instances.
// set explicit keytables connection for Cluster OSHDBDatabases
try(Connection keytables = DriverManager.getConnection(url);
OSHDBDatabase oshdb = new OSHDBIgnite("ignite.xml", keytables);){
// ...
}
try(Connection conn = DriverManager.getConnection(url);
OSHDBDatabase oshdb = new OSHDBJdbc(conn)){
// ...
}
The MapReducer instance gets the TagTranslator reference through the OSHDBDatabase and the OSHDBDatabase is responsible for closing the TagTranslator probably.
This also has the positive side effect that the TagTranslator could be better utilize its cache tags by executing multiple MapReducer with the some OSHDBDatabase.
related: #225 :pray: