Package alluxio.grpc

Class 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 Detail

      • GrpcService

        public GrpcService​(io.grpc.BindableService bindableService)
        Creates a new GrpcService.
        Parameters:
        bindableService - gRPC bindable service
      • GrpcService

        public GrpcService​(io.grpc.ServerServiceDefinition serviceDefinition)
        Creates a new GrpcService.
        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 by GrpcServer 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