This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a commit to branch asf-site-v2
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git
The following commit(s) were added to refs/heads/asf-site-v2 by this push:
new c6e828f1f85 deploy: 636ae6cf68633c99b52f3b0e559579155059099a
c6e828f1f85 is described below
commit c6e828f1f854a76e070251478d8f7549fd81b704
Author: AlbumenJ <[email protected]>
AuthorDate: Mon Aug 12 02:01:08 2024 +0000
deploy: 636ae6cf68633c99b52f3b0e559579155059099a
---
sitemap.xml | 2 +-
.../index.html" | 8 ++++----
zh-cn/blog/java/demos/index.xml | 4 ++--
zh-cn/sitemap.xml | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/sitemap.xml b/sitemap.xml
index eb92e905f94..19e77ae75ed 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?><sitemapindex
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://dubbo.apache.org/zh-cn/sitemap.xml</loc><lastmod>2024-08-09T15:10:01+08:00</lastmod></sitemap><sitemap><loc>https://dubbo.apache.org/en/sitemap.xml</loc><lastmod>2024-08-09T15:10:01+08:00</lastmod></sitemap></sitemapindex>
\ No newline at end of file
+<?xml version="1.0" encoding="utf-8" standalone="yes"?><sitemapindex
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://dubbo.apache.org/zh-cn/sitemap.xml</loc><lastmod>2024-08-12T09:56:34+08:00</lastmod></sitemap><sitemap><loc>https://dubbo.apache.org/en/sitemap.xml</loc><lastmod>2024-08-09T15:10:01+08:00</lastmod></sitemap></sitemapindex>
\ No newline at end of file
diff --git
"a/zh-cn/blog/2019/05/01/dubbo-\344\270\200\350\207\264\346\200\247hash\350\264\237\350\275\275\345\235\207\350\241\241\345\256\236\347\216\260\345\211\226\346\236\220/index.html"
"b/zh-cn/blog/2019/05/01/dubbo-\344\270\200\350\207\264\346\200\247hash\350\264\237\350\275\275\345\235\207\350\241\241\345\256\236\347\216\260\345\211\226\346\236\220/index.html"
index c47086aab37..9723f9c5ad3 100644
---
"a/zh-cn/blog/2019/05/01/dubbo-\344\270\200\350\207\264\346\200\247hash\350\264\237\350\275\275\345\235\207\350\241\241\345\256\236\347\216\260\345\211\226\346\236\220/index.html"
+++
"b/zh-cn/blog/2019/05/01/dubbo-\344\270\200\350\207\264\346\200\247hash\350\264\237\350\275\275\345\235\207\350\241\241\345\256\236\347\216\260\345\211\226\346\236\220/index.html"
@@ -1,7 +1,7 @@
<!doctype html><html lang=zh-cn class=no-js><head><meta name=ROBOTS
content="INDEX, FOLLOW"><link rel=canonical
href=https://dubbo.apache.org/zh-cn/blog/2019/05/01/dubbo-%E4%B8%80%E8%87%B4%E6%80%A7hash%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%E5%AE%9E%E7%8E%B0%E5%89%96%E6%9E%90/><meta
charset=utf-8><meta name=viewport
content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta
name=generator content="Hugo 0.122.0"><link rel="shortcut icon" type=image/png
href=/imgs/favicon.png><link r [...]
<meta property="og:description"
content="本文以一般的一致性Hash实现作为引子,详细剖析了Dubbo一致性Hash负载均衡算法的实现
-"><meta property="og:type" content="article"><meta property="og:url"
content="https://dubbo.apache.org/zh-cn/blog/2019/05/01/dubbo-%E4%B8%80%E8%87%B4%E6%80%A7hash%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%E5%AE%9E%E7%8E%B0%E5%89%96%E6%9E%90/"><meta
property="article:section" content="blog"><meta
property="article:published_time" content="2019-05-01T00:00:00+00:00"><meta
property="article:modified_time" content="2024-04-28T21:45:27+08:00"><meta
itemprop=name content="Dubbo 一致性Hash负载均衡实现剖析"><met [...]
-"><meta itemprop=datePublished content="2019-05-01T00:00:00+00:00"><meta
itemprop=dateModified content="2024-04-28T21:45:27+08:00"><meta
itemprop=wordCount content="410"><meta itemprop=keywords content="Java,"><meta
name=twitter:card content="summary"><meta name=twitter:title content="Dubbo
一致性Hash负载均衡实现剖析"><meta name=twitter:description
content="本文以一般的一致性Hash实现作为引子,详细剖析了Dubbo一致性Hash负载均衡算法的实现
+"><meta property="og:type" content="article"><meta property="og:url"
content="https://dubbo.apache.org/zh-cn/blog/2019/05/01/dubbo-%E4%B8%80%E8%87%B4%E6%80%A7hash%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%E5%AE%9E%E7%8E%B0%E5%89%96%E6%9E%90/"><meta
property="article:section" content="blog"><meta
property="article:published_time" content="2019-05-01T00:00:00+00:00"><meta
property="article:modified_time" content="2024-08-12T09:56:34+08:00"><meta
itemprop=name content="Dubbo 一致性Hash负载均衡实现剖析"><met [...]
+"><meta itemprop=datePublished content="2019-05-01T00:00:00+00:00"><meta
itemprop=dateModified content="2024-08-12T09:56:34+08:00"><meta
itemprop=wordCount content="410"><meta itemprop=keywords content="Java,"><meta
name=twitter:card content="summary"><meta name=twitter:title content="Dubbo
一致性Hash负载均衡实现剖析"><meta name=twitter:description
content="本文以一般的一致性Hash实现作为引子,详细剖析了Dubbo一致性Hash负载均衡算法的实现
"><script async
src="https://www.googletagmanager.com/gtag/js?id=G-1TFHM5YBH0"></script><script>var
doNotTrack=!1;if(!doNotTrack){window.dataLayer=window.dataLayer||[];function
gtag(){dataLayer.push(arguments)}gtag("js",new
Date),gtag("config","G-1TFHM5YBH0",{anonymize_ip:!1})}</script><link
rel=preload
href=/scss/main.min.9e6561cc0361d4774cd6dea1f797b4d79df2a97001c1d51e86b490fa04cfc749.css
as=style><link
href=/scss/main.min.9e6561cc0361d4774cd6dea1f797b4d79df2a97001c1d51e86b490fa04cfc74
[...]
"><meta property="og:description"
content="本文以一般的一致性Hash实现作为引子,详细剖析了Dubbo一致性Hash负载均衡算法的实现
"><meta name=twitter:description
content="本文以一般的一致性Hash实现作为引子,详细剖析了Dubbo一致性Hash负载均衡算法的实现
@@ -206,7 +206,7 @@
<label for=m-zh-cnblog20220219e8b088e8b088pixiue79a84filter-check><a
href=/zh-cn/blog/2022/02/19/%E8%B0%88%E8%B0%88pixiu%E7%9A%84filter/
class="align-left pl-0 td-sidebar-link td-sidebar-link__page"
id=m-zh-cnblog20220219e8b088e8b088pixiue79a84filter><span>谈谈Pixiu的Filter</span></a></label></li><li
class="td-sidebar-nav__section-title td-sidebar-nav__section without-child"
id=m-zh-cnblog20210825dubbo-e8b7a8e8afade8a880e8b083e794a8e7a59ee585bddubbo-go-pixiu-li><input
type=checkbox id=m-zh- [...]
<label
for=m-zh-cnblog20210825dubbo-e8b7a8e8afade8a880e8b083e794a8e7a59ee585bddubbo-go-pixiu-check><a
href=/zh-cn/blog/2021/08/25/dubbo-%E8%B7%A8%E8%AF%AD%E8%A8%80%E8%B0%83%E7%94%A8%E7%A5%9E%E5%85%BDdubbo-go-pixiu/
class="align-left pl-0 td-sidebar-link td-sidebar-link__page"
id=m-zh-cnblog20210825dubbo-e8b7a8e8afade8a880e8b083e794a8e7a59ee585bddubbo-go-pixiu><span>Dubbo
跨语言调用神兽:dubbo-go-pixiu</span></a></label></li></ul></li><li
class="td-sidebar-nav__section-title td-sidebar-nav__secti [...]
<label
for=m-zh-cnblog20231007apache-dubbo-e9a696e4b8aa-nodejs-30-alpha-e78988e69cace6ada3e5bc8fe58f91e5b883-check><a
href=/zh-cn/blog/2023/10/07/apache-dubbo-%E9%A6%96%E4%B8%AA-node.js-3.0-alpha-%E7%89%88%E6%9C%AC%E6%AD%A3%E5%BC%8F%E5%8F%91%E5%B8%83/
class="align-left pl-0 td-sidebar-link td-sidebar-link__page"
id=m-zh-cnblog20231007apache-dubbo-e9a696e4b8aa-nodejs-30-alpha-e78988e69cace6ada3e5bc8fe58f91e5b883><span>Apache
Dubbo 首个 Node.js 3.0-alpha 版本正式发布</span></a></label></li><li cla [...]
-<label
for=m-zh-cnblog20231007web-e6b58fe8a788e599a8e9a1b5e99da2e4b99fe883bde8aebfe997aedubbogrpce5beaee69c8de58aa1dubbo-js-alphae78988e69cace6ada3e5bc8fe58f91e5b883-check><a
href=/zh-cn/blog/2023/10/07/web-%E6%B5%8F%E8%A7%88%E5%99%A8%E9%A1%B5%E9%9D%A2%E4%B9%9F%E8%83%BD%E8%AE%BF%E9%97%AEdubbogrpc%E5%BE%AE%E6%9C%8D%E5%8A%A1dubbo-js-alpha%E7%89%88%E6%9C%AC%E6%AD%A3%E5%BC%8F%E5%8F%91%E5%B8%83/
class="align-left pl-0 td-sidebar-link td-sidebar-link__page"
id=m-zh-cnblog20231007web-e6b58fe8a7 [...]
+<label
for=m-zh-cnblog20231007web-e6b58fe8a788e599a8e9a1b5e99da2e4b99fe883bde8aebfe997aedubbogrpce5beaee69c8de58aa1dubbo-js-alphae78988e69cace6ada3e5bc8fe58f91e5b883-check><a
href=/zh-cn/blog/2023/10/07/web-%E6%B5%8F%E8%A7%88%E5%99%A8%E9%A1%B5%E9%9D%A2%E4%B9%9F%E8%83%BD%E8%AE%BF%E9%97%AEdubbogrpc%E5%BE%AE%E6%9C%8D%E5%8A%A1dubbo-js-alpha%E7%89%88%E6%9C%AC%E6%AD%A3%E5%BC%8F%E5%8F%91%E5%B8%83/
class="align-left pl-0 td-sidebar-link td-sidebar-link__page"
id=m-zh-cnblog20231007web-e6b58fe8a7 [...]
</span></span><span style=display:flex><span> <span
style=color:#719e07>if</span> (CollectionUtils.isNotEmpty(invokers)) {
</span></span><span style=display:flex><span> <span
style=color:#719e07>return</span>
ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(invokers.get(0).getUrl()
</span></span><span style=display:flex><span>
.getMethodParameter(RpcUtils.getMethodName(invocation), LOADBALANCE_KEY,
DEFAULT_LOADBALANCE));
@@ -214,7 +214,7 @@
</span></span><span style=display:flex><span> <span
style=color:#719e07>return</span>
ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(DEFAULT_LOADBALANCE);
</span></span><span style=display:flex><span> }
</span></span><span style=display:flex><span>}
-</span></span></code></pre></div><p>这部分代码逻辑分为两部分:</p><p>1、获取调用方法所配置的LOADBALANCE_KEY属性的值,LOADBALANCE_KEY这个常量的实际值为:loadbalance,即为我们的所配置的属性;</p><p>2、利用SPI机制来初始化并加载该值所代表的负载均衡策略。</p><p>所有的负载均衡策略都会继承LoadBalance接口。在各种集群策略中,最终都会调用AbstractClusterInvoker的select方法,而AbstractClusterInvoker会在doSelect中,<strong>调用LoadBalance的select方法,这里即开始了负载均衡策略的执行。</strong></p><h3
id=三dubbo一致性hash负载均衡的实现>三、Dubbo一致性Hash负载均衡的实现</h3><p>需要说明的一点是,我所说的<strong>负载均衡策略的执行</strong>,即是在所有的Provider中选出一个,作为当前Consumer的远程调用对象。在代码中,P
[...]
+</span></span></code></pre></div><p>这部分代码逻辑分为两部分:</p><p>1、获取调用方法所配置的LOADBALANCE_KEY属性的值,LOADBALANCE_KEY这个常量的实际值为:loadbalance,即为我们的所配置的属性;</p><p>2、利用SPI机制来初始化并加载该值所代表的负载均衡策略。</p><p>所有的负载均衡策略都会继承LoadBalance接口。在各种集群策略中,最终都会调用AbstractClusterInvoker的select方法,而AbstractClusterInvoker会在doSelect中,<strong>调用LoadBalance的select方法,这里即开始了负载均衡策略的执行。</strong></p><h3
id=三dubbo一致性hash负载均衡的实现>三、Dubbo一致性Hash负载均衡的实现</h3><p>需要说明的一点是,我所说的<strong>负载均衡策略的执行</strong>,即是在所有的Provider中选出一个,作为当前Consumer的远程调用对象。在代码中,P
[...]
</span></span><span style=display:flex><span><span
style=color:#268bd2>public</span> <span style=color:#719e07><</span>T<span
style=color:#719e07>></span> Invoker<span
style=color:#719e07><</span>T<span style=color:#719e07>></span> <span
style=color:#268bd2>select</span>(List<span
style=color:#719e07><</span>Invoker<span
style=color:#719e07><</span>T<span style=color:#719e07>>></span>
invokers, URL url, Invocation invocation) {
</span></span><span style=display:flex><span> <span
style=color:#719e07>if</span> (CollectionUtils.isEmpty(invokers)) {
</span></span><span style=display:flex><span> <span
style=color:#719e07>return</span> <span style=color:#cb4b16>null</span>;
diff --git a/zh-cn/blog/java/demos/index.xml b/zh-cn/blog/java/demos/index.xml
index 663a39dd569..e680dc6b998 100644
--- a/zh-cn/blog/java/demos/index.xml
+++ b/zh-cn/blog/java/demos/index.xml
@@ -4143,7 +4143,7 @@ ProtocolFilterWrapper代码如下:</p>
<h4 id="b映射请求定位服务"><strong>b、映射请求、定位服务</strong></h4>
<p>在发起请求时,我们往往会带上参数,而这些参数,就可以被我们用来确定具体调用哪一个服务。假设有请求R1、R2、R3,对它们的参数也经过计算特定识别码、取余的一系列运算之后,有如下映射关系:</p>
<p><img
src="https://dubbo.apache.org/imgs/blog/consistenthash/consistent-hash-request-model.jpg"
alt="Request"></p>
-<p>从图中,我们可以看到,R1请求映射在0-Node1中间,R2请求映射在Node1-Node2中间,R3请求映射在Node2-Node3中间。我们取<strong>服务Hash值大于请求Hash值</strong>的<strong>第一个服务</strong>作为实际的调用服务。也就是说,R1请求将调用Node1服务,R2请求将调用Node2服务,R3请求将调用Node3服务。</p>
+<p>从图中,我们可以看到,R1请求映射在0-Node1中间,R2请求映射在Node1-Node2中间,R3请求映射在Node2-Node3中间。我们取<strong>服务Hash值大于等于请求Hash值</strong>的<strong>第一个服务</strong>作为实际的调用服务。也就是说,R1请求将调用Node1服务,R2请求将调用Node2服务,R3请求将调用Node3服务。</p>
<h4 id="c新增服务节点"><strong>c、新增服务节点</strong></h4>
<p>假设新增服务Node4,映射在Node3之前,恰巧破坏了原来的一个映射关系:</p>
<p><img
src="https://dubbo.apache.org/imgs/blog/consistenthash/consistent-hash-new-node-model.jpg"
alt="New Node"></p>
@@ -4201,7 +4201,7 @@ ProtocolFilterWrapper代码如下:</p>
<p>需要说明的一点是,我所说的<strong>负载均衡策略的执行</strong>,即是在所有的Provider中选出一个,作为当前Consumer的远程调用对象。在代码中,Provider被封装成了Invoker实体,所以直接说来,负载均衡策略的执行就是在Invoker列表中选出一个Invoker。</p>
<p>所以,对比普通一致性Hash的实现,Dubbo的一致性Hash算法也可以分为两步:</p>
<p><strong>1、映射Provider至Hash值区间中(实际中映射的是Invoker);</strong></p>
-<p><strong>2、映射请求,然后找到大于请求Hash值的第一个Invoker。</strong></p>
+<p><strong>2、映射请求,然后找到大于等于请求Hash值的第一个Invoker。</strong></p>
<h4 id="a映射invoker"><strong>a、映射Invoker</strong></h4>
<p>Dubbo中所有的负载均衡实现类都继承了AbstractLoadBalance,调用LoadBalance的select方法时,实际上调用的是AbstractLoadBalance的实现:</p>
<div class="highlight"><pre tabindex="0"
style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code
class="language-java" data-lang="java"><span
style="display:flex;"><span><span
style="color:#268bd2">@Override</span>
diff --git a/zh-cn/sitemap.xml b/zh-cn/sitemap.xml
index fdbbabb73e9..71f7de12591 100644
--- a/zh-cn/sitemap.xml
+++ b/zh-cn/sitemap.xml
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://dubbo.apache.org/zh-cn/blog/2023/01/16/%E9%98%BF%E9%87%8C%E5%B7%B4%E5%B7%B4%E5%8D%87%E7%BA%A7-dubbo3-%E5%85%A8%E9%9D%A2%E5%8F%96%E4%BB%A3-hsf2/</loc><lastmod>2023-11-28T15:14:12+08:00</lastmod><changefreq>monthly</changefreq><priority>0.5</priority></url><url><loc>https://dubbo.apache.org/zh-cn/overview/mannual/jav
[...]
\ No newline at end of file
+<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://dubbo.apache.org/zh-cn/blog/2023/01/16/%E9%98%BF%E9%87%8C%E5%B7%B4%E5%B7%B4%E5%8D%87%E7%BA%A7-dubbo3-%E5%85%A8%E9%9D%A2%E5%8F%96%E4%BB%A3-hsf2/</loc><lastmod>2023-11-28T15:14:12+08:00</lastmod><changefreq>monthly</changefreq><priority>0.5</priority></url><url><loc>https://dubbo.apache.org/zh-cn/overview/mannual/jav
[...]
\ No newline at end of file