解释 Lucene.NET 锁定
我正在为 Lucene.NET 编写一个数据库支持的 Directory
实现(项目page on BitBucket),我对如何使用锁定有点不知所措。
当然,锁对于可靠的索引和搜索至关重要,但我不确定我做的事情是否正确。更具体地说,锁只是用于序列化对索引的访问,以便写入顺序发生,还是有更复杂的东西?
例如,这是
insert into [Lock] (LockName) values (@lockName)
然后检查该行是否仍然存在足以使该实现可靠?
I'm writing a database-backed Directory
implementation for Lucene.NET (project page on BitBucket) and I'm a bit at a loss about what to do with locking.
Naturally, locks are essential for reliable indexing and searching, but I'm not sure I'm doing things correctly. More specifically, are locks used just to serialize access to index so that writes are happening sequentially or is there something more complex to it?
For example, is this
insert into [Lock] (LockName) values (@lockName)
and then checking if this row is still there enough for this implementation to be reliable?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这就足够了。 参见这个例子
如果您还不知道这些 Lucene Directory 实现:
用于 Lucene.Net 的 Azure 库
Lucene Oracle 数据盒
Yes it is enough. See this example
In case, you haven't already known these Lucene Directory implementations:
Azure Library for Lucene.Net
Lucene Oracle Data Cartridge