You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by ja...@apache.org on 2020/01/21 10:24:49 UTC

[incubator-brpc] branch master updated: fix some typos

This is an automated email from the ASF dual-hosted git repository.

jamesge pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new eb5528c  fix some typos
     new 074e031  Merge pull request #999 from lorinlee/typos
eb5528c is described below

commit eb5528c80eab349f7cec349d9350bb7bb16864d8
Author: LorinLee <lo...@gmail.com>
AuthorDate: Mon Dec 23 22:14:03 2019 +0800

    fix some typos
---
 src/brpc/policy/locality_aware_load_balancer.cpp | 14 +++++++-------
 src/brpc/policy/locality_aware_load_balancer.h   |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/brpc/policy/locality_aware_load_balancer.cpp b/src/brpc/policy/locality_aware_load_balancer.cpp
index a82af08..1541de2 100644
--- a/src/brpc/policy/locality_aware_load_balancer.cpp
+++ b/src/brpc/policy/locality_aware_load_balancer.cpp
@@ -83,13 +83,13 @@ bool LocalityAwareLoadBalancer::Add(Servers& bg, const Servers& fg,
 
         // Push the weight structure into the tree. Notice that we also need
         // a left_weight entry to store weight sum of all left nodes so that
-        // the load balancing by weights can be done in O(logN) complexicity.
+        // the load balancing by weights can be done in O(logN) complexity.
         ServerInfo info = { id, lb->PushLeft(), new Weight(initial_weight) };
         bg.weight_tree.push_back(info);
 
         // The weight structure may already have initial weight. Add the weight
         // to left_weight entries of all parent nodes and _total. The time
-        // complexicity is strictly O(logN) because the tree is complete.
+        // complexity is strictly O(logN) because the tree is complete.
         const int64_t diff = info.weight->volatile_value();
         if (diff) {
             bg.UpdateParentWeights(diff, index);
@@ -121,7 +121,7 @@ bool LocalityAwareLoadBalancer::Remove(
     // it retries, as if this range of weight is removed.
     const int64_t rm_weight = w->Disable();
     if (index + 1 == bg.weight_tree.size()) {
-        // last node. Removing is eaiser.
+        // last node. Removing is easier.
         bg.weight_tree.pop_back();
         if (rm_weight) {
             // The first buffer. Remove the weight from parents to disable
@@ -152,10 +152,10 @@ bool LocalityAwareLoadBalancer::Remove(
             // However this process is not atomic. The foreground buffer still
             // sees w2 as last node and it may change the weight during the
             // process. To solve this problem, we atomically reset the weight
-            // and remember the preivous index (back()) in _old_index. Later
+            // and remember the previous index (back()) in _old_index. Later
             // change to weight will add the diff to _old_diff_sum if _old_index
             // matches the index which SelectServer is from. In this way we
-            // know the weight diff from foreground before we laterly modify it.
+            // know the weight diff from foreground before we later modify it.
             const int64_t add_weight = w2->MarkOld(bg.weight_tree.size());
 
             // Add the weight diff to parent nodes of node `index'. Notice
@@ -289,7 +289,7 @@ int LocalityAwareLoadBalancer::SelectServer(const SelectIn& in, SelectOut* out)
         
         // Locate a weight range in the tree. This is obviously not atomic and
         // left-weights / total / weight-of-the-node may not be consistent. But
-        // this is what we have to pay to gain more parallism.
+        // this is what we have to pay to gain more parallelism.
         const ServerInfo & info = s->weight_tree[index];
         const int64_t left = info.left->load(butil::memory_order_relaxed);
         if (dice < left) {
@@ -397,7 +397,7 @@ int64_t LocalityAwareLoadBalancer::Weight::Update(
         // Accumulate into the last entry so that errors always decrease
         // the overall QPS and latency.
         // Note that the latency used is linearly mixed from the real latency
-        // (of an errorous call) and the timeout, so that errors that are more
+        // (of an erroneous call) and the timeout, so that errors that are more
         // unlikely to be solved by later retries are punished more.
         // Examples:
         //   max_retry=0: always use timeout
diff --git a/src/brpc/policy/locality_aware_load_balancer.h b/src/brpc/policy/locality_aware_load_balancer.h
index 8da16c0..d743eaa 100644
--- a/src/brpc/policy/locality_aware_load_balancer.h
+++ b/src/brpc/policy/locality_aware_load_balancer.h
@@ -38,7 +38,7 @@ DECLARE_double(punish_inflight_ratio);
 
 // Locality-aware is an iterative algorithm to send requests to servers which
 // have lowest expected latencies. Read docs/cn/lalb.md to get a peek at the
-// algorithm. The implemention is complex.
+// algorithm. The implementation is complex.
 class LocalityAwareLoadBalancer : public LoadBalancer {
 public:
     LocalityAwareLoadBalancer();


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org