Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/java/new-features/java8-common-new-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public interface Runnable{}

```java
@FunctionalInterface
public interface LambdaFunctionalInterface {
public interface LambdaInterface {
void f();
}
//使用
Expand Down Expand Up @@ -221,7 +221,7 @@ public class LambdaClassSuper {
}
}

public class LambdaClass {
public class LambdaClass extends LambdaClassSuper {
public static LambdaInterface staticF() {
return null;
}
Expand All @@ -243,6 +243,7 @@ public class LambdaClass {

//4. 构造方法调用
LambdaInterface tt = LambdaClassSuper::new;
}
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ ZooKeeper 集群中的所有机器通过一个 **Leader 选举过程** 来选定
| 角色 | 说明 |
| -------- | ------------------------------------------------------------ |
| Leader | 为客户端提供读和写的服务,负责投票的发起和决议,更新系统状态。 |
| Follower | 为客户端提供读服务,如果是写服务则转发给 Leader。在选举过程中参与投票。 |
| Observer | 为客户端提供读服务器,如果是写服务则转发给 Leader。不参与选举过程中的投票,也不参与“过半写成功”策略。在不影响写性能的情况下提升集群的读性能。此角色于 ZooKeeper3.3 系列新增的角色。 |
| Follower | 为客户端提供读服务,如果是写服务则转发给 Leader。参与选举过程中的投票。 |
| Observer | 为客户端提供读服务,如果是写服务则转发给 Leader。不参与选举过程中的投票,也不参与“过半写成功”策略。在不影响写性能的情况下提升集群的读性能。此角色于 ZooKeeper3.3 系列新增的角色。 |

当 Leader 服务器出现网络中断、崩溃退出与重启等异常情况时,就会进入 Leader 选举过程,这个过程会选举产生新的 Leader 服务器。

Expand Down