上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 53 下一页

Java8 in action

摘要: 解决的问题: behavior parameterization,即可以把一段code,逻辑作为参数传入; 这样做的目的,当然为了代码抽象和重用,把变化的逻辑抽象出去; 在java中,如果要实现behavior parameterization,需要通过传入类对象的方式,你首先要声明很多类,verb 阅读全文
posted @ 2017-03-15 17:30 fxjwind 阅读(1020) 评论(0) 推荐(0) 编辑

Copycat - configure

摘要: Copycat server之间的configure是如何,何时被同步的? 大家可以看到,只有leader可以同步配置 1. 显式的调用LeaderState.configure LeaderState.configure /** * Commits the given configuration. */ protected CompletableFutu... 阅读全文
posted @ 2017-03-10 14:03 fxjwind 阅读(432) 评论(0) 推荐(0) 编辑

Copycat - AppendRequest

摘要: 对于Command,Configuration都要通过appendEntries的方式,把Entries同步给follower LeaderState.configure /** * Commits the given configuration. */ protected CompletableFuture configure(Collection members) { ... 阅读全文
posted @ 2017-03-09 15:28 fxjwind 阅读(369) 评论(0) 推荐(0) 编辑

Copycat - 状态

摘要: Member.Status status的变迁是源于heartbeat heartbeat,append空的entries heartbeat的逻辑是会向所有的getRemoteMemberStates,发起heartbeat AVAILABLE 在初始化的时候,每个ServerMember默认是S 阅读全文
posted @ 2017-03-08 16:15 fxjwind 阅读(648) 评论(0) 推荐(0) 编辑

Kafka – kafka consumer

摘要: ConsumerRecords records = consumer.poll(100); /** * Fetch data for the topics or partitions specified using one of the subscribe/assign APIs. It is an error to not have * subscribed ... 阅读全文
posted @ 2017-03-03 11:53 fxjwind 阅读(5328) 评论(0) 推荐(0) 编辑

Copycat - command

摘要: client.submit(new PutCommand("foo", "Hello world!")); ServerContextconnection.handler(CommandRequest.class, request -> state.command(request)); State.command ReserveState开始,会把command forward到leade... 阅读全文
posted @ 2017-03-01 17:18 fxjwind 阅读(269) 评论(0) 推荐(0) 编辑

Copycat - CopycatServer

摘要: Server被拉起有两种方式, Address address = new Address("123.456.789.0", 5000); CopycatServer.Builder builder = CopycatServer.builder(address); builder.withStateMachine(MapStateMachine::new); 自己拉起一个cluster, ... 阅读全文
posted @ 2017-02-24 16:53 fxjwind 阅读(495) 评论(0) 推荐(0) 编辑

Copycat - Overview

摘要: Copycat’s primary role is as a framework for building highly consistent, fault-tolerant replicated state machines. Copycat servers receive state machi 阅读全文
posted @ 2017-02-23 14:34 fxjwind 阅读(648) 评论(0) 推荐(0) 编辑

Copycat - MemberShip

摘要: https://github.com/atomix/copycat http://atomix.io/copycat/docs/membership/ 为了便于实现,Copycat把member分成3种, active, passive, and reserve members — each of which play some role in supporting rapid ... 阅读全文
posted @ 2017-02-20 18:00 fxjwind 阅读(599) 评论(0) 推荐(0) 编辑

Java8 CompletableFuture

摘要: http://colobu.com/2016/02/29/Java-CompletableFuture/ http://www.deadcoderising.com/java8-writing-asynchronous-code-with-completablefuture/ https://www 阅读全文
posted @ 2017-02-20 14:43 fxjwind 阅读(613) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 53 下一页