org.robotninjas.barge:barge-core

JVM Raft Concensus Implementation

License

License

Categories

Categories

Ninja User Interface Web Frameworks
GroupId

GroupId

org.robotninjas.barge
ArtifactId

ArtifactId

barge-core
Last Version

Last Version

0.1.0-alpha1
Release Date

Release Date

Type

Type

jar
Description

Description

JVM Raft Concensus Implementation

Download barge-core

How to add to project

<!-- https://jarcasting.com/artifacts/org.robotninjas.barge/barge-core/ -->
<dependency>
    <groupId>org.robotninjas.barge</groupId>
    <artifactId>barge-core</artifactId>
    <version>0.1.0-alpha1</version>
</dependency>
// https://jarcasting.com/artifacts/org.robotninjas.barge/barge-core/
implementation 'org.robotninjas.barge:barge-core:0.1.0-alpha1'
// https://jarcasting.com/artifacts/org.robotninjas.barge/barge-core/
implementation ("org.robotninjas.barge:barge-core:0.1.0-alpha1")
'org.robotninjas.barge:barge-core:jar:0.1.0-alpha1'
<dependency org="org.robotninjas.barge" name="barge-core" rev="0.1.0-alpha1">
  <artifact name="barge-core" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.robotninjas.barge', module='barge-core', version='0.1.0-alpha1')
)
libraryDependencies += "org.robotninjas.barge" % "barge-core" % "0.1.0-alpha1"
[org.robotninjas.barge/barge-core "0.1.0-alpha1"]

Dependencies

compile (9)

Group / Artifact Type Version
org.robotninjas : protorpc jar 0.1.0-alpha1
com.google.guava : guava jar 15.0
com.google.inject : guice jar 3.0
com.google.inject.extensions : guice-assistedinject jar 3.0
org.slf4j : slf4j-api jar 1.7.5
commons-pool : commons-pool jar 1.6
com.github.sbtourist : journalio jar 1.4.1
io.netty : netty-all jar 4.0.11.Final
com.google.code.findbugs : jsr305 Optional jar 1.3.9

runtime (1)

Group / Artifact Type Version
ch.qos.logback : logback-classic Optional jar 1.0.11

test (2)

Group / Artifact Type Version
junit : junit jar 4.9
org.mockito : mockito-all jar 1.8.0

Project Modules

There are no modules declared in this project.

Build Status

barge (ALPHA)

An implementation of the Raft Consensus Protocol.

Todo

Barge is still a work in progress, two major missing features are:

  • Log Compaction (alpha2)
  • Dynamic Membership (alpha2)

Roadmap

Barge is currently at 0.1.0-alpha1. I intend to release an alpha2 when the library is feature complete from the standpoint of the paper. Interest and involvement will determine how the library progresses past the alpha stage.

Get It

<dependency>
    <groupId>org.robotninjas.barge</groupId>
    <artifactId>barge-core</artifactId>
    <version>0.1.0-alpha1</version>
</dependency>

Use It

public class Test implements StateMachine {

  @Override
  public void applyOperation(@Nonnull ByteBuffer entry) {
    System.out.println(entry.getLong());
  }

  public static void main(String... args) throws Exception {

    ClusterConfig config = ClusterConfig.from(
      Replica.fromString("localhost:10000"), // local
      Replica.fromString("localhost:10001"), // remote
      Replica.fromString("localhost:10002")  // remote
    );

    File logDir = new File(args[0]);
    logDir.mkdir();

    // configure the service
    RaftService raft = 
      RaftService.newBuilder(config)
        .logDir(logDir)
        .timeout(300)
        .build(new Test());

    // start this replica
    raft.startAsync().awaitRunning();
    
    // let's commit some things
    for (int i = 0; i < 10; i++) {
      raft.commit(new byte[] {'O', '_', 'o'}).get();
    }

  }

}

Versions

Version
0.1.0-alpha1