Package com.splout.db.common

Examples of com.splout.db.common.ReplicationMap


        repEntry.setShard(i);
        repEntry.setNodes(Arrays.asList(new String[] { "localhost:" + dNodeConfig.getInt(DNodeProperties.PORT) }));
        replicationEntries.add(repEntry);
      }

      Tablespace tablespace1 = new Tablespace(new PartitionMap(partitions), new ReplicationMap(replicationEntries), 1l,
          0l);
      handler.getContext().getTablespaceVersionsMap().put(new TablespaceVersion("tablespace1", 1l), tablespace1);
      handler.getContext().getCurrentVersionsMap().put("tablespace1", 1l);

      // The following has to be read as: multi-query range [23-25)
View Full Code Here


      // wait until replica balancer re-balanced the under-replicated partition
      new TestUtils.NotWaitingForeverCondition() {
       
        @Override
        public boolean endCondition() {
          ReplicationMap map = handler.getContext().getTablespaceVersionsMap().values().iterator().next().getReplicationMap();
          return map.getReplicationEntries().get(0).getNodes().size() == 2;
        }
      }.waitAtMost(5000);

      // everything OK
    } finally {
View Full Code Here

    QNodeHandlerContext context = new QNodeHandlerContext(testConfig, null);

    List<ReplicationEntry> rEntries = new ArrayList<ReplicationEntry>();
    rEntries.add(new ReplicationEntry(0, "localhost:4444", "localhost:5555", "localhost:6666"));

    Tablespace tablespace = new Tablespace(PartitionMap.oneShardOpenedMap(), new ReplicationMap(rEntries), 0, 0);
    context.getTablespaceVersionsMap().put(new TablespaceVersion("t1", 0l), tablespace);
    context.getCurrentVersionsMap().put("t1", 0l);

    Querier querier = new Querier(context);
   
View Full Code Here

    List<ReplicationEntry> rEntries = new ArrayList<ReplicationEntry>();
    rEntries.add(new ReplicationEntry(0, dnode1.getAddress(), dnode2.getAddress()));

    QNodeHandlerContext context = new QNodeHandlerContext(testConfig, null);
   
    Tablespace tablespace = new Tablespace(PartitionMap.oneShardOpenedMap(), new ReplicationMap(rEntries), 0, 0);
    context.getTablespaceVersionsMap().put(new TablespaceVersion("t1", 0l), tablespace);
    context.getCurrentVersionsMap().put("t1", 0l);

    Querier querier = new Querier(context);
   
View Full Code Here

    List<ReplicationEntry> rEntries = new ArrayList<ReplicationEntry>();
    rEntries.add(new ReplicationEntry(0, dnode1.getAddress(), "fakeaddress:1111", dnode2.getAddress(), "fakeaddress:2222"));

    QNodeHandlerContext context = new QNodeHandlerContext(testConfig, null);
   
    Tablespace tablespace = new Tablespace(PartitionMap.oneShardOpenedMap(), new ReplicationMap(rEntries), 0, 0);
    context.getTablespaceVersionsMap().put(new TablespaceVersion("t1", 0l), tablespace);
    context.getCurrentVersionsMap().put("t1", 0l);

    Querier querier = new Querier(context);
   
View Full Code Here

            log.info("Removing empty tablespaceVersion: " + tablespaceVersion
                + " due to explicit leaving from node " + dNodeInfo.getAddress());
            tablespaceVersionMap.remove(tablespaceVersion);
          } else {
            // Update the info in memory
            currentTablespace = new Tablespace(new PartitionMap(partitionMap), new ReplicationMap(
                replicationMap), versionName, deployDate);
            tablespaceVersionMap.put(tablespaceVersion, currentTablespace);
          }
        }
      }
View Full Code Here

    List<ReplicationEntry> rEntries = new ArrayList<ReplicationEntry>();
    rEntries.add(new ReplicationEntry(0, dnode1.getAddress(), "failingaddress:1111", dnode2.getAddress(), "failingaddress:2222"));

    QNodeHandlerContext context = new QNodeHandlerContext(testConfig, null);
   
    Tablespace tablespace = new Tablespace(PartitionMap.oneShardOpenedMap(), new ReplicationMap(rEntries), 0, 0);
    context.getTablespaceVersionsMap().put(new TablespaceVersion("t1", 0l), tablespace);
    context.getCurrentVersionsMap().put("t1", 0l);

    Querier querier = new Querier(context);
   
View Full Code Here

   
    Map<TablespaceVersion, Tablespace> tablespaceVersion = context.getTablespaceVersionsMap();
    log.info(Thread.currentThread() + " - Tablespace versions: " + tablespaceVersion);
   
    for(Map.Entry<TablespaceVersion, Tablespace> entry : tablespaceVersion.entrySet()) {
      ReplicationMap replicationMap = entry.getValue().getReplicationMap();
      for(ReplicationEntry rEntry : replicationMap.getReplicationEntries()) {
        log.info(rEntry);
        // for every missing replica... maybe perform a BalanceAction
        if(rEntry.getNodes().size() > 0) {
          for(int i = rEntry.getNodes().size(); i < rEntry.getExpectedReplicationFactor(); i++) {
            // we found an under-replicated partition! add it as candidate
View Full Code Here

    DNode dnode1 = TestUtils.getTestDNode(config1, failingDHandler, "dnode-" + this.getClass().getName() + "-1");
    DNode dnode2 = TestUtils.getTestDNode(config2, dHandler, "dnode-" + this.getClass().getName() + "-2");

    try {
      ReplicationEntry repEntry = new ReplicationEntry(0, dnode1.getAddress(), dnode2.getAddress());
      Tablespace tablespace1 = new Tablespace(PartitionMap.oneShardOpenedMap(), new ReplicationMap(Arrays.asList(repEntry)), 1l, 0l);
      handler.getContext().getTablespaceVersionsMap().put(new TablespaceVersion("tablespace1", 1l), tablespace1);
      handler.getContext().getCurrentVersionsMap().put("tablespace1", 1l);

      QueryStatus qStatus = handler.query("tablespace1", "2", "SELECT 1;", null);
      Assert.assertEquals(new Integer(0), qStatus.getShard());
View Full Code Here

    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

TOP

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

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.