public class SealServersHelper extends Object
Created by zlokhandwala on 3/10/17.
Constructor and Description |
---|
SealServersHelper() |
Modifier and Type | Method and Description |
---|---|
static Map<String,CompletableFuture<Boolean>> |
asyncSealServers(RuntimeLayout runtimeLayout)
Asynchronously seal all servers in layout by setting remote epochs.
|
static void |
waitForChainSegmentSeal(Layout.LayoutSegment layoutSegment,
Map<String,CompletableFuture<Boolean>> completableFutureMap)
Wait for at least one log unit servers in every stripe to be sealed.
|
static void |
waitForLayoutSeal(List<String> layoutServers,
Map<String,CompletableFuture<Boolean>> completableFutureMap)
Wait for a quorum of layout servers to respond to be sealed.
|
static void |
waitForQuorum(CompletableFuture<Boolean>[] completableFutures)
Wait for a quorum of responses from the completable futures.
|
static void |
waitForQuorumSegmentSeal(Layout.LayoutSegment layoutSegment,
Map<String,CompletableFuture<Boolean>> completableFutureMap)
Wait for a quorum of log unit servers to respond to be sealed.
|
public static Map<String,CompletableFuture<Boolean>> asyncSealServers(RuntimeLayout runtimeLayout)
runtimeLayout
- RuntimeLayout stamped with the layout to be sealed.public static void waitForLayoutSeal(List<String> layoutServers, Map<String,CompletableFuture<Boolean>> completableFutureMap) throws QuorumUnreachableException
layoutServers
- List of layout servers.completableFutureMap
- A map of completableFutures for every remoteSetEpoch call.QuorumUnreachableException
- Thrown if responses not received from a majority of
layout servers.public static void waitForChainSegmentSeal(Layout.LayoutSegment layoutSegment, Map<String,CompletableFuture<Boolean>> completableFutureMap) throws QuorumUnreachableException
layoutSegment
- Layout segment to be sealed.completableFutureMap
- A map of completableFutures for every remoteSetEpoch call.QuorumUnreachableException
- Thrown if responses not received from all the
log unit servers.public static void waitForQuorumSegmentSeal(Layout.LayoutSegment layoutSegment, Map<String,CompletableFuture<Boolean>> completableFutureMap) throws QuorumUnreachableException
layoutSegment
- Layout segment to be sealed.completableFutureMap
- A map of completableFutures for every remoteSetEpoch call.QuorumUnreachableException
- Thrown if responses not received from all the
log unit servers.public static void waitForQuorum(CompletableFuture<Boolean>[] completableFutures) throws QuorumUnreachableException
completableFutures
- An array of completableFutures of which a quorum is required.QuorumUnreachableException
- Thrown if enough responses not received.Copyright © 2019 CorfuDB. All rights reserved.