解释 Lucene.NET 锁定

发布于 2024-12-08 02:23:03 字数 386 浏览 3 评论 0原文

我正在为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

神经暖 2024-12-15 02:23:03

是的,这就足够了。 参见这个例子

如果您还不知道这些 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文