public class CorfuServer extends Object
The command line options are documented in the USAGE variable.
Created by mwei on 11/30/15.
Modifier and Type | Class and Description |
---|---|
static interface |
CorfuServer.BootstrapConfigurer
A functional interface for receiving and configuring a
ServerBootstrap . |
Constructor and Description |
---|
CorfuServer() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanShutdown(List<AbstractServer> servers)
Attempt to cleanly shutdown all the servers.
|
static void |
configureBootstrapOptions(ServerContext context,
io.netty.bootstrap.ServerBootstrap bootstrap)
Configure server bootstrap per-channel options, such as TCP options, etc.
|
static void |
main(String[] args)
Main program entry point.
|
static void |
restartServer(ServerContext serverContext,
boolean resetData)
Cleanly shuts down the server and restarts.
|
static io.netty.channel.ChannelFuture |
startAndListen(io.netty.channel.EventLoopGroup bossGroup,
io.netty.channel.EventLoopGroup workerGroup,
CorfuServer.BootstrapConfigurer bootstrapConfigurer,
ServerContext context,
NettyServerRouter router,
String address,
int port)
Start the Corfu server and bind it to the given
port using the provided
channelType . |
static void |
startServer(Map<String,Object> opts,
boolean bindToAllInterfaces)
Creates all the components of the Corfu Server.
|
public static void main(String[] args) throws Exception
args
- command line argument stringsException
public static void startServer(Map<String,Object> opts, boolean bindToAllInterfaces)
opts
- Options passed by the user.public static io.netty.channel.ChannelFuture startAndListen(@Nonnull io.netty.channel.EventLoopGroup bossGroup, @Nonnull io.netty.channel.EventLoopGroup workerGroup, @Nonnull CorfuServer.BootstrapConfigurer bootstrapConfigurer, @Nonnull ServerContext context, @Nonnull NettyServerRouter router, String address, int port)
port
using the provided
channelType
. It is the callers' responsibility to shutdown the
EventLoopGroup
s. For implementations which listen on multiple ports,
EventLoopGroup
s may be reused.bossGroup
- The "boss" EventLoopGroup
which services incoming
connections.workerGroup
- The "worker" EventLoopGroup
which services incoming
requests.bootstrapConfigurer
- A CorfuServer.BootstrapConfigurer
which will receive the
ServerBootstrap
to set options.context
- A ServerContext
which will be used to configure the
server.router
- A NettyServerRouter
which will process incoming
messages.port
- The port the ServerChannel
will be created on.ChannelFuture
which can be used to wait for the server
to be shutdown.public static void configureBootstrapOptions(@Nonnull ServerContext context, @Nonnull io.netty.bootstrap.ServerBootstrap bootstrap)
context
- The ServerContext
to use.bootstrap
- The ServerBootstrap
to be configured.public static void restartServer(ServerContext serverContext, boolean resetData)
serverContext
- Server Context.resetData
- Resets and clears all data if True.public static void cleanShutdown(@Nonnull List<AbstractServer> servers)
Copyright © 2019 CorfuDB. All rights reserved.