Giter Club home page Giter Club logo

cmraft's Introduction

Project CmRaft

Project CmRaft is a Java implementation of Raft algorithm, which is a consensus algorithm that is designed to be easy to understand. It's equivalent to Paxos in fault-tolerance and performance. The difference is that it's decomposed into relatively independent subproblems, and it cleanly addresses all major pieces needed for practical systems. Check this link for more detailed information about Raft algorithm: https://raftconsensus.github.io/

CmRaft implemented leader election, log replication and log persistence so far. Membership changing and log compaction will be implemented soon.

Build

Prerequisites:

  • JDK 1.7
  • Maven 3.x

Download source code:

	git clone https://github.com/chicm/CmRaft.git

Compile and make tar ball:

	mvn package -DskipTests

Import to eclipse:

	mvn eclispe:eclipse

Then use eclipse to open the project. To run a unit test, which will create a local cluster and test the basic functions in command line console:

	maven test

Key value store APIs usage:

Key value store APIs allow users to manipulate key value pairs against a replicated key value store inside CmRaft cluster, including adding, updating, deleting, listing, etc. It's very simple to use key value store APIs:

	try(Connection conn = ConnectionManager.getConnection()) { 
		KeyValueStore kvs = conn.getKeyValueStore();
		kvs.set("key1", "value1"); 
		kvs.set("key1", "value2"); 
		kvs.delete("key1");  
		String value = kvs.get("key1");  
		List<KeyValue> result = kvs.list(); 
	} finally {
	}

cmraft's People

Contributors

chicm avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.