简体   繁体   English

Hazelcast-在分布式地图上获取的锁未在管理中心中显示

[英]Hazelcast - Locks acquired on distributed map are NOT shown in management center

I am trying to evaluate hazelcast for distributed lock solution. 我正在尝试评估hazelcast的分布式锁定解决方案。

I am creating a hazelcast client instance from my application. 我正在从应用程序创建hazelcast客户端实例。 Then I am acquiring lock over map using IMap.tryLock method. 然后,我使用IMap.tryLock方法获取地图锁定。 During debug and from logs I am seeing that I could acquire the lock successfully. 在调试期间和从日志中,我看到我可以成功获取锁。

After successful lock acquisition I am putting an entry to map. 成功获取锁后,我将输入一个要映射的条目。

So at that time instant there is one entry and one lock in the map. 因此,在该时刻,地图中只有一个条目和一个锁。

In management center, I can see that there is only one entry in the map but can not see the lock. 在管理中心中,我可以看到地图上只有一个条目,但看不到锁。

在此处输入图片说明

Is this the expected behaviour? 这是预期的行为吗? If this is the expected behaviour what does locks mean for maps in management center? 如果这是预期的行为,那么锁对管理中心中的地图意味着什么?

It's not the expected behaviour. 这不是预期的行为。 I have tried your scenario with Hazelcast 3.9.1 and Management Center 3.9.1, it shows the lock count correctly. 我已经使用Hazelcast 3.9.1和Management Center 3.9.1尝试了您的方案,它可以正确显示锁定计数。

管理中心地图屏幕正确显示了锁计数

Which version of Hazelcast and Management Center are you using? 您正在使用哪个版本的Hazelcast and Management Center? I would advise checking if tryLock returns true - you might not be acquiring the lock correctly. 我会建议检查是否tryLock返回true -你可能无法正确获取锁。

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

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