-
Notifications
You must be signed in to change notification settings - Fork 6
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
[GEOS-10824] Replace TestDirectoryStoreFactorySpi by a DataAccessFactoryProducer #16
[GEOS-10824] Replace TestDirectoryStoreFactorySpi by a DataAccessFactoryProducer #16
Conversation
…pefiles" datastores
…oryProducer `gs-main:tests` is used a lot, so we better don't have a DataStoreFactorySpi used for a single test case laying around always. Since `ResourcePool` calls `DataStoreUtils.getDataAccess()`, which in turn finds `DataAccessFactoryProducer` extensions, better eat our own dog food and use the extensions to provide additional data access factory producers. With this patch, `DataStoreUtils` stops calling `DataAccessFinder.getAvailableDataStores()` and that becomes the `DefaultDataAccessFactoryProducer` instead, while at the same time the `DataAccessFactoryProducer` interface extends `ExtensionPriority`.
Compilation errors:
you'll need to rebase on top of |
I like that the test gets better isolated, at the same time, the DataAccessFactoryProducer is a leftover of the GeoScript times that has not been used in years, and this patch basically makes it the primary lookup mechanism. On the other end, I don't see any significant harm in using it the way you propose. Having the default producer be at lowest priority seemed odd/wrong, but again, it seems necessary for the test to be significant, otherwise, the default stores would always get priority and the new one would not be found at all. @jodygarnett can we have a second opinion on the approach here? |
Our |
I think the provider is left over from Eclipse / uDig times where we wanted to allow another plugin system (not only FactorySPI to be able to inject functionality into GeoTools). Let me have a look at this PR; if I understand correctly you want to have a small speed up by avoiding SPI? |
Gabe can we solve this at the GeoTools level please? Something was added for the Eclipse OSGi plugin system to allow additional factories to be mixed into the library. Solving this kind of thing here in GeoServer seems really odd ... So whatever test needs
This would allow you to remove |
I did not think about it... but we'll need to make the service registry getter public, that method is now private (most finders keep their internal registries under wraps). |
That makes some sense if they are caching anything I suppose. Reading the docs:
It appears the minimal change is to add these methods to That approach is functionally equivalent, however for test cases I expect What do you think @groldan ? |
23db9c4
to
827c942
Compare
Applied the approach suggested by @jodygarnett |
gs-main:tests
is used a lot, so we better don't have a DataStoreFactorySpi used for a single test case laying around always.Since
ResourcePool
callsDataStoreUtils.getDataAccess()
, which in turn findsDataAccessFactoryProducer
extensions, better eat our own dog food and use the extensions to provide additional data access factory producers.With this patch,
DataStoreUtils
stops callingDataAccessFinder.getAvailableDataStores()
and that becomes theDefaultDataAccessFactoryProducer
instead, while at the same time theDataAccessFactoryProducer
interface extendsExtensionPriority
.