Package com.splout.db.qnode.beans

Examples of com.splout.db.qnode.beans.SwitchVersionRequest


            return;
          }

          Iterator<SwitchVersionRequest> it = versionsToCheck.iterator();
          while(it.hasNext()) {
            SwitchVersionRequest req = it.next();
            Tablespace t = context.getTablespaceVersionsMap().get(
                new TablespaceVersion(req.getTablespace(), req.getVersion()));
            // Check that this TablespaceVersion has been reported by some node through Hazelcast
            if(t != null && t.getReplicationMap() != null && t.getPartitionMap() != null
                && t.getPartitionMap().getPartitionEntries() != null
                && t.getReplicationMap().getReplicationEntries() != null
                && t.getReplicationMap().getReplicationEntries().size() > 0) {
              if(t.getPartitionMap().getPartitionEntries().size() == t.getReplicationMap()
                  .getReplicationEntries().size()) {
                log.info("Ok, TablespaceVersion [" + req.getTablespace() + ", " + req.getVersion()
                    + "] being handled by enough DNodes as reported by Hazelcast. ("
                    + t.getReplicationMap().getReplicationEntries() + ")");
                it.remove();
              }
            }
View Full Code Here


     * @return
     */
    private List<SwitchVersionRequest> switchActions() {
      ArrayList<SwitchVersionRequest> actions = new ArrayList<SwitchVersionRequest>();
      for(DeployRequest req : deployRequests) {
        actions.add(new SwitchVersionRequest(req.getTablespace(), version));
      }
      return actions;
    }
View Full Code Here

      coord.getVersionsBeingServed().put(CoordinationStructures.VERSIONS_BEING_SERVED, versionsBeingServed);

      handler.init(config);
     
      List<SwitchVersionRequest> rRequest = new ArrayList<SwitchVersionRequest>();
      SwitchVersionRequest theRequest = new SwitchVersionRequest("t1", 3);
      rRequest.add(theRequest);
      handler.rollback(rRequest);
     
      new TestUtils.NotWaitingForeverCondition() {
        @Override
        public boolean endCondition() {
          return handler.getContext().getCurrentVersionsMap().get("t1") != null &&
              handler.getContext().getCurrentVersionsMap().get("t1") == 3l;
        }
      }.waitAtMost(5000);
     
      assertEquals(3l, (long)coord.getCopyVersionsBeingServed().get("t1"));
     
      /*
       * Changing our mind : now back to previous version 4
       */
      theRequest = new SwitchVersionRequest("t1", 4);
      rRequest = new ArrayList<SwitchVersionRequest>();
      rRequest.add(theRequest);
      handler.rollback(rRequest);
           
      new TestUtils.NotWaitingForeverCondition() {
View Full Code Here

      List<SwitchVersionRequest> rRequest = new ArrayList<SwitchVersionRequest>();

      // T1 -> rollback to version 2
      // T2 -> rollback to version 1
      // T3 -> rollback to version 0
      SwitchVersionRequest theRequest = new SwitchVersionRequest("t1", 2l);
      rRequest.add(theRequest);
      theRequest = new SwitchVersionRequest("t2", 1l);
      rRequest.add(theRequest);
      theRequest = new SwitchVersionRequest("t3", 0l);
      rRequest.add(theRequest);
     
      handler.rollback(rRequest);
     
      new TestUtils.NotWaitingForeverCondition() {
View Full Code Here

TOP

Related Classes of com.splout.db.qnode.beans.SwitchVersionRequest

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.