public final class GrpcChannelBuilder extends Object
GrpcServer
at the target during channel
building.Modifier and Type | Method and Description |
---|---|
GrpcChannel |
build()
Creates an authenticated channel of type
GrpcChannel . |
GrpcChannelBuilder |
disableAuthentication()
Disables authentication with the server.
|
static GrpcChannelBuilder |
newBuilder(GrpcServerAddress address,
AlluxioConfiguration conf)
Create a channel builder for given address using the given configuration.
|
GrpcChannelBuilder |
setChannelType(Class<? extends io.netty.channel.Channel> channelType)
Sets the channel type.
|
GrpcChannelBuilder |
setClientType(String clientType)
Sets human readable name for the channel's client.
|
GrpcChannelBuilder |
setCredentials(String userName,
String password,
String impersonationUser)
Sets authentication content.
|
GrpcChannelBuilder |
setEventLoopGroup(io.netty.channel.EventLoopGroup group)
Sets the event loop group.
|
GrpcChannelBuilder |
setFlowControlWindow(int flowControlWindow)
Sets the flow control window.
|
GrpcChannelBuilder |
setKeepAliveTime(long keepAliveTime,
TimeUnit timeUnit)
Sets the time to wait after receiving last message before pinging the server.
|
GrpcChannelBuilder |
setKeepAliveTimeout(long keepAliveTimeout,
TimeUnit timeUnit)
Sets the maximum time waiting for response after pinging server before closing connection.
|
GrpcChannelBuilder |
setMaxInboundMessageSize(int maxInboundMessaageSize)
Sets the maximum message size allowed for a single gRPC frame.
|
GrpcChannelBuilder |
setPoolingStrategy(GrpcChannelKey.PoolingStrategy strategy)
Sets the pooling strategy.
|
GrpcChannelBuilder |
setSubject(Subject subject)
Sets
Subject for authentication. |
public static GrpcChannelBuilder newBuilder(GrpcServerAddress address, AlluxioConfiguration conf)
address
- the host addressconf
- Alluxio configurationGrpcChannelBuilder
public GrpcChannelBuilder setClientType(String clientType)
clientType
- client typeGrpcChannelBuilder
instancepublic GrpcChannelBuilder setSubject(Subject subject)
Subject
for authentication.subject
- the subjectGrpcChannelBuilder
instancepublic GrpcChannelBuilder setCredentials(String userName, String password, String impersonationUser)
setSubject(javax.security.auth.Subject)
.userName
- the usernamepassword
- the passwordimpersonationUser
- the impersonation userGrpcChannelBuilder
instancepublic GrpcChannelBuilder disableAuthentication()
GrpcChannelBuilder
instancepublic GrpcChannelBuilder setKeepAliveTime(long keepAliveTime, TimeUnit timeUnit)
keepAliveTime
- the time to wait after receiving last message before pinging servertimeUnit
- unit of the timeGrpcChannelBuilder
instancepublic GrpcChannelBuilder setKeepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit)
keepAliveTimeout
- the time to wait after pinging server before closing the connectiontimeUnit
- unit of the timeoutGrpcChannelBuilder
instancepublic GrpcChannelBuilder setMaxInboundMessageSize(int maxInboundMessaageSize)
maxInboundMessaageSize
- the maximum inbound message size in bytesGrpcChannelBuilder
public GrpcChannelBuilder setFlowControlWindow(int flowControlWindow)
flowControlWindow
- the flow control window in bytesGrpcChannelBuilder
public GrpcChannelBuilder setChannelType(Class<? extends io.netty.channel.Channel> channelType)
channelType
- the channel typeGrpcChannelBuilder
public GrpcChannelBuilder setEventLoopGroup(io.netty.channel.EventLoopGroup group)
group
- the event loop groupGrpcChannelBuilder
public GrpcChannelBuilder setPoolingStrategy(GrpcChannelKey.PoolingStrategy strategy)
strategy
- the pooling strategyGrpcChannelBuilder
public GrpcChannel build() throws AlluxioStatusException
GrpcChannel
.GrpcChannel
AlluxioStatusException
Copyright © 2023. All Rights Reserved.