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);
}
}
Aggregations