hazelcast

In Hazelcast, is it possible to use clustered locks that do _not_ care about the local thread that performs the lock/unlock operations?

倾然丶 夕夏残阳落幕 提交于 2019-12-10 09:31:55
问题 Hazelcast locks (such as http://www.hazelcast.com/docs/1.9.4/manual/multi_html/ch02s07.html) as I understand it behave the same way as the Java concurrency primitives but across the cluster. The makes it possible to use to synchronize between thread in the local process as well as over the cluster. However, is there any way I can opt out of this behaviour? In my current project, I need a way of coordinating unique ownership of a resource across the cluster but want to aquire and release this

How do you create a Hazelcast instance embedded in-process/in-memory, without networking?

99封情书 提交于 2019-12-09 15:15:54
问题 In my unit tests, I want to create an embedded (in-process/in-memory) Hazelcast instance that does not attempt to start or perform any networking operations at all. How do I do this? For example: Config config = new Config(); // what goes here? HazelcastInstance inProcessOnly = Hazelcast.newHazelcastInstance(config); 回答1: FWIW I have created a test in Hazelcast 3.6.1 and programmatically disabled the network cluster using the following code in the constructor. This creates a standalone server

Hazelcast Spring integration issue

只谈情不闲聊 提交于 2019-12-09 06:04:26
I am integrating Hazelcast and Spring. Its giving me error regarding the Schema. Checked the spring and hazelcast version, still not sure why. Spring Version : 3.2.8 HazelCast Version : 3.5 My applicationContext: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:hz="http://www.hazelcast.com/schema/spring" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org

Hazelcast cluster over AWS using Docker

蓝咒 提交于 2019-12-08 23:14:29
Hi am trying to configure hazelcast cluster over AWS. I am running hazelcast in docker container and using --net=host to use host network config. when i look at hazelcast logs, I see [172.17.0.1]:5701 [herald] [3.8] Established socket connection between /[node2]:5701 and /[node1]:47357 04:24:22.595 [hz._hzInstance_1_herald.IO.thread-out-0] DEBUG c.h.n.t.SocketWriterInitializerImpl - [172.17.0.1]:5701 [herald] [3.8] Initializing SocketWriter WriteHandler with Cluster Protocol 04:24:22.595 [hz._hzInstance_1_herald.IO.thread-in-0] WARN c.h.nio.tcp.TcpIpConnectionManager - [172.17.0.1]:5701

Spring Boot + Hazelcast + Hibernate 5 L2 Cache

a 夏天 提交于 2019-12-08 11:02:01
问题 I have a hibernate (5.0.11.Final) Spring Boot (1.4.1-RELEASE) application that uses Hazelcast (3.7.1) as the L2 cache implementation. I wanted to clarify that with the hibernate l2 configuration, I do NOT need to include my own hazelcast.xml file. I am asking because when I do have both (hibernate l2 configuration AND a src/main/resource/hibernate.xml file) when I start an instance of this application, I see 2 members created. When I start another instance, I see 4. I was under the impression

Hazelcast cluster over AWS using Docker

自古美人都是妖i 提交于 2019-12-08 03:58:26
问题 Hi am trying to configure hazelcast cluster over AWS. I am running hazelcast in docker container and using --net=host to use host network config. when i look at hazelcast logs, I see [172.17.0.1]:5701 [herald] [3.8] Established socket connection between /[node2]:5701 and /[node1]:47357 04:24:22.595 [hz._hzInstance_1_herald.IO.thread-out-0] DEBUG c.h.n.t.SocketWriterInitializerImpl - [172.17.0.1]:5701 [herald] [3.8] Initializing SocketWriter WriteHandler with Cluster Protocol 04:24:22.595 [hz.

Does Hazelcast have a distributed priority queue implementation?

别说谁变了你拦得住时间么 提交于 2019-12-08 03:33:24
问题 We need to implement a distributed priority queue within Hazelcast at the moment and the only documentation we can find on the matter is this: https://blog.hazelcast.com/priority-queueing-using-spi/, which is not a production ready implementation. It references MigrationAwareService and BackupAwareOperation interfaces and provides a basic example for how to implement them, but after inspecting Hazelcast's own QueueService it doesn't look like these examples will suffice. Is it better to use

Creating application scoped class member with a producer

心不动则不痛 提交于 2019-12-08 03:20:22
问题 Is it true to say that in the code bellow, the Hazelcast instance will be application scoped ? @ApplicationScoped public class Producer { private HazelcastInstance instance; @PostConstruct public void afterCreate() { instance = Hazelcast.newHazelcastInstance(); } @Produces public HazelcastInstance getInstance() { return instance; } } EDIT This solution: Ensure produced been are application scoped. Provide graceful Hazelcast shut down. @ApplicationScoped public class Producer { private

Hazelcast prevents the JVM from terminating

喜夏-厌秋 提交于 2019-12-07 15:30:53
问题 We use Hazelcast 2.6.2 in a legacy Java clustered application. When the application is stopped the JVM does not terminate any more. It seems that it is caused by Hazelcast threads not being flagged daemon. I did not find a way way through the Hazelcast API to flag them daemon. Are there recommended solutions to prevent Hazelcast from preventing the JVM to terminate? Regards 回答1: Looking at the Hazelcast Javadocs, I see that there is a shutdownAll(); method. To quote the javadocs: Shuts down

Is Hazelcast Client thread safe?

老子叫甜甜 提交于 2019-12-07 11:45:32
问题 I cannot find this in the docs or javadocs: do I need to create one client per thread or is a client created by: client = HazelcastClient.newHazelcastClient(cfg); thread safe? 回答1: The client is thread-safe. Also when you get e.g. an IMap from it, it also is thread-safe. HazelcastInstance client = HazelcastClient.newHazelcastClient(cfg) IMap map = client.getMap("map"); So you can share this client instance with all your threads in the JVM. 来源: https://stackoverflow.com/questions/25567894/is