Infinispan Analysis of Distribution

In org.infinispan.distribution, the DistributionManagerImpl.jave is a core class which implements the interface DistributionManager.java, and it's main function is to handle object store in data grid.  This class have two ConsistenHash classes including consistentHash and oldConsistentHash. ConsistentHash is an implement of Consistent Hashing algorithm.

 

First of all, let talk about the Consistent Hashing algorithm. It is a data distrubtion algorithm that help system distribute object to special node by hash code. A new object is allocated a store node in the way of its hash code. In the same way, system can get a object in which node according hash code.

 

Before talking about join(), there is a JoinTask class should be introduce. JoinTask implements the interface RehashTask. JoinTask handles the rehashing of data when nodes join the cluster. Turn to join() method, it main function is that all nodes join data grid and generates the consistentHash. join() method get all nodes status using recManager.getTransport() method, then instant a new JoinTask class to let all nodes join current data grid and submits JoinTask to rehashExecutor. RpcManger provides a mechanism for communicating with other caches in the cluster, by formatting and passing requests down to the registered Transport.

 

ViewChangeListener listens current cluster view, if current cluster changed, ViewChangeListener call handleViewChange() event which calls join() or rehash() to maintain nodes in data grid.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值