Package voldemort.server.rebalance

Examples of voldemort.server.rebalance.VoldemortRebalancingException


                        }
                    }
                }

                if(exceptions.size() > 0) {
                    throw new VoldemortRebalancingException("Got exceptions from nodes "
                                                            + exceptions.keySet());
                }

                /*
                 * If everything went smoothly, update the version of the
                 * cluster metadata
                 */
                if(changeClusterMetadata) {
                    try {
                        metadataMgmtOps.updateMetadataversion(CLUSTER_VERSION_KEY);
                    } catch(Exception e) {
                        logger.info("Exception occurred while setting cluster metadata version during Rebalance state change !!!");
                    }
                }
            } catch(Exception e) {

                if(rollback) {
                    logger.error("Got exceptions from nodes " + exceptions.keySet()
                                 + " while changing state. Rolling back state on "
                                 + completedNodeIds);

                    // Rollback changes on completed nodes
                    for(int completedNodeId: completedNodeIds) {
                        try {
                            individualStateChange(completedNodeId,
                                                  existingCluster,
                                                  existingStoreDefs,
                                                  stealerNodeToRebalanceTasks.get(completedNodeId),
                                                  swapRO,
                                                  changeClusterMetadata,
                                                  changeRebalanceState,
                                                  true);
                        } catch(Exception exception) {
                            logger.error("Error while reverting back state change for completed node "
                                                 + completedNodeId,
                                         exception);
                        }
                    }
                } else {
                    logger.error("Got exceptions from nodes " + exceptions.keySet()
                                 + " while changing state");
                }
                throw new VoldemortRebalancingException("Got exceptions from nodes "
                                                                + exceptions.keySet()
                                                                + " while changing state",
                                                        Lists.newArrayList(exceptions.values()));
            }

View Full Code Here


        public void checkEachServerInNormalState(final Cluster cluster) {
            for(Node node: cluster.getNodes()) {
                Versioned<VoldemortState> versioned = rebalanceOps.getRemoteServerState(node.getId());

                if(!VoldemortState.NORMAL_SERVER.equals(versioned.getValue())) {
                    throw new VoldemortRebalancingException("Cannot rebalance since node "
                                                            + node.getId() + " (" + node.getHost()
                                                            + ") is not in normal state, but in "
                                                            + versioned.getValue());
                } else {
                    if(logger.isInfoEnabled()) {
View Full Code Here

                    for(Entry<String, String> storeToStorageFormat: readonlyOps.getROStorageFormat(node.getId(),
                                                                                                   storeNames)
                                                                               .entrySet()) {
                        if(storeToStorageFormat.getValue()
                                               .compareTo(ReadOnlyStorageFormat.READONLY_V2.getCode()) != 0) {
                            throw new VoldemortRebalancingException("Cannot rebalance since node "
                                                                    + node.getId()
                                                                    + " has store "
                                                                    + storeToStorageFormat.getKey()
                                                                    + " not using format "
                                                                    + ReadOnlyStorageFormat.READONLY_V2);
View Full Code Here

        try {
            doneSignal.await();
        } catch(InterruptedException e) {
            logger.error("RebalancController scheduler interrupted while waiting for rebalance "
                         + "tasks to be scheduled.", e);
            throw new VoldemortRebalancingException("RebalancController scheduler interrupted "
                                                    + "while waiting for rebalance tasks to be "
                                                    + "scheduled.");
        }
    }
View Full Code Here

                    if(executeService) {
                        service.execute(sbTask);
                    }
                } catch(RejectedExecutionException ree) {
                    logger.error("Rebalancing task rejected by executor service.", ree);
                    throw new VoldemortRebalancingException("Rebalancing task rejected by executor service.");
                }
                return sbTask;
            }
        }
        return null;
View Full Code Here

                    incompleteTasks.add(task);
                }
            }

            if(failedTasks.size() > 0) {
                throw new VoldemortRebalancingException("Rebalance task terminated unsuccessfully on tasks "
                                                                + failedTasks,
                                                        failures);
            }

            // If there were no failures, then we could have had a genuine
View Full Code Here

        }
        for(int nodeId: subsetCluster.getNodeIds()) {
            Node supersetNode = supersetCluster.getNodeById(nodeId);
            Node subsetNode = subsetCluster.getNodeById(nodeId);
            if(!supersetNode.getPartitionIds().equals(subsetNode.getPartitionIds())) {
                throw new VoldemortRebalancingException("Partition IDs do not match between clusters for nodes with id "
                                                        + nodeId
                                                        + " : subset cluster has "
                                                        + subsetNode.getPartitionIds()
                                                        + " and superset cluster has "
                                                        + supersetNode.getPartitionIds());
            }
        }
        Set<Integer> nodeIds = supersetCluster.getNodeIds();
        nodeIds.removeAll(subsetCluster.getNodeIds());
        for(int nodeId: nodeIds) {
            Node supersetNode = supersetCluster.getNodeById(nodeId);
            if(!supersetNode.getPartitionIds().isEmpty()) {
                throw new VoldemortRebalancingException("New node "
                                                        + nodeId
                                                        + " in superset cluster already has partitions: "
                                                        + supersetNode.getPartitionIds());
            }
        }
View Full Code Here

                updateStatus(getHeader(stealInfo) + "Rebalance of " + partitionStoreCount
                             + " partition-stores completed successfully for all "
                             + totalStoresCount + " stores");
                metadataStore.deleteRebalancingState(stealInfo);
            } else {
                throw new VoldemortRebalancingException(getHeader(stealInfo)
                                                        + "Failed to rebalance task " + stealInfo
                                                        + ". Could only complete "
                                                        + completedStoresCount.get() + " out of "
                                                        + totalStoresCount + " stores", failures);
            }
View Full Code Here

TOP

Related Classes of voldemort.server.rebalance.VoldemortRebalancingException

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.