Package alluxio.grpc
Class GrpcService
- java.lang.Object
-
- alluxio.grpc.GrpcService
-
public class GrpcService extends java.lang.Object
Utility class for wrapping gRPC service definition. It's internally used to specify whether the service requires an authenticated client or not.
-
-
Constructor Summary
Constructors Constructor Description GrpcService(io.grpc.BindableService bindableService)
Creates a newGrpcService
.GrpcService(io.grpc.ServerServiceDefinition serviceDefinition)
Creates a newGrpcService
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GrpcService
disableAuthentication()
If called, clients can access this service's methods without authentication.com.google.common.io.Closer
getCloser()
Gets the closer associated with this service.io.grpc.ServerServiceDefinition
getServiceDefinition()
boolean
isAuthenticated()
GrpcService
withCloseable(java.io.Closeable closeable)
Add a new closeable resource to this service's closer.
-
-
-
Constructor Detail
-
GrpcService
public GrpcService(io.grpc.BindableService bindableService)
Creates a newGrpcService
.- Parameters:
bindableService
- gRPC bindable service
-
GrpcService
public GrpcService(io.grpc.ServerServiceDefinition serviceDefinition)
Creates a newGrpcService
.- Parameters:
serviceDefinition
- gRPC service definition
-
-
Method Detail
-
disableAuthentication
public GrpcService disableAuthentication()
If called, clients can access this service's methods without authentication.- Returns:
- the updated
GrpcService
instance
-
withCloseable
public GrpcService withCloseable(java.io.Closeable closeable)
Add a new closeable resource to this service's closer. Registered closer will be owned and closed byGrpcServer
that hosts the service.- Parameters:
closeable
- the closeable resource- Returns:
- the updated
GrpcService
instance
-
getCloser
public com.google.common.io.Closer getCloser()
Gets the closer associated with this service. This is mostly used to close streams associated with service to not stall server's graceful shutdown.- Returns:
- closer for the service
-
isAuthenticated
public boolean isAuthenticated()
- Returns:
true
if this service should be accessed with authentication
-
getServiceDefinition
public io.grpc.ServerServiceDefinition getServiceDefinition()
- Returns:
- the internal
ServerServiceDefinition
-
-