Package alluxio.grpc
Class GrpcChannelBuilder
- java.lang.Object
-
- alluxio.grpc.GrpcChannelBuilder
-
public class GrpcChannelBuilder extends java.lang.Object
A gRPC channel builder that authenticates withGrpcServer
at the target during channel building.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
GrpcChannelBuilder(GrpcServerAddress address, AlluxioConfiguration conf, AuthType authType, boolean alwaysEnableTLS)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GrpcChannel
build()
Creates an authenticated channel of typeGrpcChannel
.GrpcChannelBuilder
disableAuthentication()
Disables authentication with the server.protected GrpcServerAddress
getAddress()
protected boolean
getAlwaysEnableTLS()
protected AuthType
getAuthType()
protected AlluxioConfiguration
getConfiguration()
protected GrpcNetworkGroup
getNetworkGroup()
protected javax.security.auth.Subject
getParentSubject()
static GrpcChannelBuilder
newBuilder(GrpcServerAddress address, AlluxioConfiguration conf)
Create a channel builder for given address using the given configuration.static GrpcChannelBuilder
newBuilder(GrpcServerAddress address, AlluxioConfiguration conf, boolean alwaysEnableTLS)
Create a channel builder for given address using the given configuration.static GrpcChannelBuilder
newBuilder(GrpcServerAddress address, AlluxioConfiguration conf, AuthType authType, boolean alwaysEnableTLS)
Create a channel builder for given address using the given configuration.GrpcChannelBuilder
setNetworkGroup(GrpcNetworkGroup group)
Sets the pooling strategy.GrpcChannelBuilder
setSubject(javax.security.auth.Subject subject)
SetsSubject
for authentication.
-
-
-
Constructor Detail
-
GrpcChannelBuilder
protected GrpcChannelBuilder(GrpcServerAddress address, AlluxioConfiguration conf, AuthType authType, boolean alwaysEnableTLS)
-
-
Method Detail
-
newBuilder
public static GrpcChannelBuilder newBuilder(GrpcServerAddress address, AlluxioConfiguration conf)
Create a channel builder for given address using the given configuration.- Parameters:
address
- the host addressconf
- Alluxio configuration- Returns:
- a new instance of
GrpcChannelBuilder
-
newBuilder
public static GrpcChannelBuilder newBuilder(GrpcServerAddress address, AlluxioConfiguration conf, boolean alwaysEnableTLS)
Create a channel builder for given address using the given configuration.- Parameters:
address
- the host addressconf
- Alluxio configurationalwaysEnableTLS
- whether to always enable TLS- Returns:
- a new instance of
GrpcChannelBuilder
-
newBuilder
public static GrpcChannelBuilder newBuilder(GrpcServerAddress address, AlluxioConfiguration conf, AuthType authType, boolean alwaysEnableTLS)
Create a channel builder for given address using the given configuration.- Parameters:
address
- the host addressconf
- Alluxio configurationauthType
- the auth typealwaysEnableTLS
- whether to always enable the TLS- Returns:
- a new instance of
GrpcChannelBuilder
-
setSubject
public GrpcChannelBuilder setSubject(javax.security.auth.Subject subject)
SetsSubject
for authentication.- Parameters:
subject
- the subject- Returns:
- the updated
GrpcChannelBuilder
instance
-
disableAuthentication
public GrpcChannelBuilder disableAuthentication()
Disables authentication with the server.- Returns:
- the updated
GrpcChannelBuilder
instance
-
setNetworkGroup
public GrpcChannelBuilder setNetworkGroup(GrpcNetworkGroup group)
Sets the pooling strategy.- Parameters:
group
- the networking group- Returns:
- a new instance of
GrpcChannelBuilder
-
getAddress
protected GrpcServerAddress getAddress()
-
getNetworkGroup
protected GrpcNetworkGroup getNetworkGroup()
-
getConfiguration
protected AlluxioConfiguration getConfiguration()
-
getAlwaysEnableTLS
protected boolean getAlwaysEnableTLS()
-
getAuthType
protected AuthType getAuthType()
-
getParentSubject
protected javax.security.auth.Subject getParentSubject()
-
build
public GrpcChannel build() throws AlluxioStatusException
Creates an authenticated channel of typeGrpcChannel
.- Returns:
- the built
GrpcChannel
- Throws:
AlluxioStatusException
-
-