HazelCast map.get() 去哪儿了?和可扩展性问题
Where did HazelCast map.get() go? And scalability concerns
根据this,"Each map.get(k) will be a remote operation"但是遥控器在哪里?例如,我有一个使用键 - k 写入 IMap 的节点。另外 50 个节点使用 map.get(k) 从 IMap 中读取。当 50 个节点调用 map.get(k) 时会发生什么。每次调用都会到达执行写入的节点吗?如果是这样,这个 "remote" 节点将创建多少个 IMap 副本来响应这 50 个调用?它是多线程的吗?这是 IMap 单例吗?或者每个线程都会创建此类 IMap 的深层副本?
But where is the remote?
答案在您提供的文档 link 的前一句中:"Imagine that you are reading the key k so many times and k is owned by another member in your cluster."。每个键都经过哈希处理并映射到一个分区,如 http://docs.hazelcast.org/docs/3.7/manual/html-single/index.html#sharding-in-hazelcast 和随后的 "Data Partitioning" 部分所述。拥有该分区的集群成员是密钥的所有者(或主副本)。该密钥上的每次读取和写入都将由该特定成员上的同一线程执行(除非您的配置允许从备份读取)。
What happens when 50 nodes call map.get(k). Does each call come to the node that does the write?
是的,在该密钥上执行操作的始终是密钥所有者。
If so, how many copies of IMap does this "remote" node will create in responds to these 50 calls?
会员只有一个IMap实例,没有副本。
Is it multi-threaded?
不,涉及同一键的所有映射操作 k
将在同一成员上的同一分区线程上执行,该成员是该键的主要副本。您可以在 http://docs.hazelcast.org/docs/3.7/manual/html-single/index.html#operation-threading
中阅读更多关于线程操作模型的信息
根据this,"Each map.get(k) will be a remote operation"但是遥控器在哪里?例如,我有一个使用键 - k 写入 IMap 的节点。另外 50 个节点使用 map.get(k) 从 IMap 中读取。当 50 个节点调用 map.get(k) 时会发生什么。每次调用都会到达执行写入的节点吗?如果是这样,这个 "remote" 节点将创建多少个 IMap 副本来响应这 50 个调用?它是多线程的吗?这是 IMap 单例吗?或者每个线程都会创建此类 IMap 的深层副本?
But where is the remote?
答案在您提供的文档 link 的前一句中:"Imagine that you are reading the key k so many times and k is owned by another member in your cluster."。每个键都经过哈希处理并映射到一个分区,如 http://docs.hazelcast.org/docs/3.7/manual/html-single/index.html#sharding-in-hazelcast 和随后的 "Data Partitioning" 部分所述。拥有该分区的集群成员是密钥的所有者(或主副本)。该密钥上的每次读取和写入都将由该特定成员上的同一线程执行(除非您的配置允许从备份读取)。
What happens when 50 nodes call map.get(k). Does each call come to the node that does the write?
是的,在该密钥上执行操作的始终是密钥所有者。
If so, how many copies of IMap does this "remote" node will create in responds to these 50 calls?
会员只有一个IMap实例,没有副本。
Is it multi-threaded?
不,涉及同一键的所有映射操作 k
将在同一成员上的同一分区线程上执行,该成员是该键的主要副本。您可以在 http://docs.hazelcast.org/docs/3.7/manual/html-single/index.html#operation-threading