摘要: 【原文】 https://www.cnblogs.com/study-everyday/p/8629100.html 【解决的问题】 1)使用hash%n,增加节点,全部数据都要改变 在一致性hash环上,增加一个节点x,只影响逆时针一个节点 减少一个节点,影响顺时针下一个节点 2)节点数少,只有2 阅读全文
posted @ 2021-09-29 19:20 stupidstan2019 阅读(36) 评论(0) 推荐(0) 编辑
摘要: CREATE NODE GROUP ngrp3 WITH (dn1,dn2); CREATE TABLE testgrp3 (id int primary key, note text) DISTRIBUTE BY HASH(id) TO GROUP ngrp3; insert into testg 阅读全文
posted @ 2021-09-29 00:52 stupidstan2019 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 【测试环境】 CREATE NODE GROUP ngrp2 WITH (dn1); CREATE TABLE testgrp2 (id int primary key, note text) DISTRIBUTE BY HASH(id) TO GROUP ngrp2; insert into te 阅读全文
posted @ 2021-09-29 00:42 stupidstan2019 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 1)插入n条数据 insert into test values(3, 'text'); 2)调用链 320行第一次为0,第二次为1 3)实现原理 3.1)roundRobinNode是一个链表 3.2)如果下一个元素不是队尾,取值 如果是队尾,取队头,顺序遍历 阅读全文
posted @ 2021-09-29 00:21 stupidstan2019 阅读(65) 评论(0) 推荐(0) 编辑