Search in sources :

Example 1 with ClusterException

use of io.pravega.common.cluster.ClusterException in project pravega by pravega.

the class SegmentMonitorLeader method triggerRebalance.

private void triggerRebalance() throws IOException {
    // Read the current mapping from the host store and write back the update after rebalancing.
    try {
        Map<Host, Set<Integer>> newMapping = segBalancer.rebalance(hostStore.getHostContainersMap(), pravegaServiceCluster.getClusterMembers());
        Map<Host, Set<Integer>> oldMapping = hostStore.getHostContainersMap();
        hostStore.updateHostContainersMap(newMapping);
        hostContainerMetrics.updateHostContainerMetrics(oldMapping, newMapping);
    } catch (ClusterException e) {
        throw new IOException(e);
    }
}
Also used : Set(java.util.Set) ClusterException(io.pravega.common.cluster.ClusterException) Host(io.pravega.common.cluster.Host) IOException(java.io.IOException)

Aggregations

ClusterException (io.pravega.common.cluster.ClusterException)1 Host (io.pravega.common.cluster.Host)1 IOException (java.io.IOException)1 Set (java.util.Set)1