Package net.kuujo.copycat.cluster

Examples of net.kuujo.copycat.cluster.LocalClusterConfig


   */
  protected Set<Copycat> createCluster(int numInstances) {
    LocalProtocol protocol = new LocalProtocol();
    Set<Copycat> instances = new HashSet<>(numInstances);
    for (int i = 1; i <= numInstances; i++) {
      LocalClusterConfig config = new LocalClusterConfig();
      config.setLocalMember(String.valueOf(i));
      for (int j = 1; j <= numInstances; j++) {
        if (j != i) {
          config.addRemoteMember(String.valueOf(j));
        }
      }

      instances
          .add(Copycat
View Full Code Here


public class KeyValueStore implements StateMachine {
  private Map<String, Object> data = new HashMap<>();

  public static void main(String[] args) {
    LocalClusterConfig clusterConfig = new LocalClusterConfig();
    clusterConfig.setLocalMember("tcp://localhost:8080");
    clusterConfig.setRemoteMembers("tcp://localhost:8081", "tcp://localhost:8082");

    Copycat.builder()
      .withStateMachine(new KeyValueStore())
      .withLog(new InMemoryLog())
      .withCluster(new Cluster(clusterConfig))
View Full Code Here

TOP

Related Classes of net.kuujo.copycat.cluster.LocalClusterConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.