junxie6 / raft-1 Goto Github PK
View Code? Open in Web Editor NEWThis project forked from postgrespro/raft
Raft protocol implementation in C
License: BSD 2-Clause "Simplified" License
This project forked from postgrespro/raft
Raft protocol implementation in C
License: BSD 2-Clause "Simplified" License
libraft ======= Raft protocol implementation in C. Features -------- + Leader Election + Log Replication + Log Compaction Usage ----- 1. Include raft.h and link with -lraft 2. Initialize: a. Populate a ``raft_config_t`` with parameters (host, port, timeouts, log length, etc.) b. Set an applier and a snapshooter callbacks. The applier should perform state modification, and the snapshooter should dump the state. See raft.h for their signatures. c. Call raft_init(cfg). d. Use raft_peer_up(...) to configure the peers, including the current one. e. Create and bind the socket with raft_create_udp_socket(...). 3. Serve raft: a. Call raft_tick(...) frequently to perform the logic of timeouts. b. Try to extract a message with raft_recv_message(...) when you believe there is one in the socket. c. Call raft_handle_message(...) when a message has been successfully extracted from the socket. 4. Serve clients: a. If this server is a leader (call raft_get_leader(...) to find out), then it should accept pending connections and process client quieries. b. Use raft_emit(...) to update the state though raft. Then wait until raft_applied(...) before returning the result to the client. c. You may use raft_get_leader(...) to redirect clients to the leader, though this is not necessary. Please read raft.h and example/ for more details. Testing ------- 1. Install docker and blockade. 2. You may want to gain superuser privileges at this point. 3. $ make check TODO ---- + Membership Changes
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.