lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject RE: Solr plugin component resource cleanup?
Date Tue, 03 Jan 2012 17:55:54 GMT

: This works fine for a SearchComponent, but if I try this for a QParserPlugin I get the following:
: 
:     [junit] org.apache.solr.common.SolrException: Invalid 'Aware' 
: object: org.apache.solr.mcf.ManifoldCFQParserPlugin@18941f7 -- 
: org.apache.solr.util.plugin.SolrCoreAware must be an instance of: 

...that seems like an orthoginal problem to what i suggested...

: take a look at the "CloseHook" API and SolrCore.addCloseHook(...)
: 
: : Is there a preferred time/manner for a Solr component (e.g. a
: : SearchComponent) to clean up resources that have been allocated during
: : the time of its existence, other than via a finalizer?  There seems to


...any object can call SolrCore.addCloseHook, regardless of wether or not 
that class implements SolrCoreAware (two ideas are unrelated).  The list 
of classes that implement SolrCoreAware has always been limited  
to prevent circular lifecycle problems.

what type of resouces are you trying to clean up?  are they really 
specific to the initialization of the QParserPlugin (which shoulds *VERY* 
unusual), or to the QParsers that it creates? because you can always call 
addCloseHook in the createParser method.



-Hoss

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message