public class LayoutManagementView extends AbstractView
Created by zlokhandwala on 11/1/17.
Constructor and Description |
---|
LayoutManagementView(CorfuRuntime runtime) |
Modifier and Type | Method and Description |
---|---|
void |
addLogUnitReplica(Layout currentLayout,
String endpoint,
int stripeIndex)
Add the log unit to the segment to increase redundancy.
|
void |
addNode(Layout currentLayout,
String endpoint,
boolean isLayoutServer,
boolean isSequencerServer,
boolean isLogUnitServer,
boolean isUnresponsiveServer,
int logUnitStripeIndex)
Adds a new node to the existing layout.
|
CompletableFuture<Boolean> |
asyncSequencerBootstrap(Layout layout,
ExecutorService service)
Triggers a new task to bootstrap the sequencer for the specified layout.
|
boolean |
attemptClusterRecovery(Layout recoveryLayout)
On restart, if MANAGEMENT_LAYOUT exists in the local datastore.
|
CompletableFuture<Boolean> |
bootstrapNewNode(String endpoint)
Bootstraps the new node with the current layout.
|
void |
forceLayout(Layout currentLayout,
Layout forceLayout)
Attempts to force commit a new layout to the cluster.
|
void |
handleFailure(IReconfigurationHandlerPolicy failureHandlerPolicy,
Layout currentLayout,
Set<String> failedServers)
Takes in the existing layout and a set of failed nodes.
|
void |
healNode(Layout currentLayout,
String endpoint)
Heals an existing node in the layout.
|
void |
mergeSegments(Layout currentLayout)
Attempts to merge the last 2 segments.
|
void |
reconfigureSequencerServers(Layout originalLayout,
Layout newLayout,
boolean forceReconfigure)
Reconfigures the sequencer.
|
void |
removeNode(Layout currentLayout,
String endpoint)
Best effort attempt to removes a node from the layout.
|
getCurrentLayout, layoutHelper, layoutHelper
public LayoutManagementView(@NonNull CorfuRuntime runtime)
public boolean attemptClusterRecovery(Layout recoveryLayout)
recoveryLayout
- Layout to use to recoverpublic void handleFailure(IReconfigurationHandlerPolicy failureHandlerPolicy, Layout currentLayout, Set<String> failedServers) throws OutrankedException, LayoutModificationException
currentLayout
- The current layoutfailedServers
- Set of failed server addressesOutrankedException
LayoutModificationException
public CompletableFuture<Boolean> bootstrapNewNode(String endpoint)
endpoint
- New node endpoint.public void addNode(@Nonnull Layout currentLayout, @Nonnull String endpoint, boolean isLayoutServer, boolean isSequencerServer, boolean isLogUnitServer, boolean isUnresponsiveServer, int logUnitStripeIndex) throws OutrankedException
currentLayout
- Current layout.endpoint
- New endpoint to be added.isLayoutServer
- is a layout serverisSequencerServer
- is a sequencer serverisLogUnitServer
- is a log unit serverisUnresponsiveServer
- is an unresponsive serverlogUnitStripeIndex
- stripe index to be added into if its a log unit.OutrankedException
- if consensus outranked.public void healNode(Layout currentLayout, String endpoint) throws OutrankedException
currentLayout
- Current layout.endpoint
- New endpoint to be added.OutrankedException
- if consensus outranked.public void mergeSegments(Layout currentLayout) throws OutrankedException
currentLayout
- Current layoutOutrankedException
- if consensus is outranked.public void addLogUnitReplica(@Nonnull Layout currentLayout, @Nonnull String endpoint, int stripeIndex) throws OutrankedException
currentLayout
- Current layout.endpoint
- Endpoint to be added to the segment.stripeIndex
- Stripe index.OutrankedException
- if consensus is outranked.public void removeNode(@Nonnull Layout currentLayout, @Nonnull String endpoint) throws OutrankedException
currentLayout
- the layout to remove the node fromendpoint
- the node to removeOutrankedException
public void forceLayout(@Nonnull Layout currentLayout, @Nonnull Layout forceLayout)
currentLayout
- the current layoutforceLayout
- the new layout to forceQuorumUnreachableException
public void reconfigureSequencerServers(Layout originalLayout, Layout newLayout, boolean forceReconfigure)
originalLayout
- Current layout to get the latest state of servers.newLayout
- New Layout to be reconfigured.forceReconfigure
- Flag to force reconfiguration.public CompletableFuture<Boolean> asyncSequencerBootstrap(@NonNull Layout layout, @NonNull ExecutorService service)
layout
- Layout to use to bootstrap the primary sequencer.Copyright © 2019 CorfuDB. All rights reserved.