public static void pingService ( InetSocketAddress address , alluxio . grpc . ServiceType serviceType , AlluxioConfiguration conf ) throws AlluxioStatusException { Preconditions . checkNotNull ( address , "address" ) ; Preconditions . checkNotNull ( serviceType , "serviceType" ) ; GrpcChannel channel = GrpcChannelBuilder . newBuilder ( new GrpcServerAddress ( address ) , conf ) . build ( ) ; ServiceVersionClientServiceGrpc . ServiceVersionClientServiceBlockingStub versionClient = ServiceVersionClientServiceGrpc . newBlockingStub ( channel ) ; versionClient . getServiceVersion ( GetServiceVersionPRequest . newBuilder ( ) . setServiceType ( serviceType ) . build ( ) ) ; channel . shutdown ( ) ; }
Test if the input address is serving an Alluxio service . This method make use of the gRPC protocol for performing service communication .