Part one of refactoring the configuration / target discovery process.
This will help us support different discovery clients and eventually
different engines (database servers).
This also happens to fix a bug due to threads accessing a mutable map.
Decided against using a sync map for now in case we want to maintain a
second map going from name -> target instead of looping over the array.
The lock will let us modify both maps and show the result atomically.
Part one of refactoring the configuration / target discovery process. This will help us support different discovery clients and eventually different engines (database servers).
This also happens to fix a bug due to threads accessing a mutable map. Decided against using a sync map for now in case we want to maintain a second map going from name -> target instead of looping over the array. The lock will let us modify both maps and show the result atomically.