After a lot of debugging I found out that you cannot extend Solr/Lucene
classes and override package protected methods, it will silently us the
super class' method.

For a little context, I came across this issue because a client requires
some slightly modified merge logic within the DistributedUpdateProcessor.
In prior versions I was able to copy the entire processor and modify the
document merging section, unfortunately with the upgrade to 4.9 SOLR-5468
introduced an inner class (RequestReplicationTracker) which is required in
the SolrCmdDistributor - the inner class has a private constructor which
makes it impossible to build the required class from outside that specific
processor. So, I decided to just extend package protected
getUpdatedDocument method which resulted in my unit tests passing (since
the custom plugin + solr code are run from the same classpath), it was
discovered that the overridden code wasn't actually being used when
actually deployed.

For a quick fix, I simply converted the document merging method from
package protected to a standard protected method declaration and patched it
into the solr-core jar & solr war.

Has anyone happened to come across this and know if there is a fix for
extending & overriding package protected methods?

As a side note, I would like to open a ticket to either make the document
merging method override-able or ideally make the merge logic pluggable.


-Steve

Reply via email to