摘要: 1. runtime.Caller()方法介绍 runtime.Caller()函数的签名如下: func Caller(skip int) (pc uintptr, file string, line int, ok bool) 可以看到其有一个传入参数skip: skip=0:Caller()会 阅读全文
posted @ 2022-05-18 18:39 aganippe 阅读(1502) 评论(0) 推荐(0) 编辑
摘要: 1. 一致性哈希算法 关于一致性哈希算法的详解,可以参见这篇博客文章 一致性哈希详解 简单来说,一致性哈希通过哈希环和增加虚拟节点来解决节点变更时的大范围数据迁移和冷热不均的问题 一致性哈希的一个开源实现为:stathat.com/c/consistent 1.1 数据迁移 我们首先从数据迁移的角度 阅读全文
posted @ 2022-05-18 16:44 aganippe 阅读(296) 评论(0) 推荐(0) 编辑