public final class GrpcServerBuilder extends Object
Modifier and Type | Method and Description |
---|---|
GrpcServerBuilder |
addService(GrpcService serviceDefinition)
Add a service to this server.
|
GrpcServerBuilder |
addService(ServiceType serviceType,
GrpcService serviceDefinition)
Add a service to this server.
|
GrpcServerBuilder |
bossEventLoopGroup(io.netty.channel.EventLoopGroup bossGroup)
Sets the boss
EventLoopGroup . |
GrpcServer |
build()
Build the server.
|
GrpcServer |
build(java.util.function.Supplier<NodeState> nodeStateSupplier)
Build the server.
|
GrpcServerBuilder |
channelType(Class<? extends io.netty.channel.ServerChannel> channelType)
Sets the netty channel type.
|
GrpcServerBuilder |
executor(Executor executor)
Set the executor for this server.
|
GrpcServerBuilder |
flowControlWindow(int flowControlWindow)
Sets flow control window.
|
static GrpcServerBuilder |
forAddress(GrpcServerAddress serverAddress,
AlluxioConfiguration conf)
Create an new instance of
GrpcServerBuilder with authentication support. |
static GrpcServerBuilder |
forAddress(GrpcServerAddress serverAddress,
AuthenticationServer authenticationServer,
AlluxioConfiguration conf)
Create a new instance of
GrpcServerBuilder with authentication support. |
GrpcServerBuilder |
intercept(io.grpc.ServerInterceptor interceptor)
Adds an interceptor for this server.
|
GrpcServerBuilder |
keepAliveTime(long keepAliveTime,
TimeUnit timeUnit)
Sets the server keep-alive time.
|
GrpcServerBuilder |
keepAliveTimeout(long keepAliveTimeout,
TimeUnit timeUnit)
Sets the server keep-alive timeout.
|
GrpcServerBuilder |
maxInboundMessageSize(int messageSize)
Sets the maximum size of inbound messages.
|
GrpcServerBuilder |
permitKeepAlive(long permitKeepAlive,
TimeUnit timeUnit)
Sets the high-bar for client-side keep-alive frequency.
|
GrpcServerBuilder |
sslContext(io.netty.handler.ssl.SslContext sslContext)
Sets TLS context.
|
<T> GrpcServerBuilder |
withChildOption(io.netty.channel.ChannelOption<T> option,
T value)
Sets a netty channel option.
|
GrpcServerBuilder |
workerEventLoopGroup(io.netty.channel.EventLoopGroup workerGroup)
Sets the worker
EventLoopGroup . |
public static GrpcServerBuilder forAddress(GrpcServerAddress serverAddress, AlluxioConfiguration conf)
GrpcServerBuilder
with authentication support.serverAddress
- server addressconf
- Alluxio configurationGrpcServerBuilder
public static GrpcServerBuilder forAddress(GrpcServerAddress serverAddress, AuthenticationServer authenticationServer, AlluxioConfiguration conf)
GrpcServerBuilder
with authentication support.serverAddress
- server addressauthenticationServer
- the authentication server to useconf
- the Alluxio configurationGrpcServerBuilder
public GrpcServerBuilder executor(@Nullable Executor executor)
executor
- the executorGrpcServerBuilder
public GrpcServerBuilder flowControlWindow(int flowControlWindow)
flowControlWindow
- the HTTP2 flow control windowGrpcServerBuilder
public GrpcServerBuilder keepAliveTime(long keepAliveTime, TimeUnit timeUnit)
keepAliveTime
- the time to wait after idle before pinging clienttimeUnit
- unit of the timeGrpcServerBuilder
public GrpcServerBuilder keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit)
keepAliveTimeout
- time to wait after pinging client before closing the connectiontimeUnit
- unit of the timeoutGrpcServerBuilder
public GrpcServerBuilder permitKeepAlive(long permitKeepAlive, TimeUnit timeUnit)
permitKeepAlive
- permitted client-side keep-alive timetimeUnit
- unit of the timeoutGrpcServerBuilder
public GrpcServerBuilder channelType(Class<? extends io.netty.channel.ServerChannel> channelType)
channelType
- the netty channel type for the serverGrpcServerBuilder
public <T> GrpcServerBuilder withChildOption(io.netty.channel.ChannelOption<T> option, T value)
T
- channel option typeoption
- the option to be setvalue
- the new valueGrpcServerBuilder
public GrpcServerBuilder bossEventLoopGroup(io.netty.channel.EventLoopGroup bossGroup)
EventLoopGroup
.bossGroup
- the boss event loop groupGrpcServerBuilder
public GrpcServerBuilder workerEventLoopGroup(io.netty.channel.EventLoopGroup workerGroup)
EventLoopGroup
.workerGroup
- the worker event loop groupGrpcServerBuilder
public GrpcServerBuilder maxInboundMessageSize(int messageSize)
messageSize
- maximum size of the messageGrpcServerBuilder
public GrpcServerBuilder addService(ServiceType serviceType, GrpcService serviceDefinition)
serviceType
- the type of serviceserviceDefinition
- the service definition of new serviceGrpcServerBuilder
public GrpcServerBuilder addService(GrpcService serviceDefinition)
serviceDefinition
- the service definition of new serviceGrpcServerBuilder
public GrpcServerBuilder intercept(io.grpc.ServerInterceptor interceptor)
interceptor
- server interceptorGrpcServerBuilder
public GrpcServerBuilder sslContext(io.netty.handler.ssl.SslContext sslContext)
sslContext
- TLS contextGrpcServerBuilder
public GrpcServer build()
GrpcServer
public GrpcServer build(@Nullable java.util.function.Supplier<NodeState> nodeStateSupplier)
nodeStateSupplier
- a supplier to provide the node state (PRIMARY/STANDBY)GrpcServer
Copyright © 2023. All Rights Reserved.