Package alluxio.grpc

Class GrpcServer


  • public final class GrpcServer
    extends java.lang.Object
    An authenticated gRPC server. Corresponding gRPC channels to this server should be build by GrpcChannelBuilder.
    • Constructor Detail

      • GrpcServer

        public GrpcServer​(io.grpc.Server server,
                          AuthenticationServer authServer,
                          com.google.common.io.Closer closer,
                          long serverShutdownTimeoutMs)
        Create a new instance of GrpcServer.
        Parameters:
        server - the wrapped server
        authServer - the authentication server
        closer - resources to close during shutting down of this server
        serverShutdownTimeoutMs - server shutdown timeout in milliseconds
    • Method Detail

      • getAuthenticationServer

        public AuthenticationServer getAuthenticationServer()
        Returns:
        the authentication server associated with this server
      • start

        public GrpcServer start()
                         throws java.io.IOException
        Start serving.
        Returns:
        this instance of GrpcServer
        Throws:
        java.io.IOException - when unable to start serving
      • getBindPort

        public int getBindPort()
        Returns:
        the port that server is bound to, or null if the server is not bound to an address yet
      • shutdown

        public boolean shutdown()
        Shuts down the server.
        Returns:
        true if the server was successfully terminated
      • awaitTermination

        public void awaitTermination()
        Waits until the server is terminated.
      • isServing

        public boolean isServing()
        Returns:
        true if server is serving
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object