Search in sources :

Example 16 with Host

use of io.pravega.common.cluster.Host 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());
        hostStore.updateHostContainersMap(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

Host (io.pravega.common.cluster.Host)16 Test (org.junit.Test)9 Set (java.util.Set)8 CuratorFramework (org.apache.curator.framework.CuratorFramework)7 Cleanup (lombok.Cleanup)6 HostControllerStore (io.pravega.controller.store.host.HostControllerStore)5 StreamTransactionMetadataTasks (io.pravega.controller.task.Stream.StreamTransactionMetadataTasks)5 SegmentHelper (io.pravega.controller.server.SegmentHelper)4 StreamMetadataStore (io.pravega.controller.store.stream.StreamMetadataStore)4 TaskMetadataStore (io.pravega.controller.store.task.TaskMetadataStore)4 ContainerHandle (io.pravega.segmentstore.server.ContainerHandle)4 SegmentContainerRegistry (io.pravega.segmentstore.server.SegmentContainerRegistry)4 ConnectionFactoryImpl (io.pravega.client.netty.impl.ConnectionFactoryImpl)3 Cluster (io.pravega.common.cluster.Cluster)3 StreamMetadataTasks (io.pravega.controller.task.Stream.StreamMetadataTasks)3 TxnSweeper (io.pravega.controller.task.Stream.TxnSweeper)3 TaskSweeper (io.pravega.controller.task.TaskSweeper)3 IOException (java.io.IOException)3 HashMap (java.util.HashMap)3 ExponentialBackoffRetry (org.apache.curator.retry.ExponentialBackoffRetry)3