简体   繁体   English

Hazelcast 地图中单个分区中的多个地图

[英]Multiple maps in a single partition in hazelcast map

I have two hazelcast maps defined as follows.我有两个定义如下的淡褐色地图。

IMap<EmpKey, Employee> employeeMap = hazelcastInstance.getMap("employeeMap");
IMap<EmpKey, EmployeeFamily> familyMap = hazelcastInstance.getMap("familyMap");

I understand that key gets serialized (gets converted into a byte[] array) which is then hashed and the result of which is 'mod' by no of partitions.我知道密钥被序列化(被转换成一个字节 [] 数组),然后被散列,其结果是没有分区的“mod”。 This gives us the id of the partition where data will be stored.这为我们提供了将存储数据的分区的 ID。 Also, from the partition table in each member, it identifies the owner of the partition.此外,从每个成员的分区表中,它标识了分区的所有者。 This follows that both employeeObj and family object withe the same empKey will be stored in the same partition.这意味着具有相同empKey employeeObjfamily对象将存储在同一分区中。

I would like to know what happens after this step.我想知道这一步之后会发生什么。 I understand that keys are stored as com.hazelcast.nio.serialization.Data class (binary form).我知道密钥存储为 com.hazelcast.nio.serialization.Data 类(二进制形式)。 Will there be​ ​ separate hash buckets maintained for each hashmap whose key is present in a given partition, for faster access ?是否会为其键存在于给定分区中的每个哈希映射维护单独的哈希桶,以便更快地访问?

I understand that partition count is configurable, but I would like to know some internals before I modify any configuration.我知道分区计数是可配置的,但我想在修改任何配置之前了解一些内部信息。

This follows that both employeeObj and family object withe the same empKey will be stored in the same partition.这意味着具有相同 empKey 的 employeeObj 和 family 对象将存储在同一分区中。

Correct.正确的。

I would like to know what happens after this step.我想知道这一步之后会发生什么。 I understand that keys are stored as com.hazelcast.nio.serialization.Data class (binary form).我知道密钥存储为 com.hazelcast.nio.serialization.Data 类(二进制形式)。 Will there be​ ​ separate hash buckets maintained for each hashmap whose key is present in a given partition, for faster access ?是否会为其键存在于给定分区中的每个哈希映射维护单独的哈希桶,以便更快地访问?

Each IMap gets its totally private internal storage (it will gets its own ConcurrentHashMap instance as backing structure).每个 IMap 获得其完全私有的内部存储(它将获得自己的 ConcurrentHashMap 实例作为支持结构)。 So you will have separate hashbucket.因此,您将拥有单独的 hashbucket。

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

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