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

HSEARCH-1663 Packages not exported from osgi bundles #659

Closed
wants to merge 2 commits into from

Conversation

gustavocoding
Copy link

@Sanne
Copy link
Member

Sanne commented Sep 5, 2014

Could you explain why Query is needing these exported?
Rather than exposing packages in ".impl" we might want to define a better SPI integration.

@@ -196,15 +196,20 @@
org.hibernate.search.annotations;version="${project.version}",
org.hibernate.search.backend;version="${project.version}",
org.hibernate.search.backend.spi;version="${project.version}",
org.hibernate.search.backend.impl;version="${project.version}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are adding impl packages. How comes you need them? If you do, something seems fishy imo. I tried to avoid exporting impl packages intentionally in the OSGi metadata. A single case might be arguable, but these are a lot of impl classes. What exactly is the problem here? Why are they needed?

@Sanne
Copy link
Member

Sanne commented Sep 5, 2014

Couple more things to consider:

  • without a test or a comment, these "impl" exports might get "cleaned up" without us remembering about it
  • we might rename/refactor classes and method names in such packages
  • people will not just use Maven dependencies, we're expected to be able to maintaindrop-in compatibility across minor versions

@Sanne
Copy link
Member

Sanne commented Sep 5, 2014

BTW good catch, as we wouldn't be able to fix the package structure if this came much later ;-)

@hferentschik
Copy link
Contributor

Rather than exposing packages in ".impl" we might want to define a better SPI integration.

That's what we need to do. We need do determine what is really needed from the Infinispan Query side (and maybe what not) and potentially refine the api/spi.

@hferentschik
Copy link
Contributor

Seems to me these are the culprits, right?

  • org.hibernate.search.backend.impl.WorkVisitor
  • org.hibernate.search.backend.impl.batch.DefaultBatchBackend
  • org.hibernate.search.indexes.impl.DirectoryBasedIndexManager
  • org.hibernate.search.infinispan.impl.InfinispanDirectoryProvider

@Sanne
Copy link
Member

Sanne commented Sep 5, 2014

So an alternative solution would be to:

  • promote org.hibernate.search.backend.impl.WorkVisitor to SPI
  • an interface to shield you from directly needing org.hibernate.search.backend.impl.batch.DefaultBatchBackend
  • make an SPI out of org.hibernate.search.indexes.impl.DirectoryBasedIndexManager
  • make an SPI our of org.hibernate.search.infinispan.impl.InfinispanDirectoryProvider
  • etc...

@gustavonalle maybe it would help to define the requirements by using CheckStyle in Infinispan Query to make it a violation to import packages under org.hibernate.*.impl*?

@Sanne
Copy link
Member

Sanne commented Sep 5, 2014

@hferentschik +1, but also I notice now that some more .impl packages are being exported. Do we hae a JIRA to attempt to fix that?

@hferentschik
Copy link
Contributor

Some thoughts:

If we end up exposing WorkVisitor, we should look at HSEARCH-1356 again. It's just not a visitor pattern.

What is this DefaultBatchBackend anyways? The docs says: "This is not meant to be used as a regular backend". So, if it should not be used, why is it used? Infinispan could also just have its own batch backend impl in this case.

Why would DirectoryBasedIndexManager and InfinispanDirectoryProvider be an SPI? They are not really extension points, but rather just classes which can be used. So imo we should promote them to API.

@Sanne
Copy link
Member

Sanne commented Sep 5, 2014

Why would DirectoryBasedIndexManager and InfinispanDirectoryProvider be an SPI?

The plan is to hide Directory from public API or we won't ever be able to integrate nicely with remote indexing servers. Although obviously this might be needed for many integration points.

+1 to promote InfinispanDirectoryProvider as API

@Sanne
Copy link
Member

Sanne commented Sep 5, 2014

What is this DefaultBatchBackend anyways? The docs says: "This is not meant to be used as a regular backend". So, if it should not be used, why is it used? Infinispan could also just have its own batch backend impl in this case.

It's a BATCH Backend, not a regular one. It's the one used by massindexer implementors (there are several).

Infinispan doesn't need to refer the the implementation, but it would need a way to construct one. We might need to introduce a factory on an SPI or a service.

@hferentschik
Copy link
Contributor

+1 to promote InfinispanDirectoryProvider as API

cool

@hferentschik
Copy link
Contributor

Infinispan doesn't need to refer the the implementation, but it would need a way to construct one. We might need to introduce a factory on an SPI or a service.

Ok, I guess we can sort out some details here.

@hferentschik
Copy link
Contributor

Closing this pull request. I guess we agree that a different approach needs to be taken and it seems we have a solution for most problematic cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants