Hello,

It seems you have some app which triggers these DIH requests. Can't you add
a precondition in that app? Before run the second DIH, check status of the
first one whether it RUNNING or IDLE.

Regards

2012/3/7 Wenca <we...@dovolenou.cz>

> Hi,
>
> I have 2 DataImportHandlers configured. The first one prepares data to
> berkeley backed cache (SOLR-2382, SOLR-2613) and the second one then
> indexes documents reading subentity data from the cache.
>
> I need some way to prevent the second handler to run if the first one is
> currently runnig to prevent reading any inconsistent data. I have't found
> any clear way to achieve this yet.
>
> I thought I can use EventListener before the second handler that will
> check whether the cache dataimport is running and if so set some flag, that
> the processing should not continue.
>
> Or is there another way to block data import handler when another one is
> running?
>
> in solrconfig.xml I have:
>
> <requestHandler name="/dataimport"
>  class="org.apache.solr.**handler.dataimport.**DataImportHandler">
>    <lst name="defaults">
>      <str name="config">db-data-config.**xml</str>
>      <str name="persistCacheBaseDir">...**</str>
>    </lst>
> </requestHandler>
>
> <requestHandler name="/dih-cache"
>  class="org.apache.solr.**handler.dataimport.**DataImportHandler">
>    <lst name="defaults">
>        <str name="config">cache-db-data-**config.xml</str>
>        <str name="writerImpl">
>                org.apache.solr.handler.**dataimport.DIHCacheWriter
>        </str>
>        <str name="persistCacheImpl">
>                org.apache.solr.handler.**dataimport.BerkleyBackedCache
>        </str>
>        <str name="persistCacheBaseDir">...**</str>
>        <str name="persistCacheName">data_**cache</str>
>        <str name="cachePk">id</str>
>    </lst>
> </requestHandler>
>
> Thank wenca
>



-- 
Sincerely yours
Mikhail Khludnev
Lucid Certified
Apache Lucene/Solr Developer
Grid Dynamics

<http://www.griddynamics.com>
 <mkhlud...@griddynamics.com>

Reply via email to