Package com.splout.db.common

Examples of com.splout.db.common.ReplicationEntry


    handler.init(SploutConfiguration.getTestConfig());

    SploutConfiguration config = SploutConfiguration.getTestConfig();
    DNode dnode = TestUtils.getTestDNode(config, dHandler, "dnode-" + this.getClass().getName() + "-2");
    try {
      ReplicationEntry repEntry = new ReplicationEntry(0, dnode.getAddress());
      Tablespace tablespace1 = new Tablespace(PartitionMap.oneShardOpenedMap(), new ReplicationMap(
          Arrays.asList(repEntry)), 0l, 0l);
      handler.getContext().getTablespaceVersionsMap()
          .put(new TablespaceVersion("tablespace1", 0l), tablespace1);
      handler.getContext().getCurrentVersionsMap().put("tablespace1", 0l);
View Full Code Here


    handler.init(SploutConfiguration.getTestConfig());

    SploutConfiguration config = SploutConfiguration.getTestConfig();
    DNode dnode = TestUtils.getTestDNode(config, dHandler, "dnode-" + this.getClass().getName() + "-6");
    try {
      ReplicationEntry repEntry = new ReplicationEntry(0, dnode.getAddress());
      Tablespace tablespace1 = new Tablespace(PartitionMap.oneShardOpenedMap(), new ReplicationMap(
          Arrays.asList(repEntry)), 0l, 0l);
      handler.getContext().getTablespaceVersionsMap()
          .put(new TablespaceVersion("tablespace1", 0l), tablespace1);
      handler.getContext().getCurrentVersionsMap().put("tablespace1", 0l);
View Full Code Here

    }, "dnode-" + this.getClass().getName() + "-4");

    QNodeHandler handler = new QNodeHandler();
    try {
      handler.init(config1);
      ReplicationEntry repEntry1 = new ReplicationEntry(0, dnode1.getAddress(), dnode2.getAddress());
      ReplicationEntry repEntry2 = new ReplicationEntry(0, dnode1.getAddress());

      DeployRequest deployRequest1 = new DeployRequest();
      deployRequest1.setTablespace("partition1");
      deployRequest1.setPartitionMap(PartitionMap.oneShardOpenedMap().getPartitionEntries());
      deployRequest1.setReplicationMap(Arrays.asList(repEntry1));
View Full Code Here

    }, "dnode-" + this.getClass().getName() + "-5");

    try {
      handler.init(config);

      ReplicationEntry repEntry = new ReplicationEntry(0, dnode.getAddress());

      DeployRequest deployRequest = new DeployRequest();
      deployRequest.setTablespace("partition1");
      deployRequest.setPartitionMap(PartitionMap.oneShardOpenedMap().getPartitionEntries());
      deployRequest.setReplicationMap(Arrays.asList(repEntry));
View Full Code Here

      partitionEntry.setMin((i * 10) + "");
      partitionEntry.setMax((i * 10 + 10) + "");
      partitionEntry.setShard(i);
      partitions.add(partitionEntry);
      // And the replication
      ReplicationEntry repEntry = new ReplicationEntry();
      repEntry.setShard(i);
      int j = i + 1;
      if(j == nDnodes) {
        j = 0;
      }
      repEntry.setNodes(Arrays.asList(new String[] { dNodes.get(i).getAddress(), dNodes.get(j).getAddress() }));
      replicationEntries.add(repEntry);
    }
    // A valid partition map is complete: first min is null and last max is null.
    partitions.get(0).setMin(null);
    partitions.get(partitions.size() - 1).setMax(null);
View Full Code Here

    uniqueShards.addAll(Arrays.asList(shards));
    assertEquals(uniqueShards.size(), tablespace.getPartitionMap().getPartitionEntries().size());
    assertEquals(uniqueShards.size(), tablespace.getReplicationMap().getReplicationEntries().size());
    int k = 0;
    for(int i = 0; i < uniqueShards.size(); i++) {
      ReplicationEntry entry = tablespace.getReplicationMap().getReplicationEntries().get(i);
      for(int j = 0; j < entry.getNodes().size(); j++, k++) {
        assertEquals(dnodes[k], entry.getNodes().get(j));
        assertEquals(shards[k], entry.getShard());
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.splout.db.common.ReplicationEntry

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.