diff --git a/docs/java/new-features/java8-common-new-features.md b/docs/java/new-features/java8-common-new-features.md index 69a9b7f7ba0..f0630eff520 100644 --- a/docs/java/new-features/java8-common-new-features.md +++ b/docs/java/new-features/java8-common-new-features.md @@ -176,7 +176,7 @@ public interface Runnable{} ```java @FunctionalInterface -public interface LambdaFunctionalInterface { +public interface LambdaInterface { void f(); } //使用 @@ -221,7 +221,7 @@ public class LambdaClassSuper { } } -public class LambdaClass { +public class LambdaClass extends LambdaClassSuper { public static LambdaInterface staticF() { return null; } @@ -243,6 +243,7 @@ public class LambdaClass { //4. 构造方法调用 LambdaInterface tt = LambdaClassSuper::new; + } } ``` diff --git a/docs/system-design/distributed-system/zookeeper/zookeeper-intro.md b/docs/system-design/distributed-system/zookeeper/zookeeper-intro.md index 8178d303a48..f9b94eb2bcd 100644 --- a/docs/system-design/distributed-system/zookeeper/zookeeper-intro.md +++ b/docs/system-design/distributed-system/zookeeper/zookeeper-intro.md @@ -235,8 +235,8 @@ ZooKeeper 集群中的所有机器通过一个 **Leader 选举过程** 来选定 | 角色 | 说明 | | -------- | ------------------------------------------------------------ | | Leader | 为客户端提供读和写的服务,负责投票的发起和决议,更新系统状态。 | -| Follower | 为客户端提供读服务,如果是写服务则转发给 Leader。在选举过程中参与投票。 | -| Observer | 为客户端提供读服务器,如果是写服务则转发给 Leader。不参与选举过程中的投票,也不参与“过半写成功”策略。在不影响写性能的情况下提升集群的读性能。此角色于 ZooKeeper3.3 系列新增的角色。 | +| Follower | 为客户端提供读服务,如果是写服务则转发给 Leader。参与选举过程中的投票。 | +| Observer | 为客户端提供读服务,如果是写服务则转发给 Leader。不参与选举过程中的投票,也不参与“过半写成功”策略。在不影响写性能的情况下提升集群的读性能。此角色于 ZooKeeper3.3 系列新增的角色。 | 当 Leader 服务器出现网络中断、崩溃退出与重启等异常情况时,就会进入 Leader 选举过程,这个过程会选举产生新的 Leader 服务器。