简体   繁体   English

如何同步Solr导入过程?

[英]How to synchronize Solr import processes?

How can I synchronize Solr delta import processes? 如何同步Solr delta导入过程? Several threads run delta import. 几个线程运行delta导入。 If during import run one more import then the second run will be ignored and data will not updated. 如果在导入期间再运行一次导入,则第二次运行将被忽略,数据将不会更新。

My purpose is to make waiting the second to finish the first delta import. 我的目的是等待第二次完成第一次delta进口。

Delta import runs via HTTP, so I don't know how to check when it's finished. Delta导入通过HTTP运行,所以我不知道如何检查它何时完成。

Uses: Solr 4.0, SolrJ 用途:Solr 4.0,SolrJ

You can poll the status of the dataimporthandler with the url http://host:port/solr/dataimport?command=status or even without any command since status is the default one. 您可以使用url http://host:port/solr/dataimport?command=status或甚至不使用任何命令来轮询dataimporthandler的状态,因为status是默认命令。 That way you get back some details about the dataimport process and you can find out if it is still in progress or not. 这样您就可以获得有关dataimport进程的一些详细信息,您可以查看它是否仍在进行中。 Have a look at the available commands . 看看可用的命令

It seems like you could do something with this 看起来你可以用这个做点什么

http://wiki.apache.org/solr/DataImportHandler#EventListeners http://wiki.apache.org/solr/DataImportHandler#EventListeners

If you can use that to maintain a "importInProgress" boolean flag, you could probably extend or wrap the data import handler class in your own code and return a custom response of your own to indicate that the system is busy. 如果您可以使用它来维护“importInProgress”布尔标志,您可以在您自己的代码中扩展或包装数据导入处理程序类,并返回您自己的自定义响应以指示系统正忙。 This way you could never have two imports processing. 这样你就永远不会有两个导入处理。 Polling for status as per javanna sounds like it will be subject to race conditions. 根据javanna轮询状态听起来会受到竞争条件的影响。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM