Choose sequence: local node -> local rack -> remote rack
a selected replica node should be a good node:
1> if the node is (being) decommissed
2> the remaining capacity of the target machine
3> the communication traffic of the target machine
based on current connection of that machine, if current connection number > average connection num(total connections / total machine size) node.getXceiverCount() > (2.0 * avgLoad)
4> if the target rack has chosen too many nodes
Data replication topology:
first replica machine -> second replica -> ...
After a list of replicas are selected, replica list should be sorted in pipe.
The aim of this sort is to find the shortest path, since data replication will be travelling from the first replica machine to the final replica machine, so, we should reduce round trip.
This is basically a traveling salesman problem:
java 代码
- int index=0;
- for( ;index
- DatanodeDescriptor shortestNode = null;
- int shortestDistance = Integer.MAX_VALUE;
- int shortestIndex = index;
- for( int i=index; i
- DatanodeDescriptor currentNode = nodes.get(i);
- int currentDistance = clusterMap.getDistance( writer, currentNode );
- if(shortestDistance>currentDistance ) {
- shortestDistance = currentDistance;
- shortestNode = currentNode;
- shortestIndex = i;
- }
- }
-
- if( index != shortestIndex ) {
- nodes.set(shortestIndex, nodes.get(index));
- nodes.set(index, shortestNode);
- }
- writer = shortestNode;
- }
分享到:
相关推荐
Android 游戏源代码 Replicaisland(含截图)Android 游戏源代码 Replicaisland(含截图)Android 游戏源代码 Replicaisland(含截图)Android 游戏源代码 Replicaisland(含截图)Android 游戏源代码 Replicaisland...
Andorid Replica island源码下载,基于Java代码实现,有APK编译器的可下载后重新编译,如效果截图所示。本款游戏的名字好像叫“小绿人历险记”,具体名字我没看到,希望有兴趣的下载源码吧,完整的Java源码。
Replicaisland_a5源码,是一个很不错的Android代码,有兴趣的伙伴们抽时间可以看一下把。
Mongodb的Replica Sets + Sharding架构(window篇)
replicaisland. 完整游戏开发案例。 代码经典。
trex-replica-tempo Clojure 命令行实用程序,用于在 T-Rex Replica 延迟上设置速度。用法 lein uberjarjava -jar target/replica-bpm.jar -b 120 -d MIDI使用名为MIDI的 Midi 设备将 BPM 设置为 120。 查看所有可用...
副本数据集副本数据集是各种室内...引用副本数据集如果您在研究中使用副本数据库,请引用以下: @article{replica19arxiv, title = {The {R}eplica Dataset: A Digital Replica of Indoor Spaces}, author = {Julian S
该文件描述了如何在 Docker 上运行 Mongo DB Replica Set。 我们假设主机上的 Docker IP 地址是172.17.42.1 (并且在大多数情况下是正确的)。 您可以通过运行ifconfig docker0并检查 ip 地址来验证它。 我们正在...
CLoud Scheduling Method
NULL 博文链接:https://star45.iteye.com/blog/2039957
Replicaisland.zip
使用SpringBoot 对MongoDB副本集进行实现,看读数据与写数据操作,是否会自动分配到从库与主库上,关键点在 uri 连接字符串上
模板法制备高强度聚合物超疏水表面,任清伟,谷光胜,本工作利用一种简便而行之有效的砂纸模板法在聚合物表面复型制备出大面积无规粗糙微结构,由此可以得到超疏水的聚合物表面。进一
关于mongodb的备份集的检测,优化,部署
NULL 博文链接:https://tcrct.iteye.com/blog/2108099
1.分篇章进行学习,内容控制30分钟内 2.1个月疗程,不要放弃治疗哦 3.图文并茂,有问题请发到邮箱
Dynamic Replica dataset
ansible-mongo-replicaset-role 前言 使用ansible搭建的一个精简版的mongo replicaset。安装的服务器centos7。 安装思路 1、通过rpm安装mongo的包,然后安装依赖的程序 2、配置mongo.service 3、配置mongo.conf,...
On Top Replica 窗口置顶 tudou youku 优酷 置顶 土豆 置顶 在线视频 置顶