Examples of BalanceAction


Examples of com.splout.db.qnode.ReplicaBalancer.BalanceAction

  private class BalanceActionItemListener implements
      EntryListener<ReplicaBalancer.BalanceAction, String> {

    @Override
    public void entryAdded(EntryEvent<BalanceAction, String> event) {
      BalanceAction action = event.getKey();
      if(action.getOriginNode().equals(whoAmI())) {
        // I must do a balance action!
        File toSend = new File(getLocalStorageFolder(action.getTablespace(), action.getPartition(),
            action.getVersion()), action.getPartition() + ".db");
        File metadataFile = getLocalMetadataFile(action.getTablespace(), action.getPartition(),
            action.getVersion());
        // send both the .db and the .meta file -> when the other part has both files it will move them atomically...
        httpExchanger.send(action.getTablespace(), action.getPartition(), action.getVersion(), toSend,
            action.getFinalNode(), false);
        httpExchanger.send(action.getTablespace(), action.getPartition(), action.getVersion(),
            metadataFile, action.getFinalNode(), false);
      }
    }
View Full Code Here

Examples of com.splout.db.qnode.ReplicaBalancer.BalanceAction

      // first remove the local tracking of this action
      String lookupKey = tablespace + "_" + partition + "_" + version;
      if(balanceActionsStateMap.containsKey(lookupKey)) {
        balanceActionsStateMap.remove(lookupKey);
        // then remove from HZ
        BalanceAction actionToRemove = null;
        for(Map.Entry<BalanceAction, String> actionEntry : coord.getDNodeReplicaBalanceActionsSet()
            .entrySet()) {
          BalanceAction action = actionEntry.getKey();
          if(action.getTablespace().equals(tablespace) && action.getPartition() == partition
              && action.getVersion() == version && action.getFinalNode().equals(httpExchanger.address())) {
            actionToRemove = action;
          }
        }
        if(actionToRemove == null) {
          // no need to worry - another thread might have gone into this code already almost simultaneously
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.